nova command-line tool

client install depends on the client os and the openstack version deployed. here an example for essex

The documentation can be found online: managing-the-cloud or python-novaclient/2.6.0

essentially do:

$ curl -O
$ tar -zxvf python-novaclient-2012.1.tar.gz
$ cd python-novaclient-2012.1
$ sudo python install

to confirm the installation:

$ nova help

add either --service_name nova_compat to every command or add

export NOVA_SERVICE_NAME=nova_compat

to your environment

General Information

The environment specific information in this document refers to the standard crowbar setup. usernames and passwords my differ in your environment.

see Username-and-Password-Customizations

The examples use the “openstack” tenant with the following default credentials from /opt/dell/barclamps/keystone/chef/data_bags/crowbar/bc-template-keystone.json

Key Value
Tenant name openstack
OpenStack username crowbar
OpenStack password crowbar

Connect to PoC environment

We assume that there is a host which is connected to the nova-fixed and or admin lan of the PoC.

Connect to Dashboard

Find the node with the nova_dashboard-server role in crowbar and open the URL. e.g. Dashboard URL: (depends on your deployment)

use the ip from an accessible network (e.g. the admin/nova_fixed/public ip

Install OpenStack CLI tools

To use the cli outside the PoC you have to install the appropriate client libraries (see above)

  • swift >= 1.4.8
  • glance - Essex final
  • nova - Essex final

Setup CLI environment

Add these commands to your login profile dotfile or create a file “openstackenv” that you can source each time you want to create this environment.

Openstack API setup:

e.g. use a config like:

export NOVA_USERNAME=crowbar
export NOVA_PASSWORD=crowbar
export NOVA_PROJECT_ID=openstack
export NOVA_URL=
export NOVA_VERSION=1.1
export NOVA_REGION_NAME=RegionOne

export OS_AUTH_STRATEGY=keystone

export EC2_URL=

Glance image management

Upload Image

get a image to upload to glance. e.g. from the admin server

scp /opt/dell/barclamps/tempest/cache/files/tempest/cirros-0.3.0-x86_64-uec.tar.gz

Extract the image bundle:

tar fxvz cirros-0.3.0-x86_64-uec.tar.gz

Upload the kernel first:

glance add is_public=true disk_format=aki container_format=aki name=cirros-0.3.0-x86_64-vmlinuz < cirros-0.3.0-x86_64-vmlinuz

Note the image ID number for the kernel, this is the long hex value with 5 groups, for e.g. “4377042f-9c60-4b2d-9bb5-d7114ba666b4”.

Upload the initrd (if needed):

glance add is_public=true disk_format=ari container_format=ari name=cirros-0.3.0-x86_64-initrd < cirros-0.3.0-x86_64-initrd

Note the image ID number for the ramdisk.

Use the kernel ID and ramdisk id that you noted and use it in the next command for kernelid and ramdiskid:

 glance add is_public=true disk_format=ami container_format=ami kernel_id=4377042f-9c60-4b2d-9bb5-d7114ba666b4 ramdisk_id=f8e8824f-6d44-4ba6-b0f1-519003e9f9b8 name=cirros-0.3.0-x86_64 < cirros-0.3.0-x86_64-blank.img

An script to do this is available at

How to create OpenStack compatible images from standard VM images:

List images

Option 1: Dashboard

Go to “Images” page in dashboard. The dashboard shows only bootable images whereas the CLI also shows kernels and boot loaders.

Option 2: CLI

List all images that are in glance:

glance index

Delete Image

Use the “delete” command followed by the image id (e.g. e5069f9d-c15d-4987-822b-908981201f04) to delete the image.

glance delete e5069f9d-c15d-4987-822b-908981201f04

If you try to delete an image of another tenant, you will get an error message: “No image with ID was found”.

Nova compute instances


It is important to save the private key as it will not be saved on the server and cannot be regenerated. If you accidently forget to save it, just delete the keypair from the system.

 nova API

nova keypair-add mykeypair > mykeypair.pem
chmod 400 mykeypair.pem

If you already have a key you can upload your key:

ssh-keygen # create a default if you do not have one

nova keypair-add --pub_key .ssh/ mykeypair2

To delete a keypair just issue the following command (where mykeypair is the name of the keypair you want to delete):

nova keypair-delete mykeypair2

If you have instances running that use this keypair they will not be affected. You just will not be able to assign the keypair to new instances any more.


Go to the “Keypairs” page and use “Add new keypair” or “import keypair”

create instance

No matter which way of launching an instance you choose. The following information is needed:

  1. The image that should be launched
  2. The size of the instance
  3. an SSH keypair to log in to the instance

Nova API

Get needed information to start an instance:

Get available flavors (sizes)

nova flavor-list

Get available images

nova image-list

Get available keypairs

nova keypair-list

Choose image and flavor by id and launch instance:

nova boot --flavor 1 --image 2bdac530-428b-4a10-aa2a-075dc808cd4c  --key_name mykeypair mynewnovainstance

Verify the status of current instance.

nova list

When the status of the instance is no longer “BUILD” but “RUNNING” you can access the instance using SSH.


Go to “Images” page and click “Launch”. Select keypair, flavor (size) and lauch.

Log in to instance

Nova API

Check if instance is running and note IP address (in our example:

 nova list

Set default security group to allow ping and ssh access

nova secgroup-add-rule default icmp -1 -1
nova secgroup-add-rule default tcp 22 22

ssh to instance using the keypair supplied on boot

ssh -i mykeypair.pem root@

Allocating a public IP address to instance

We use the IP range to simulate public IPs. (depends on your crowbar config)

Nova API

nova floating-ip-create

Use the new ip and associate it with a running instance (instance id in the example is 28) nova add-floating-ip 55c6f2ec-a995-4c9d-8f2f-877279c4cc0e

Check that assignment was successfull:

nova floating-ip-list

You should be able to connect to the instance using the floating IP now:

ssh -i mykeypair.pem root@

destroy instance


Go to instances overview page and click “Terminate”.

nova API

List running servers:

nova list

Delete running server:

nova delete 55c6f2ec-a995-4c9d-8f2f-877279c4cc0e

Interested in Cloud or Chef Trainings? Have a look at our Commandemy Trainings page. Need help migrating to the cloud? Check out Infralovers.

comments powered by Disqus
Blog Tags