SlideShare a Scribd company logo
Openstack Nova APIs

Diego Parrilla
¿Quién Soy?
                Diego Parrilla
   Stackops CEO & Founder
diego.parrilla@stackops.com
          www.nubeblog.com
        twitter.com/nubeblog
          www.stackops.com
         twitter.com/stackops
                       Diego Parrilla
        diego.parrilla@stackops.com
La infraestructura ya no es una ventaja competitiva
  La infraestructura ya no es necesaria
  Se buscan formas pago por su uso
  Las formas de pago deben ser de alta granularidad
  Debe ser muy elástica, ¡igual tenemos éxito!
  Así aparece la Infraestructura como Servicio

                                                          Diego Parrilla
                                           diego.parrilla@stackops.com     3
Las empresas empiezan a ‘infectarse’
 Tecnologías que usan IaaS y no ‘hierro’

 Procesos de gestión adaptadas al IaaS: metodologías
  ágiles.

 La aplicación prevalece sobre la infraestructura

 Ingenieros con perfiles nuevos e ideas diferentes
  (Devops)

                                                      Diego Parrilla
                                       diego.parrilla@stackops.com     4
Software to provision virtual machines on
                    standard hardware at massive scale
OpenStack Compute


A community creating open source software to
build public and private clouds

                    Software to reliably store billions of objects
                    distributed across standard hardware

OpenStack
Object Storage
                                                            Diego Parrilla
                                             diego.parrilla@stackops.com
OpenStack Community Today




                                           Diego Parrilla
                            diego.parrilla@stackops.com
Company launched in March 2011                   Figures

Total Downloads                                  >22000

Platforms deployed with our distro (15/3/2012)   >14000

Clients registered (15/3/2012)                   >3000




                                                                          Diego Parrilla
                                                           diego.parrilla@stackops.com
 SysAdmins
 Python developers
 Java developers
 FrontEnd developers (ExtJS)


                                               Diego Parrilla
                                diego.parrilla@stackops.com
¿Qué es un DevOp?
 Conjunto de principios, métodos y prácticas para la colaboración e integración entre
  desarrolladores y operaciones.


 Combinación de ‘developer’ y ‘operations’


 Operaciones programadas usando este tipo de plataformas y herramientas.


 De operaciones reactivas, a unas más ágiles y automatizadas.


 Meta: producir software y/o servicios más rápida y eficientemente.

                                                                         Diego Parrilla   9
                                                          diego.parrilla@stackops.com
Diseño de soluciones
 Los desarrolladores ganan poder en el diseño de las soluciones.


 La aplicación dicta sus propias necesidades de recursos.


 Desarrollo ‘pasa el marrón’ a Operaciones.


 Operaciones se defiende poniendo barreras. Actitud defensiva.


 Para evitarlo el ecosistema de la app debe gestionarse por software.
                                                                  Diego Parrilla   10
                                                   diego.parrilla@stackops.com
Mantenimiento automatizado
 Aparecen nuevas herramientas que automatizan tareas cotidianas de los
  SysAdmins


 Herramientas que se programan como si fuera un Framework más:
      Chef,
      Puppet,
      Fabric…


 Sistemas que se gestionan como servicios mediante APIS.


                                                                Diego Parrilla   11
                                                 diego.parrilla@stackops.com
Cloud Users

    EC2              Openstack    Glance                Quantum


                                 Northbridge APIs


                                                     Keystone


                                  Southbridge APIs

   Platform Admins

                      Admin      StackOps




                                                                    Diego Parrilla
                                                     diego.parrilla@stackops.com
http://api.openstack.org




                                  Diego Parrilla
                   diego.parrilla@stackops.com
