diff --git a/doc/src/docbkx/api-quick-start/src/docbkx/api-examples.xml b/doc/src/docbkx/api-quick-start/src/docbkx/api-examples.xml index ebfb3f351c..a5fc2666ef 100644 --- a/doc/src/docbkx/api-quick-start/src/docbkx/api-examples.xml +++ b/doc/src/docbkx/api-quick-start/src/docbkx/api-examples.xml @@ -8,13 +8,36 @@ OpenStack API Examples Here are some examples of the basic API commands you can send to an OpenStack deployment - containing Compute, the Image Service, and with a running Identity Server. + containing Compute, the Image Service, with a running Identity Server. In the "service + catalog" that is returned when you get a token, you can find the endpoint URLs that you use + for these API commands. For example this public URL entry in the service catalog offers the + URL for the Image Service, code-named glance: + + "publicURL": "http://55.51.11.198:9292/v1.1/9"}], "type": "image", "name": "glance" + + For the Compute API, you see a service of type compute, code-named "nova" such as: + + "publicURL": "http://55.51.11.198:8774/v1.1/9"}], "type": "compute", "name": "nova" + + With these publicURLs in hand, you can now use curl commands for these endpoints and send + API requests. The following sections offer walk-throughs of common API commands. Refer to + docs.openstack.org/api for a + full reference of all API commands for these services.
- Compute API Server Examples - GET /v1.1/servers + Compute API Server Information Examples + GET /v1.1/servers + Gives you a listing of active servers under your account and tenant authorized with a + particular token. If there are no servers running, you see just "{"servers": []}" + returned but still get a 200 OK response. + Curl example: + curl -D - -H "X-Auth-Token: 3017813d-deca-4764-aa33-9ab59a283ba6" -X 'GET' -v http://host.na.me:8774/v1.1/9/servers - GET /v1.1/servers/details + GET /v1.1/servers/detail + Shows details of all the active servers currently running under your account. + Curl example: + curl -D - -H "X-Auth-Token: 3017813d-deca-4764-aa33-9ab59a283ba6" -X 'GET' -v + http://demo.rcb.me:8774/v1.1/9/servers/detail POST /v1.1/servers GET /v1.1/servers/id PUT /v1.1/servers/id @@ -33,8 +56,54 @@
Compute API Flavor Examples - GET /v1.1/flavors - GET /v1.1/flavors/detail + GET /v1.1/flavors + Gives you a listing of flavors available, which are combinations of disk space, memory + and CPU capacity bundled together as resources for virtual machines. + Curl example: + curl -D - -H "X-Auth-Token: 3017813d-deca-4764-aa33-9ab59a283ba6" -X 'GET' -v + http://demo.rcb.me:8774/v1.1/9/flavors + +{"flavors": [{"id": 3, "links": [ +{"href": "http://demo.rcb.me:8774/v1.1/9/flavors/3", "rel": "self"}, +{"href": "http://demo.rcb.me:8774/9/flavors/3", "rel": "bookmark"}], "name": "m1.medium"}, +{"id": 4, "links": [{"href": "http://demo.rcb.me:8774/v1.1/9/flavors/4", "rel": "self"}, +{"href": "http://demo.rcb.me:8774/9/flavors/4", "rel": "bookmark"}], "name": "m1.large"}, +{"id": 1, "links": [{"href": "http://demo.rcb.me:8774/v1.1/9/flavors/1", "rel": "self"}, +{"href": "http://demo.rcb.me:8774/9/flavors/1", "rel": "bookmark"}], "name": "m1.tiny"}, +{"id": 5, "links": [{"href": "http://demo.rcb.me:8774/v1.1/9/flavors/5", "rel": "self"}, +{"href": "http://demo.rcb.me:8774/9/flavors/5", "rel": "bookmark"}], "name": "m1.xlarge"}, +{"id": 2, "links": [{"href": "http://demo.rcb.me:8774/v1.1/9/flavors/2", "rel": "self"}, +{"href": "http://demo.rcb.me:8774/9/flavors/2", "rel": "bookmark"}], "name": "m1.small"}]} + GET /v1.1/flavors/<id> + Gives you more detail about the specific flavor. + Curl example: + curl -D - -H "X-Auth-Token: 3017813d-deca-4764-aa33-9ab59a283ba6" -X 'GET' -v + http://demo.rcb.me:8774/v1.1/9/flavors/5 + {"flavor": {"rxtx_quota": 0, "name": "m1.xlarge", "links": [{"href": + "http://demo.rcb.me:8774/v1.1/9/flavors/5", "rel": "self"}, {"href": + "http://demo.rcb.me:8774/9/flavors/5", "rel": "bookmark"}], "ram": 16384, "vcpus": 8, + "rxtx_cap": 0, "swap": 0, "disk": 160, "id": 5}} + GET /v1.1/flavors/detail + Gives you details on all the available instance types (flavors). + Curl example: + curl -D - -H "X-Auth-Token: 3017813d-deca-4764-aa33-9ab59a283ba6" -X 'GET' -v + http://demo.rcb.me:8774/v1.1/9/flavors/detail + {"flavors": [{"rxtx_quota": 0, "name": "m1.medium", "links": [{"href": + "http://demo.rcb.me:8774/v1.1/9/flavors/3", "rel": "self"}, {"href": + "http://demo.rcb.me:8774/9/flavors/3", "rel": "bookmark"}], "ram": 4096, "vcpus": 2, + "rxtx_cap": 0, "swap": 0, "disk": 40, "id": 3}, {"rxtx_quota": 0, "name": "m1.large", + "links": [{"href": "http://demo.rcb.me:8774/v1.1/9/flavors/4", "rel": "self"}, {"href": + "http://demo.rcb.me:8774/9/flavors/4", "rel": "bookmark"}], "ram": 8192, "vcpus": 4, + "rxtx_cap": 0, "swap": 0, "disk": 80, "id": 4}, {"rxtx_quota": 0, "name": "m1.tiny", + "links": [{"href": "http://demo.rcb.me:8774/v1.1/9/flavors/1", "rel": "self"}, {"href": + "http://demo.rcb.me:8774/9/flavors/1", "rel": "bookmark"}], "ram": 512, "vcpus": 1, + "rxtx_cap": 0, "swap": 0, "disk": 0, "id": 1}, {"rxtx_quota": 0, "name": "m1.xlarge", + "links": [{"href": "http://demo.rcb.me:8774/v1.1/9/flavors/5", "rel": "self"}, {"href": + "http://demo.rcb.me:8774/9/flavors/5", "rel": "bookmark"}], "ram": 16384, "vcpus": 8, + "rxtx_cap": 0, "swap": 0, "disk": 160, "id": 5}, {"rxtx_quota": 0, "name": "m1.small", + "links": [{"href": "http://demo.rcb.me:8774/v1.1/9/flavors/2", "rel": "self"}, {"href": + "http://demo.rcb.me:8774/9/flavors/2", "rel": "bookmark"}], "ram": 2048, "vcpus": 1, + "rxtx_cap": 0, "swap": 0, "disk": 20, "id": 2}]}
@@ -43,6 +112,10 @@
Image API Examples GET /images + Example + + curl -D - -H GET http://host.na.me:9292/v1/images + GET /images/details GET /images/id POST /images diff --git a/doc/src/docbkx/api-quick-start/src/docbkx/api-quick-start-book.xml b/doc/src/docbkx/api-quick-start/src/docbkx/api-quick-start-book.xml new file mode 100644 index 0000000000..155e69bb9d --- /dev/null +++ b/doc/src/docbkx/api-quick-start/src/docbkx/api-quick-start-book.xml @@ -0,0 +1,43 @@ + + + OpenStack API Quick Start + + + + + + + + OpenStack + + + + 2010 + 2011 + OpenStack LLC + + Diablo + OpenStack Compute, Identity, and Image Services + 2011-10-11 + + + + Remaining licensing details are filled in by the template. + + + + OpenStack™ projects offer RESTful APIs for manipulating and retrieving objects in the cloud. This manual provides examples for sending REST requests using the Compute API v1.1, Identity API v2.0, and the Image API v1.1. + + + + + + + + diff --git a/doc/src/docbkx/api-quick-start/src/docbkx/api-quick-start.xml b/doc/src/docbkx/api-quick-start/src/docbkx/api-quick-start.xml index bca87e2565..1ec857dbc5 100644 --- a/doc/src/docbkx/api-quick-start/src/docbkx/api-quick-start.xml +++ b/doc/src/docbkx/api-quick-start/src/docbkx/api-quick-start.xml @@ -1,5 +1,5 @@ -
The OpenStack system has several key projects that are separate installations but can work together depending on your cloud needs: OpenStack Compute, OpenStack Object Storage, OpenStack Identity Service, and OpenStack Image Store. With a standalone OpenStack - installation such as the Rackspace Rapid Deployment Program, the OpenStack Compute, - OpenStack Identity, and OpenStack Image Store projects are all working together in the - background of your installation. + installation, the OpenStack Compute, OpenStack Identity, and OpenStack Image Store projects + are all working together in the background of your installation.
OpenStack API Introduction @@ -33,7 +32,7 @@ administrator gave you, typically http://hostname:5000/v2.0/tokens. You send your username, password, and what group you are with (the "tenant" in auth-speak). -$ curl -X 'POST' -v http://hostname:5000/v2.0/tokens -d '{"auth":{"passwordCredentials":{"username": "joecool", "password":"coolword"}, "tenantId":"5"}}' -H 'Content-type: application/json' +$ curl -X 'POST' -v http://host.na.me:5000/v2.0/tokens -d '{"auth":{"passwordCredentials":{"username": "joecool", "password":"coolword"}, "tenantId":"5"}}' -H 'Content-type: application/json' The server returns a response in which the 24-hours token is contained : @@ -53,7 +52,20 @@ $ curl -X 'POST' -v http://hostname:5000/v2.0/tokens -d '{"auth":{"passwordCrede > * Connection #0 to host host.na.me left intact * Closing connection #0 -{"access": {"token": {"expires": "2011-10-07T14:59:49.644963", "id": "e83abbdc-a8c8-4f81-897b-541cbcd1dbb5", "tenant": {"id": "5", "name": "coolu"}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://55.51.11.198:8774/v1.1/5", "region": "RegionOne", "internalURL": "http://55.51.11.198:8774/v1.1/5", "publicURL": "http://55.51.11.198:8774/v1.1/5"}], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": "http://55.51.11.198:9292/v1.1/5", "region": "RegionOne", "internalURL": "http://55.51.11.198:9292/v1.1/5", "publicURL": "http://55.51.11.198:9292/v1.1/5"}], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL": "http://55.51.11.198:35357/v2.0", "region": "RegionOne", "internalURL": "http://55.51.11.198:5000/v2.0", "publicURL": "http://55.51.11.198:5000/v2.0"}], "type": "identity", "name": "keystone"}], "user": {"id": "4", "roles": [{"tenantId": "5", "id": "2", "name": "Member"}], "name": "joecool"}}} +{"access": {"token": {"expires": "2011-10-07T14:59:49.644963", +"id": "e83abbdc-a8c8-4f81-897b-541cbcd1dbb5", +"tenant": {"id": "5", "name": "coolu"}}, "serviceCatalog": +[{"endpoints": [{"adminURL": "http://55.51.11.198:8774/v1.1/5", +"region": "RegionOne", "internalURL": "http://55.51.11.198:8774/v1.1/5", +"publicURL": "http://55.51.11.198:8774/v1.1/5"}], "type": "compute", "name": "nova"}, +{"endpoints": [{"adminURL": "http://55.51.11.198:9292/v1.1/5", +"region": "RegionOne", "internalURL": "http://55.51.11.198:9292/v1.1/5", +"publicURL": "http://55.51.11.198:9292/v1.1/5"}], "type": "image", "name": "glance"}, +{"endpoints": [{"adminURL": "http://55.51.11.198:35357/v2.0", +"region": "RegionOne", "internalURL": "http://55.51.11.198:5000/v2.0", +"publicURL": "http://55.51.11.198:5000/v2.0"}], +"type": "identity", "name": "keystone"}], "user": {"id": "4", "roles": +[{"tenantId": "5", "id": "2", "name": "Member"}], "name": "joecool"}}} Use that token to send API requests with the X-Auth-Token included as an header @@ -73,7 +85,7 @@ $ curl -X 'POST' -v http://hostname:5000/v2.0/tokens -d '{"auth":{"passwordCrede For a typical OpenStack deployment running the Identity Service you can request a token with this command in cURL: -$ curl -X 'POST' -v http://hostname:5000/v2.0/tokens -d '{"auth":{"passwordCredentials":{"username": "joecool", "password":"coolword"}, "tenantId":"5"}}' -H 'Content-type: application/json' +$ curl -X 'POST' -v http://host.na.me:5000/v2.0/tokens -d '{"auth":{"passwordCredentials":{"username": "joecool", "password":"coolword"}, "tenantId":"5"}}' -H 'Content-type: application/json' In return, you should get a 200 OK response with a token in the form of "id": "cd427a33-bb4a-4079-a6d7-0ae148bdeda9" and an expiration date 24 hours from now. Here's what it looks like: @@ -95,7 +107,22 @@ $ curl -X 'POST' -v http://hostname:5000/v2.0/tokens -d '{"auth":{"passwordCrede > * Connection #0 to host host.na.me left intact * Closing connection #0 -{"access": {"token": {"expires": "2011-10-07T14:59:49.644963", "id": "e83abbdc-a8c8-4f81-897b-541cbcd1dbb5", "tenant": {"id": "5", "name": "coolu"}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://55.51.11.198:8774/v1.1/5", "region": "RegionOne", "internalURL": "http://55.51.11.198:8774/v1.1/5", "publicURL": "http://55.51.11.198:8774/v1.1/5"}], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": "http://55.51.11.198:9292/v1.1/5", "region": "RegionOne", "internalURL": "http://55.51.11.198:9292/v1.1/5", "publicURL": "http://55.51.11.198:9292/v1.1/5"}], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL": "http://55.51.11.198:35357/v2.0", "region": "RegionOne", "internalURL": "http://55.51.11.198:5000/v2.0", "publicURL": "http://55.51.11.198:5000/v2.0"}], "type": "identity", "name": "keystone"}], "user": {"id": "4", "roles": [{"tenantId": "5", "id": "2", "name": "Member"}], "name": "joecool"}}} +{"access": {"token": {"expires": "2011-10-07T14:59:49.644963", +"id": "e83abbdc-a8c8-4f81-897b-541cbcd1dbb5", +"tenant": {"id": "5", "name": "coolu"}}, +"serviceCatalog": +[{"endpoints": [{"adminURL": "http://55.51.11.198:8774/v1.1/5", +"region": "RegionOne", "internalURL": "http://55.51.11.198:8774/v1.1/5", +"publicURL": "http://55.51.11.198:8774/v1.1/5"}], +"type": "compute", "name": "nova"}, +{"endpoints": [{"adminURL": "http://55.51.11.198:9292/v1.1/5", + "region": "RegionOne", "internalURL": "http://55.51.11.198:9292/v1.1/5", +"publicURL": "http://55.51.11.198:9292/v1.1/5"}], "type": "image", "name": "glance"}, +{"endpoints": [{"adminURL": "http://55.51.11.198:35357/v2.0", +"region": "RegionOne", "internalURL": "http://55.51.11.198:5000/v2.0", +"publicURL": "http://55.51.11.198:5000/v2.0"}], +"type": "identity", "name": "keystone"}], +"user": {"id": "4", "roles": [{"tenantId": "5", "id": "2", "name": "Member"}], "name": "joecool"}}}
Sending Requests to the API @@ -111,162 +138,7 @@ $ curl -X 'POST' -v http://hostname:5000/v2.0/tokens -d '{"auth":{"passwordCrede http://code.google.com/p/rest-client/. You need to generate a token as shown above if you use cURL or a REST client. - For more serious scripting work, you can use a client like the python-novaclient or - openstack-compute clients. The python-novaclient implements the Compute 1.1 API while - the openstack-compute client works against the Rackspace Cloud Servers public cloud - which is the OpenStack Compute 1.0 API. You only need a username and password to use the - python-novaclient tool.
-
Setting Up python-novaclientInstalling the python-novaclient gives you a nova shell command that enables - Compute API interactions from the command line. You install the client, and then provide - your username and password, set as environment variables for convenience, and then you - can have the ability to send commands to your cloud on the command-line. - To install python-novaclient, download the tarball from - http://pypi.python.org/pypi/python-novaclient/2.6.3#downloads and then install it in your favorite python environment. - -$ curl -O http://pypi.python.org/packages/source/p/python-novaclient/python-novaclient-2.6.3.tar.gz -$ tar -zxvf python-novaclient-2.6.3.tar.gz -$ cd python-novaclient-2.6.3 -$ sudo python setup.py install - - Now that you have installed the python-novaclient, confirm the installation by entering: -$ nova help - -usage: nova [--username USERNAME] [--apikey APIKEY] [--projectid PROJECTID] - [--url URL] [--version VERSION] - <subcommand> ... - - In return, you will get a listing of all the commands and parameters for the nova command line client. By setting up the required parameters as environment variables, you can fly through these commands on the command line. You can add --username on the nova command, or set them as environment variables: - -export NOVA_USERNAME=joecool -export NOVA_API_KEY=coolword -export NOVA_PROJECT_ID=coolu - - Using the Identity Service, you are supplied with an authentication endpoint, which nova recognizes as the NOVA_URL. - - -export NOVA_URL=http://hostname:5000/v2.0 -export NOVA_VERSION=1.1 - -
-
Listing ImagesBefore you can go about the business of building your cloud, you want to know what images are - available to you by asking the image service what kinds of configurations are available. - The image service could be compared to iTunes for your cloud - you can view the playlist - of images before using your favorite image to create a new instance in the cloud. To get - the list of images, their names, status, and ID, use this - command: - -$ nova image-list - -+----+-------------------------------------------------------+--------+ -| ID | Name | Status | -+----+-------------------------------------------------------+--------+ -| 1 | aki-tty | ACTIVE | -| 2 | ari-tty | ACTIVE | -| 3 | ami-tty | ACTIVE | -| 6 | CentOS_5.4_x64 | ACTIVE | -| 14 | maverick-kernel | ACTIVE | -| 15 | maverick | ACTIVE | -| 20 | ubuntu-kernel | ACTIVE | -| 21 | ubuntu-ramdisk | ACTIVE | -| 22 | ubuntu | ACTIVE | -| 24 | CentOS_5.6_x64_v5.7.14_Dev1 | ACTIVE | -+----+-------------------------------------------------------+--------+ - - Next you need to know the relative sizes of each of these. - -$ nova flavor-list - -+----+-----------+-----------+------+----------+-------+------------+----------+ -| ID | Name | Memory_MB | Swap | Local_GB | VCPUs | RXTX_Quota | RXTX_Cap | -+----+-----------+-----------+------+----------+-------+------------+----------+ -| 1 | m1.tiny | 512 | | 0 | | | | -| 2 | m1.small | 2048 | | 20 | | | | -| 3 | m1.medium | 4096 | | 40 | | | | -| 4 | m1.large | 8192 | | 80 | | | | -| 5 | m1.xlarge | 16384 | | 160 | | | | -| 89 | Boom | 2 | | 20 | | | | -+----+-----------+-----------+------+----------+-------+------------+----------+ - - - You can also narrow down the list by using grep to find only the CentOS images with a command like this: - - - -$ nova image-list | grep 'CentOS' - -| 6 | CentOS_5.4_x64 | ACTIVE | -| 24 | CentOS_5.6_x64_v5.7.14_Dev1 | ACTIVE | - - - -With the information about what is available to you, you can choose the combination of image and flavor to create your virtual servers and launch instances.
-
Launching Instances - - -To launch a server, you choose an image you want to match up to a size, find the ID for the image and the ID for the flavor so you can size it, and create the command with the IDs. From the information we got previously, we know that an Ubuntu Maverick image has an ID of 15, and if you want to start small with about 2 GB of memory and 20 GB of disk space, you'd choose the m1.small flavor which has an ID of 2. Put those parameters in with the "boot" command and you can create a new virtual server. - - - - $ nova boot --flavor=2 --image=15 testserver - - +-----------+--------------------------------------+ -| Property | Value | -+-----------+--------------------------------------+ -| adminPass | **************** | -| created | 2011-09-01T21:40:41Z | -| flavor | m1.small | -| hostId | | -| id | 1805 | -| image | maverick | -| metadata | {} | -| name | testserver | -| progress | 0 | -| status | BUILD | -| updated | 2011-09-01T21:40:41Z | -| uuid | ce044452-f22e-4ea4-a3ec-d1cde80cf996 | -+-----------+--------------------------------------+ - - - Now, you can view this server in your new cloud by using the nova list - command: -$ nova list -+------+------------+--------+--------------------------------+ -| ID | Name | Status | Networks | -+------+------------+--------+--------------------------------+ -| 1805 | testserver | ACTIVE | private=10.4.96.81 | -+------+------------+--------+--------------------------------+ - - There are three statuses you may see - ACTIVE, BUILDING, and UNKNOWN. The BUILDING status is transient and you likely will not see it. If you see UNKNOWN, run nova list again until it goes away. - To view all the information about a particular server, use nova show with the ID of the server that you got from the nova list command. - -$ nova show 1805 - -+-----------------+----------------------------------------------------------+ -| Property | Value | -+-----------------+----------------------------------------------------------+ -| created | 2011-09-01T21:40:41Z | -| flavor | m1.small | -| hostId | 58a7430169aa42cde5ce2456b0cb5bb5ac1ab0703bab6420e8a49e6e | -| id | 1805 | -| image | maverick | -| metadata | {} | -| name | testserver | -| private network | 10.4.96.81 | -| progress | 100 | -| status | ACTIVE | -| updated | 2011-09-01T21:40:46Z | -| uuid | ce044452-f22e-4ea4-a3ec-d1cde80cf996 | -+-----------------+----------------------------------------------------------+ - - - You can now launch that image again, but add more information to the server when you - boot it so that you can more easily identify it amongst your ever-growing elastic cloud. - Use the -meta option with a key=value pair, where you can make up the string for both the - key and the value. For example, you could add a description and also the creator of the - server. - $ nova boot testserver --meta description='Use for testing purposes' --meta creator=joecool -
-
+ diff --git a/doc/src/docbkx/api-quick-start/src/docbkx/cli-uses.xml b/doc/src/docbkx/api-quick-start/src/docbkx/cli-uses.xml new file mode 100644 index 0000000000..ae796de5c7 --- /dev/null +++ b/doc/src/docbkx/api-quick-start/src/docbkx/cli-uses.xml @@ -0,0 +1,160 @@ + + + Setting Up python-novaclient + +For more serious scripting work, you can use a client like the python-novaclient or openstack-compute clients. The python-novaclient implements the Compute 1.1 API while the openstack-compute client works against the Rackspace Cloud Servers public cloud which is the OpenStack Compute 1.0 API. You only need a username and password to use the python-novaclient tool. + Installing the python-novaclient gives you a nova shell command that enables + Compute API interactions from the command line. You install the client, and then provide + your username and password, set as environment variables for convenience, and then you + can have the ability to send commands to your cloud on the command-line. + To install python-novaclient, download the tarball from + http://pypi.python.org/pypi/python-novaclient/2.6.3#downloads and then install it in your favorite python environment. + +$ curl -O http://pypi.python.org/packages/source/p/python-novaclient/python-novaclient-2.6.3.tar.gz +$ tar -zxvf python-novaclient-2.6.3.tar.gz +$ cd python-novaclient-2.6.3 +$ sudo python setup.py install + + Now that you have installed the python-novaclient, confirm the installation by entering: +$ nova help + +usage: nova [--username USERNAME] [--apikey APIKEY] [--projectid PROJECTID] + [--url URL] [--version VERSION] + <subcommand> ... + + In return, you will get a listing of all the commands and parameters for the nova command line client. By setting up the required parameters as environment variables, you can fly through these commands on the command line. You can add --username on the nova command, or set them as environment variables: + +export NOVA_USERNAME=joecool +export NOVA_API_KEY=coolword +export NOVA_PROJECT_ID=coolu + + Using the Identity Service, you are supplied with an authentication endpoint, which nova recognizes as the NOVA_URL. + + +export NOVA_URL=http://hostname:5000/v2.0 +export NOVA_VERSION=1.1 + + +
Listing ImagesBefore you can go about the business of building your cloud, you want to know what images are + available to you by asking the image service what kinds of configurations are available. + The image service could be compared to iTunes for your cloud - you can view the playlist + of images before using your favorite image to create a new instance in the cloud. To get + the list of images, their names, status, and ID, use this + command: + +$ nova image-list + ++----+-------------------------------------------------------+--------+ +| ID | Name | Status | ++----+-------------------------------------------------------+--------+ +| 1 | aki-tty | ACTIVE | +| 2 | ari-tty | ACTIVE | +| 3 | ami-tty | ACTIVE | +| 6 | CentOS_5.4_x64 | ACTIVE | +| 14 | maverick-kernel | ACTIVE | +| 15 | maverick | ACTIVE | +| 20 | ubuntu-kernel | ACTIVE | +| 21 | ubuntu-ramdisk | ACTIVE | +| 22 | ubuntu | ACTIVE | +| 24 | CentOS_5.6_x64_v5.7.14_Dev1 | ACTIVE | ++----+-------------------------------------------------------+--------+ + + Next you need to know the relative sizes of each of these. + +$ nova flavor-list + ++----+-----------+-----------+------+----------+-------+------------+----------+ +| ID | Name | Memory_MB | Swap | Local_GB | VCPUs | RXTX_Quota | RXTX_Cap | ++----+-----------+-----------+------+----------+-------+------------+----------+ +| 1 | m1.tiny | 512 | | 0 | | | | +| 2 | m1.small | 2048 | | 20 | | | | +| 3 | m1.medium | 4096 | | 40 | | | | +| 4 | m1.large | 8192 | | 80 | | | | +| 5 | m1.xlarge | 16384 | | 160 | | | | +| 89 | Boom | 2 | | 20 | | | | ++----+-----------+-----------+------+----------+-------+------------+----------+ + + + You can also narrow down the list by using grep to find only the CentOS images with a command like this: + + + +$ nova image-list | grep 'CentOS' + +| 6 | CentOS_5.4_x64 | ACTIVE | +| 24 | CentOS_5.6_x64_v5.7.14_Dev1 | ACTIVE | + + + + With the information about what is available to you, you can choose the combination of image and flavor to create your virtual servers and launch instances.
+
Launching Instances + + + To launch a server, you choose an image you want to match up to a size, find the ID for the image and the ID for the flavor so you can size it, and create the command with the IDs. From the information we got previously, we know that an Ubuntu Maverick image has an ID of 15, and if you want to start small with about 2 GB of memory and 20 GB of disk space, you'd choose the m1.small flavor which has an ID of 2. Put those parameters in with the "boot" command and you can create a new virtual server. + + + + $ nova boot --flavor=2 --image=15 testserver + + +-----------+--------------------------------------+ +| Property | Value | ++-----------+--------------------------------------+ +| adminPass | **************** | +| created | 2011-09-01T21:40:41Z | +| flavor | m1.small | +| hostId | | +| id | 1805 | +| image | maverick | +| metadata | {} | +| name | testserver | +| progress | 0 | +| status | BUILD | +| updated | 2011-09-01T21:40:41Z | +| uuid | ce044452-f22e-4ea4-a3ec-d1cde80cf996 | ++-----------+--------------------------------------+ + + + Now, you can view this server in your new cloud by using the nova list + command: +$ nova list ++------+------------+--------+--------------------------------+ +| ID | Name | Status | Networks | ++------+------------+--------+--------------------------------+ +| 1805 | testserver | ACTIVE | private=10.4.96.81 | ++------+------------+--------+--------------------------------+ + + + There are three statuses you may see - ACTIVE, BUILDING, and UNKNOWN. The BUILDING status is transient and you likely will not see it. If you see UNKNOWN, run nova list again until it goes away. + To view all the information about a particular server, use nova show with the ID of the server that you got from the nova list command. + +$ nova show 1805 + ++-----------------+----------------------------------------------------------+ +| Property | Value | ++-----------------+----------------------------------------------------------+ +| created | 2011-09-01T21:40:41Z | +| flavor | m1.small | +| hostId | 58a7430169aa42cde5ce2456b0cb5bb5ac1ab0703bab6420e8a49e6e | +| id | 1805 | +| image | maverick | +| metadata | {} | +| name | testserver | +| private network | 10.4.96.81 | +| progress | 100 | +| status | ACTIVE | +| updated | 2011-09-01T21:40:46Z | +| uuid | ce044452-f22e-4ea4-a3ec-d1cde80cf996 | ++-----------------+----------------------------------------------------------+ + + + You can now launch that image again, but add more information to the server when you + boot it so that you can more easily identify it amongst your ever-growing elastic cloud. + Use the -meta option with a key=value pair, where you can make up the string for both the + key and the value. For example, you could add a description and also the creator of the + server. + $ nova boot testserver --meta description='Use for testing purposes' --meta creator=joecool +
diff --git a/doc/src/docbkx/openstack-compute-admin/computeinstall.xml b/doc/src/docbkx/openstack-compute-admin/computeinstall.xml index c9c52a6585..034bb2f467 100644 --- a/doc/src/docbkx/openstack-compute-admin/computeinstall.xml +++ b/doc/src/docbkx/openstack-compute-admin/computeinstall.xml @@ -276,7 +276,7 @@ sudo service mysql restart PASSWORD('$NOVA_PASS');"
-
Setting Up PostgreSQL as the Database +
Setting Up PostgreSQL as the Database on the Cloud Controller OpenStack can use PostgreSQL as an alternative database. This is a matter of substituting the MySQL steps with PostgreSQL equivalents, as outlined here. @@ -473,7 +473,7 @@ $ for n in node1 node2 node3; do ssh $n sudo service openstack-nova-compute star follows: --daemonize=1 --dhcpbridge_flagfile=/etc/nova/nova.conf ---dhcpbridge=/usr/bin/nova-dhcpbridge +--dhcpbridge=/bin/nova-dhcpbridge --logdir=/var/log/nova --state_path=/var/lib/nova Starting with the default file, you must define the following required items in @@ -491,7 +491,8 @@ $ for n in node1 node2 node3; do ssh $n sudo service openstack-nova-compute star --sql_connection - IP address; Location of OpenStack Compute SQL database + SQL Alchemy connect string (reference); Location of OpenStack Compute + SQL database --s3_host @@ -500,21 +501,14 @@ $ for n in node1 node2 node3; do ssh $n sudo service openstack-nova-compute star --rabbit_host - IP address; Location of OpenStack Compute SQL database - - - --ec2_api - IP address; Location where the nova-api service runs + IP address; Location of RabbitMQ server + --verbose Set to 1 to turn on; Optional but helpful during initial setup - - --ec2_url - HTTP URL; Location to interface nova-api. Example: - http://184.106.239.134:8773/services/Cloud - + --network_manager @@ -542,6 +536,14 @@ $ for n in node1 node2 node3; do ssh $n sudo service openstack-nova-compute star IP address/range; Network prefix for the IP network that all the projects for future VM guests reside on. Example: 192.168.0.0/12 + + --ec2_host + IP address; Indicates where the nova-api service is installed. + + + --osapi_host + IP address; Indicates where the nova-api service is installed. + --network_size Number value; Number of addresses in each private subnet. @@ -550,6 +552,10 @@ $ for n in node1 node2 node3; do ssh $n sudo service openstack-nova-compute star --glance_api_servers IP and port; Address for Image Service. + + --use_deprecated_auth + If this flag is present, the Cactus method of authentication is used with the novarc file containing credentials. + @@ -557,14 +563,15 @@ $ for n in node1 node2 node3; do ssh $n sudo service openstack-nova-compute star cloud controller services, database server, and messaging server on the same server. --dhcpbridge_flagfile=/etc/nova/nova.conf ---dhcpbridge=/usr/bin/nova-dhcpbridge +--dhcpbridge=/bin/nova-dhcpbridge --logdir=/var/log/nova --state_path=/var/lib/nova --verbose +--use_deprecated_auth +--ec2_host=http://184.106.239.134 +--osapi_host=http://184.106.239.134 --s3_host=184.106.239.134 --rabbit_host=184.106.239.134 ---ec2_api=184.106.239.134 ---ec2_url=http://184.106.239.134:8773/services/Cloud --fixed_range=192.168.0.0/16 --network_size=8 --glance_api_servers=184.106.239.134:9292 @@ -573,8 +580,10 @@ $ for n in node1 node2 node3; do ssh $n sudo service openstack-nova-compute star Create a “nova” group, so you can set permissions on the configuration file: sudo addgroup nova The nova.config file should have its owner set to root:nova, and mode set to 0640, - since the file contains your MySQL server’s username and password. - chown -R root:nova /etc/nova + since the file contains your MySQL server’s username and password. You also want to + ensure that the nova user belongs to the nova group. + sudo usermod -g nova nova +chown -R root:nova /etc/nova chmod 640 /etc/nova/nova.conf
Setting Up OpenStack Compute Environment on the Compute Node diff --git a/doc/src/docbkx/openstack-compute-admin/interfaces.xml b/doc/src/docbkx/openstack-compute-admin/interfaces.xml index b5d9ae61c5..0440af5f39 100644 --- a/doc/src/docbkx/openstack-compute-admin/interfaces.xml +++ b/doc/src/docbkx/openstack-compute-admin/interfaces.xml @@ -74,10 +74,10 @@ git clone https://github.com/4P/openstack-dashboard -cd openstack-dashboard/openstack-dashboard -cp local_settings.py.example local/local_settings.py -vi local_settings.py - +cd openstack-dashboard/openstack-dashboard/local +cp local_settings.py.example local_settings.py +vi local_settings.py + In the new copy of the local_settings.py file, change these important options: @@ -132,7 +132,12 @@ QUANTUM_CLIENT_VERSION='0.1'
Run the Server - Dashboard is run using the standard Django manage.py script from the context of the virtual environment. Run the server on a high port value so that you can validate the installation.tools/with_venv.sh dashboard/manage.py runserver 0.0.0.0:8000Make sure that your firewall isn't blocking TCP/8000 and just point your browser at this server on port 8000. If you are running the server on the same machine as your browser, this would be "http://localhost:8000". + Dashboard is run using the standard Django manage.py script from the context + of the virtual environment. Be sure you synchronize the database with this + command: + tools/with_venv.sh dashboard/manage.py syncdb + Run the server on a high port value so that you can validate the + installation.tools/with_venv.sh dashboard/manage.py runserver 0.0.0.0:8000Make sure that your firewall isn't blocking TCP/8000 and just point your browser at this server on port 8000. If you are running the server on the same machine as your browser, this would be "http://localhost:8000". Diablo OpenStack Compute - 2011-10-07 + 2011-10-11 Copyright details are filled in by the template.