Diego Parrilla
diego.parrilla@stackops.com
Solicitar token a Keystone
curl -s -d
"{"auth":{"passwordCredentials":
   {"username": "$NOVA_USERNAME", "password": "$NOVA_API_K
   EY"}}}" -H "Content-type: application/json" http://
   $HOST_IP:5000/v2.0/tokens


{"access": {"token": {"expires": "2012-03-24T11:38:43", "id":
   "8fd10194-5e6c-41f6-9301-f83a1fcff9c7"}, "user": {"id": "1",
   "roles": [{"id": "1", "name": "Admin"}, {"id": "3", "name":
   "KeystoneAdmin"}, {"id": "4", "name":
   "KeystoneServiceAdmin"}], "name": "admin"}}}


                                                          Diego Parrilla
                                           diego.parrilla@stackops.com
Usando el token con Glance (I)
IMAGE_NAME='ttylinux-uec-amd64-12.1_2.6.35-22_1’
tar -zxf ./$IMAGE_NAME.tar.gz     -C /tmp/images
RVAL=`glance add -A $AUTH_TOKEN name="ttylinux-kernel" is_public=true container_format=aki
    disk_format=aki < /tmp/images/$IMAGE_NAME-vmlinuz*`
KERNEL_ID=`echo $RVAL | cut -d":" -f2 | tr -d " "`
glance add -A $AUTH_TOKEN name="ttylinux" is_public=true container_format=ami disk_format=ami
    kernel_id=$KERNEL_ID < /tmp/images/$IMAGE_NAME.img

root@nova-controller:/var/lib/stackops# glance index -A $AUTH_TOKEN
ID              Name                           Disk Format            Container Format           Size
---------------- ------------------------------ -------------------- -------------------- --------------
10              ttylinux                       ami                    ami                               25165824
9               ttylinux-kernel                aki                    aki                                4404752
root@nova-controller:/var/lib/stackops#



                                                                                       Diego Parrilla
                                                                        diego.parrilla@stackops.com
Usando el token con Glance (II)
curl -H "X-Auth-Token:$AUTH_TOKEN" http://GLANCE_HOST:9292/v1/images




{"images":
[{"name": "ttylinux", "container_format": "ami", "disk_format": "ami", "checksum":
   "10047a119149e08fb206eea89832eee0", "id": 10, "size": 25165824},
 {"name": "ttylinux-kernel", "container_format": "aki", "disk_format": "aki",
   "checksum": "3ed2965d3f8d877a3ee3e061fd648e9a", "id": 9, "size": 4404752}]
}




                                                                       Diego Parrilla
                                                        diego.parrilla@stackops.com
EC2 Query API vs Openstack API




                                    Diego Parrilla
                     diego.parrilla@stackops.com
EC2 Query API
 Basada en GET y POST + Parámetros
 Cada petición debe ir firmada
?Action=DescribeImages
&AWSAccessKeyId=10QMXFEV71ZS32XQFTR2
&SignatureVersion=1
&Timestamp=2006-12-08T07%3A48%3A03Z
&Version=2007-01-03

 Message Authentication Code (HMAC) con función hash SHA-1

&Signature=GjH3941IBe6qsgQu%2Bk7FpCJjpnc%3D


                                                             Diego Parrilla
                                              diego.parrilla@stackops.com
Openstack API
 REST
 Basada en el API de Rackspace
 Extensible:
       Quantum
       System Usage


?Action=DescribeImages
&AWSAccessKeyId=10QMXFEV71ZS32XQFTR2
&SignatureVersion=1
&Timestamp=2006-12-08T07%3A48%3A03Z
&Version=2007-01-03



                                                          Diego Parrilla
                                           diego.parrilla@stackops.com
Obtener lista de servicios del tenant
 Necesitamos username, password y tenantId
curl -s -d "{"auth":{"passwordCredentials":
   {"username": "$NOVA_USERNAME", "password": "$NOVA_API_KEY"}, "tenantId
   ":”$TENANT_ID"}}" -H "Content-type: application/json"
   http://$HOST_IP:5000/v2.0/tokens
{"access":
    {"token": {"expires": "2015-02-05T00:00:00", "id": "999888777666", "tenant": {"id": "1", "name": "admin”}},
"serviceCatalog": [
{"endpoints": [{"adminURL": "http://10.0.2.15:8774/v1.1/1", "region": "nova", "internalURL": "http://10.0.2.15:8774/
     v1.1/1", "publicURL": "http://10.0.2.15:80/v1.1/1"}], "type": "compute", "name": "nova"},
{"endpoints": [{"adminURL": "http://10.0.2.15:9292/v1.1/1", "region": "nova", "internalURL": "http://10.0.2.15:9292/
     v1.1/1", "publicURL": "http://10.0.2.15:9292/v1.1/1"}], "type": "image", "name": "glance"},
{"endpoints": [{"adminURL": "http://10.0.2.15:35357/v2.0", "region": "nova", "internalURL":
     "http://10.0.2.15:5000/v2.0", "publicURL": "http://10.0.2.15:5000/v2.0"}], "type": "identity", "name":
     "keystone"}],
"user": {"id": "1", "roles": [{"tenantId": "1", "id": "1", "name": "Admin"}, {"id": "1", "name": "Admin"}, {"id":
     "3", "name": "KeystoneAdmin"}, {"id": "4", "name": "KeystoneServiceAdmin"}], "name": "admin"}}}




                                                                                             Diego Parrilla
                                                                              diego.parrilla@stackops.com
Obtener lista de imagenes disponibles
 Necesitamos el token
curl -i http://10.0.2.15:80/v1.1/1/images/detail -H "X-Auth-Token: 999888777666"

{"images":
   [{"status": "ACTIVE", "updated": "2012-03-23T12:06:15Z", "name":
   "ttylinux", "links": [{"href": "http://10.0.2.15/v1.1/1/images/10",
   "rel": "self"}, {"href": "http://10.0.2.15/1/images/10", "rel":
   "bookmark"}], "created": "2012-03-23T12:06:14Z", "progress": 100,
   "id": "10", "metadata": {"kernel_id": "9", "min_disk": 0, "min_ram":
   0, "owner": null}},
   {"status": "ACTIVE", "updated": "2012-03-23T12:06:13Z", "name":
   "ttylinux-kernel", "links": [{"href": "http://10.0.2.15/v1.1/1/images/
   9", "rel": "self"}, {"href": "http://10.0.2.15/1/images/9", "rel":
   "bookmark"}], "created": "2012-03-23T12:06:13Z", "progress": 100,
   "id": "9", "metadata": {"min_disk": 0, "owner": null, "min_ram": 0}}]}

                                                                       Diego Parrilla
                                                        diego.parrilla@stackops.com
Obtener lista de ‘sabores’ disponibles
 Necesitamos el token
curl -i http://10.0.2.15:80/v1.1/1/flavors -H "X-Auth-Token: 999888777666"

{"flavors":
[{"id": 3, "links": [{"href": "http://10.0.2.15/v1.1/1/flavors/3",
   "rel": "self"}, {"href": "http://10.0.2.15/1/flavors/3", "rel":
   "bookmark"}], "name": "m1.medium"}, {"id": 4, "links": [{"href":
   "http://10.0.2.15/v1.1/1/flavors/4", "rel": "self"}, {"href": "http://
   10.0.2.15/1/flavors/4", "rel": "bookmark"}],"name": "m1.large"},
   {"id": 1, "links": [{"href": "http://10.0.2.15/v1.1/1/flavors/1",
   "rel": "self"}, {"href": "http://10.0.2.15/1/flavors/1", "rel":
   "bookmark"}], "name": "m1.tiny"}, {"id": 5, "links": [{"href":
   "http://10.0.2.15/v1.1/1/flavors/5", "rel": "self"}, {"href": "http://
   10.0.2.15/1/flavors/5", "rel": "bookmark"}], "name": "m1.xlarge"},
   {"id": 2, "links": [{"href": "http://10.0.2.15/v1.1/1/flavors/2",
   "rel": "self"}, {"href": "http://10.0.2.15/1/flavors/2", "rel":
   "bookmark"}], "name": "m1.small"}]}
                                                                       Diego Parrilla
                                                        diego.parrilla@stackops.com
Obtener informacion m1.tiny
 Necesitamos el token la referencia a la m1.tiny
curl -i http://10.0.2.15:80/v1.1/1/flavors/1 -H "X-Auth-Token: 999888777666"

{"flavor":
   {"rxtx_quota": 0,
   "name": "m1.tiny",
   "links": [{"href": "http://10.0.2.15/v1.1/1/flavors/1", "rel": "self"},
             {"href": "http://10.0.2.15/1/flavors/1", "rel": "bookmark"}],
   "ram": 512,
   "vcpus": 1,
   "rxtx_cap": 0,
   "swap": 0,
   "disk": 0,
   "id": 1}}

                                                                       Diego Parrilla
                                                        diego.parrilla@stackops.com
Arrancar una VM m1.tiny con ttylinux
 Necesitamos el token, la referencia a la m1.tiny y a la imagen ttylinux
curl -i http://10.0.2.15:80/v1.1/1/servers -X POST -d ' {"server": {"flavorRef":
   "1", "name": "Test3", "imageRef": „10"}}' -H "X-Auth-Token: 999888777666" -H
   "Accept: application/json" -H "Content-type: application/json"

{"server": {
    "status": "BUILD",
    "updated": "2012-03-24T01:29:40Z",
    "hostId": "",
    "user_id": "admin",
    "name": "Test3",
    "links": [{"href": "http://10.0.2.15/v1.1/1/servers/3", "rel": "self"}, {"href":
    "http://10.0.2.15/1/servers/3", "rel": "bookmark"}],
    "addresses": {},
    "tenant_id": "1",
    "image": {"id": “10", "links": [{"href": "http://10.0.2.15/1/images/10", "rel":
    "bookmark"}]},
    ….: {}}}


                                                                                Diego Parrilla
                                                                 diego.parrilla@stackops.com
Ver el estado del despliegue de la VM
 Necesitamos el token y el ID de la VM
curl -i http://10.0.2.15:80/v1.1/1/servers/3 -H "X-Auth-Token: 999888777666"

{"server":
    {"status": "ACTIVE",
    "updated": "2012-03-24T01:29:48Z",
    "hostId": "0efed51f62cbab80576f1d3e4c540a35d5aaa76dab99fe6a2aabf838",
    "user_id": "admin",
    "name": "Test3",
    "links": [{"href": "http://10.0.2.15/v1.1/1/servers/3", "rel": "self"}, {"href": "http:/
    /10.0.2.15/1/servers/3", "rel": "bookmark"}],
    "addresses": {"service": [{"version": 4, "addr": "10.0.0.4"}]},
    "tenant_id": "1",
    "image": {"id": “10", "links": [{"href": "http://10.0.2.15/1/images/10", "rel":
    "bookmark"}]},
     "created": "2012-03-24T01:29:40Z",
    "uuid": "c404217a-fccf-41ce-969f-3e442c4e1b92", …
    …}}

                                                                                Diego Parrilla
                                                                 diego.parrilla@stackops.com
Terminar y borrar una VM
 Necesitamos el token y el UUID (No el ID) de la VM
curl -i http://10.0.2.15:80/v1.1/1/servers/632b9f58-20f3-4c95-9dca-bbae8c9e02b8 -X
   DELETE -H "X-Auth-Token: 999888777666"
HTTP/1.1 204 No Content




                                                                       Diego Parrilla
                                                        diego.parrilla@stackops.com
¡Muchas Gracias!
 www.openstack.org
 docs.openstack.org
 apis.openstack.org
 wiki.openstack.org
  docs.stackops.org

diego.parrilla@stackops.com

                                         Diego Parrilla
                          diego.parrilla@stackops.com

More Related Content

PDF
Top 8 WCM Trends 2010
PDF
Cloud-native .NET-Microservices mit Kubernetes @BASTAcon
PPT
Azure Powershell Tips
PDF
Pi Day 2022 - from IoT to MySQL HeatWave Database Service
PPTX
Stackops - Openstack Nova sizing & service definition
PDF
Improvements in OpenStack Integration for Application Developers
PDF
Aplicaciones distribuidas con Dapr
PPTX
Webex APIs for Admins - Cisco Live Orlando 2018 - DEVNET-3610
Top 8 WCM Trends 2010
Cloud-native .NET-Microservices mit Kubernetes @BASTAcon
Azure Powershell Tips
Pi Day 2022 - from IoT to MySQL HeatWave Database Service
Stackops - Openstack Nova sizing & service definition
Improvements in OpenStack Integration for Application Developers
Aplicaciones distribuidas con Dapr
Webex APIs for Admins - Cisco Live Orlando 2018 - DEVNET-3610

Similar to Openstack Nova APIs (20)

PDF
Introduction to Apache NiFi 1.11.4
PDF
Operator SDK for K8s using Go
PPTX
Dublin Ireland Spark Meetup October 15, 2015
PPTX
使用 Prometheus 監控 Kubernetes Cluster
PDF
Kasten securing access to your kubernetes applications
PPTX
How to lock a Python in a cage? Managing Python environment inside an R project
PDF
Enterprise guide to building a Data Mesh
PDF
Cncf microservices security
PDF
Cloud Native Applications on OpenShift
PDF
Cloud-native .NET Microservices mit Kubernetes
PDF
how to use openstack api
PPTX
Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891
PDF
Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...
PDF
Node Interactive: Node.js Performance and Highly Scalable Micro-Services
PDF
Spark + AI Summit 2020 イベント概要
PPTX
Serverless survival kit
PDF
Let's build Developer Portal with Backstage
PPTX
Data relay introduction to big data clusters
DOCX
Resume latest Update
PPTX
Cotech- OPA-v2.pptx
Introduction to Apache NiFi 1.11.4
Operator SDK for K8s using Go
Dublin Ireland Spark Meetup October 15, 2015
使用 Prometheus 監控 Kubernetes Cluster
Kasten securing access to your kubernetes applications
How to lock a Python in a cage? Managing Python environment inside an R project
Enterprise guide to building a Data Mesh
Cncf microservices security
Cloud Native Applications on OpenShift
Cloud-native .NET Microservices mit Kubernetes
how to use openstack api
Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891
Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...
Node Interactive: Node.js Performance and Highly Scalable Micro-Services
Spark + AI Summit 2020 イベント概要
Serverless survival kit
Let's build Developer Portal with Backstage
Data relay introduction to big data clusters
Resume latest Update
Cotech- OPA-v2.pptx
Ad

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Machine Learning_overview_presentation.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
1. Introduction to Computer Programming.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Empathic Computing: Creating Shared Understanding
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Electronic commerce courselecture one. Pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation theory and applications.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPT
Teaching material agriculture food technology
PPTX
Big Data Technologies - Introduction.pptx
PDF
Machine learning based COVID-19 study performance prediction
PPTX
MYSQL Presentation for SQL database connectivity
Spectral efficient network and resource selection model in 5G networks
Machine Learning_overview_presentation.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
1. Introduction to Computer Programming.pptx
Approach and Philosophy of On baking technology
Empathic Computing: Creating Shared Understanding
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Advanced methodologies resolving dimensionality complications for autism neur...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Electronic commerce courselecture one. Pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation theory and applications.pdf
cuic standard and advanced reporting.pdf
NewMind AI Weekly Chronicles - August'25-Week II
Digital-Transformation-Roadmap-for-Companies.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Teaching material agriculture food technology
Big Data Technologies - Introduction.pptx
Machine learning based COVID-19 study performance prediction
MYSQL Presentation for SQL database connectivity
Ad

Openstack Nova APIs

  • 2. ¿Quién Soy? Diego Parrilla Stackops CEO & Founder diego.parrilla@stackops.com www.nubeblog.com twitter.com/nubeblog www.stackops.com twitter.com/stackops Diego Parrilla diego.parrilla@stackops.com
  • 3. La infraestructura ya no es una ventaja competitiva  La infraestructura ya no es necesaria  Se buscan formas pago por su uso  Las formas de pago deben ser de alta granularidad  Debe ser muy elástica, ¡igual tenemos éxito!  Así aparece la Infraestructura como Servicio Diego Parrilla diego.parrilla@stackops.com 3
  • 4. Las empresas empiezan a ‘infectarse’  Tecnologías que usan IaaS y no ‘hierro’  Procesos de gestión adaptadas al IaaS: metodologías ágiles.  La aplicación prevalece sobre la infraestructura  Ingenieros con perfiles nuevos e ideas diferentes (Devops) Diego Parrilla diego.parrilla@stackops.com 4
  • 5. Software to provision virtual machines on standard hardware at massive scale OpenStack Compute A community creating open source software to build public and private clouds Software to reliably store billions of objects distributed across standard hardware OpenStack Object Storage Diego Parrilla diego.parrilla@stackops.com
  • 6. OpenStack Community Today Diego Parrilla diego.parrilla@stackops.com
  • 7. Company launched in March 2011 Figures Total Downloads >22000 Platforms deployed with our distro (15/3/2012) >14000 Clients registered (15/3/2012) >3000 Diego Parrilla diego.parrilla@stackops.com
  • 8.  SysAdmins  Python developers  Java developers  FrontEnd developers (ExtJS) Diego Parrilla diego.parrilla@stackops.com
  • 9. ¿Qué es un DevOp?  Conjunto de principios, métodos y prácticas para la colaboración e integración entre desarrolladores y operaciones.  Combinación de ‘developer’ y ‘operations’  Operaciones programadas usando este tipo de plataformas y herramientas.  De operaciones reactivas, a unas más ágiles y automatizadas.  Meta: producir software y/o servicios más rápida y eficientemente. Diego Parrilla 9 diego.parrilla@stackops.com
  • 10. Diseño de soluciones  Los desarrolladores ganan poder en el diseño de las soluciones.  La aplicación dicta sus propias necesidades de recursos.  Desarrollo ‘pasa el marrón’ a Operaciones.  Operaciones se defiende poniendo barreras. Actitud defensiva.  Para evitarlo el ecosistema de la app debe gestionarse por software. Diego Parrilla 10 diego.parrilla@stackops.com
  • 11. Mantenimiento automatizado  Aparecen nuevas herramientas que automatizan tareas cotidianas de los SysAdmins  Herramientas que se programan como si fuera un Framework más:  Chef,  Puppet,  Fabric…  Sistemas que se gestionan como servicios mediante APIS. Diego Parrilla 11 diego.parrilla@stackops.com
  • 12. Cloud Users EC2 Openstack Glance Quantum Northbridge APIs Keystone Southbridge APIs Platform Admins Admin StackOps Diego Parrilla diego.parrilla@stackops.com
  • 13. http://api.openstack.org Diego Parrilla diego.parrilla@stackops.com
  • 15. Solicitar token a Keystone curl -s -d "{"auth":{"passwordCredentials": {"username": "$NOVA_USERNAME", "password": "$NOVA_API_K EY"}}}" -H "Content-type: application/json" http:// $HOST_IP:5000/v2.0/tokens {"access": {"token": {"expires": "2012-03-24T11:38:43", "id": "8fd10194-5e6c-41f6-9301-f83a1fcff9c7"}, "user": {"id": "1", "roles": [{"id": "1", "name": "Admin"}, {"id": "3", "name": "KeystoneAdmin"}, {"id": "4", "name": "KeystoneServiceAdmin"}], "name": "admin"}}} Diego Parrilla diego.parrilla@stackops.com
  • 16. Usando el token con Glance (I) IMAGE_NAME='ttylinux-uec-amd64-12.1_2.6.35-22_1’ tar -zxf ./$IMAGE_NAME.tar.gz -C /tmp/images RVAL=`glance add -A $AUTH_TOKEN name="ttylinux-kernel" is_public=true container_format=aki disk_format=aki < /tmp/images/$IMAGE_NAME-vmlinuz*` KERNEL_ID=`echo $RVAL | cut -d":" -f2 | tr -d " "` glance add -A $AUTH_TOKEN name="ttylinux" is_public=true container_format=ami disk_format=ami kernel_id=$KERNEL_ID < /tmp/images/$IMAGE_NAME.img root@nova-controller:/var/lib/stackops# glance index -A $AUTH_TOKEN ID Name Disk Format Container Format Size ---------------- ------------------------------ -------------------- -------------------- -------------- 10 ttylinux ami ami 25165824 9 ttylinux-kernel aki aki 4404752 root@nova-controller:/var/lib/stackops# Diego Parrilla diego.parrilla@stackops.com
  • 17. Usando el token con Glance (II) curl -H "X-Auth-Token:$AUTH_TOKEN" http://GLANCE_HOST:9292/v1/images {"images": [{"name": "ttylinux", "container_format": "ami", "disk_format": "ami", "checksum": "10047a119149e08fb206eea89832eee0", "id": 10, "size": 25165824}, {"name": "ttylinux-kernel", "container_format": "aki", "disk_format": "aki", "checksum": "3ed2965d3f8d877a3ee3e061fd648e9a", "id": 9, "size": 4404752}] } Diego Parrilla diego.parrilla@stackops.com
  • 18. EC2 Query API vs Openstack API Diego Parrilla diego.parrilla@stackops.com
  • 19. EC2 Query API  Basada en GET y POST + Parámetros  Cada petición debe ir firmada ?Action=DescribeImages &AWSAccessKeyId=10QMXFEV71ZS32XQFTR2 &SignatureVersion=1 &Timestamp=2006-12-08T07%3A48%3A03Z &Version=2007-01-03  Message Authentication Code (HMAC) con función hash SHA-1 &Signature=GjH3941IBe6qsgQu%2Bk7FpCJjpnc%3D Diego Parrilla diego.parrilla@stackops.com
  • 20. Openstack API  REST  Basada en el API de Rackspace  Extensible:  Quantum  System Usage ?Action=DescribeImages &AWSAccessKeyId=10QMXFEV71ZS32XQFTR2 &SignatureVersion=1 &Timestamp=2006-12-08T07%3A48%3A03Z &Version=2007-01-03 Diego Parrilla diego.parrilla@stackops.com
  • 21. Obtener lista de servicios del tenant  Necesitamos username, password y tenantId curl -s -d "{"auth":{"passwordCredentials": {"username": "$NOVA_USERNAME", "password": "$NOVA_API_KEY"}, "tenantId ":”$TENANT_ID"}}" -H "Content-type: application/json" http://$HOST_IP:5000/v2.0/tokens {"access": {"token": {"expires": "2015-02-05T00:00:00", "id": "999888777666", "tenant": {"id": "1", "name": "admin”}}, "serviceCatalog": [ {"endpoints": [{"adminURL": "http://10.0.2.15:8774/v1.1/1", "region": "nova", "internalURL": "http://10.0.2.15:8774/ v1.1/1", "publicURL": "http://10.0.2.15:80/v1.1/1"}], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": "http://10.0.2.15:9292/v1.1/1", "region": "nova", "internalURL": "http://10.0.2.15:9292/ v1.1/1", "publicURL": "http://10.0.2.15:9292/v1.1/1"}], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL": "http://10.0.2.15:35357/v2.0", "region": "nova", "internalURL": "http://10.0.2.15:5000/v2.0", "publicURL": "http://10.0.2.15:5000/v2.0"}], "type": "identity", "name": "keystone"}], "user": {"id": "1", "roles": [{"tenantId": "1", "id": "1", "name": "Admin"}, {"id": "1", "name": "Admin"}, {"id": "3", "name": "KeystoneAdmin"}, {"id": "4", "name": "KeystoneServiceAdmin"}], "name": "admin"}}} Diego Parrilla diego.parrilla@stackops.com
  • 22. Obtener lista de imagenes disponibles  Necesitamos el token curl -i http://10.0.2.15:80/v1.1/1/images/detail -H "X-Auth-Token: 999888777666" {"images": [{"status": "ACTIVE", "updated": "2012-03-23T12:06:15Z", "name": "ttylinux", "links": [{"href": "http://10.0.2.15/v1.1/1/images/10", "rel": "self"}, {"href": "http://10.0.2.15/1/images/10", "rel": "bookmark"}], "created": "2012-03-23T12:06:14Z", "progress": 100, "id": "10", "metadata": {"kernel_id": "9", "min_disk": 0, "min_ram": 0, "owner": null}}, {"status": "ACTIVE", "updated": "2012-03-23T12:06:13Z", "name": "ttylinux-kernel", "links": [{"href": "http://10.0.2.15/v1.1/1/images/ 9", "rel": "self"}, {"href": "http://10.0.2.15/1/images/9", "rel": "bookmark"}], "created": "2012-03-23T12:06:13Z", "progress": 100, "id": "9", "metadata": {"min_disk": 0, "owner": null, "min_ram": 0}}]} Diego Parrilla diego.parrilla@stackops.com
  • 23. Obtener lista de ‘sabores’ disponibles  Necesitamos el token curl -i http://10.0.2.15:80/v1.1/1/flavors -H "X-Auth-Token: 999888777666" {"flavors": [{"id": 3, "links": [{"href": "http://10.0.2.15/v1.1/1/flavors/3", "rel": "self"}, {"href": "http://10.0.2.15/1/flavors/3", "rel": "bookmark"}], "name": "m1.medium"}, {"id": 4, "links": [{"href": "http://10.0.2.15/v1.1/1/flavors/4", "rel": "self"}, {"href": "http:// 10.0.2.15/1/flavors/4", "rel": "bookmark"}],"name": "m1.large"}, {"id": 1, "links": [{"href": "http://10.0.2.15/v1.1/1/flavors/1", "rel": "self"}, {"href": "http://10.0.2.15/1/flavors/1", "rel": "bookmark"}], "name": "m1.tiny"}, {"id": 5, "links": [{"href": "http://10.0.2.15/v1.1/1/flavors/5", "rel": "self"}, {"href": "http:// 10.0.2.15/1/flavors/5", "rel": "bookmark"}], "name": "m1.xlarge"}, {"id": 2, "links": [{"href": "http://10.0.2.15/v1.1/1/flavors/2", "rel": "self"}, {"href": "http://10.0.2.15/1/flavors/2", "rel": "bookmark"}], "name": "m1.small"}]} Diego Parrilla diego.parrilla@stackops.com
  • 24. Obtener informacion m1.tiny  Necesitamos el token la referencia a la m1.tiny curl -i http://10.0.2.15:80/v1.1/1/flavors/1 -H "X-Auth-Token: 999888777666" {"flavor": {"rxtx_quota": 0, "name": "m1.tiny", "links": [{"href": "http://10.0.2.15/v1.1/1/flavors/1", "rel": "self"}, {"href": "http://10.0.2.15/1/flavors/1", "rel": "bookmark"}], "ram": 512, "vcpus": 1, "rxtx_cap": 0, "swap": 0, "disk": 0, "id": 1}} Diego Parrilla diego.parrilla@stackops.com
  • 25. Arrancar una VM m1.tiny con ttylinux  Necesitamos el token, la referencia a la m1.tiny y a la imagen ttylinux curl -i http://10.0.2.15:80/v1.1/1/servers -X POST -d ' {"server": {"flavorRef": "1", "name": "Test3", "imageRef": „10"}}' -H "X-Auth-Token: 999888777666" -H "Accept: application/json" -H "Content-type: application/json" {"server": { "status": "BUILD", "updated": "2012-03-24T01:29:40Z", "hostId": "", "user_id": "admin", "name": "Test3", "links": [{"href": "http://10.0.2.15/v1.1/1/servers/3", "rel": "self"}, {"href": "http://10.0.2.15/1/servers/3", "rel": "bookmark"}], "addresses": {}, "tenant_id": "1", "image": {"id": “10", "links": [{"href": "http://10.0.2.15/1/images/10", "rel": "bookmark"}]}, ….: {}}} Diego Parrilla diego.parrilla@stackops.com
  • 26. Ver el estado del despliegue de la VM  Necesitamos el token y el ID de la VM curl -i http://10.0.2.15:80/v1.1/1/servers/3 -H "X-Auth-Token: 999888777666" {"server": {"status": "ACTIVE", "updated": "2012-03-24T01:29:48Z", "hostId": "0efed51f62cbab80576f1d3e4c540a35d5aaa76dab99fe6a2aabf838", "user_id": "admin", "name": "Test3", "links": [{"href": "http://10.0.2.15/v1.1/1/servers/3", "rel": "self"}, {"href": "http:/ /10.0.2.15/1/servers/3", "rel": "bookmark"}], "addresses": {"service": [{"version": 4, "addr": "10.0.0.4"}]}, "tenant_id": "1", "image": {"id": “10", "links": [{"href": "http://10.0.2.15/1/images/10", "rel": "bookmark"}]}, "created": "2012-03-24T01:29:40Z", "uuid": "c404217a-fccf-41ce-969f-3e442c4e1b92", … …}} Diego Parrilla diego.parrilla@stackops.com
  • 27. Terminar y borrar una VM  Necesitamos el token y el UUID (No el ID) de la VM curl -i http://10.0.2.15:80/v1.1/1/servers/632b9f58-20f3-4c95-9dca-bbae8c9e02b8 -X DELETE -H "X-Auth-Token: 999888777666" HTTP/1.1 204 No Content Diego Parrilla diego.parrilla@stackops.com
  • 28. ¡Muchas Gracias! www.openstack.org docs.openstack.org apis.openstack.org wiki.openstack.org docs.stackops.org diego.parrilla@stackops.com Diego Parrilla diego.parrilla@stackops.com

Editor's Notes

  • #2: 06/03/12 AUTORE