Getting Started: Using rackspace-novaclient to manage Cloud Servers
Using the Rackspace Cloud Control Panel to manage your servers is awesome, but sometimes you just need to get a simple thing done quickly via the command line. Enter the OpenStack rackspace-novaclient, a CLI tool to manage your Cloud Servers.
First, install the nova client using pip:
sudo pip install rackspace-novaclient
Once that is complete, you need to make a ~/.novarc file for your credentials. Below is an example file. Just replace the variables with your information. Your
$ACCOUNT_NUMBER is located in the upper right of the cloud control panel.
OS_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0/ OS_VERSION=2.0 OS_AUTH_SYSTEM=rackspace OS_REGION_NAME=DFW OS_SERVICE_NAME=cloudserversOpenStack OS_TENANT_NAME=$ACCOUNT_NUMBER OS_USERNAME=$USERNAME OS_PASSWORD=$APIKEY OS_NO_CACHE=1 export OS_AUTH_URL OS_VERSION OS_AUTH_SYSTEM OS_REGION_NAME OS_SERVICE_NAME OS_TENANT_NAME OS_USERNAME OS_PASSWORD OS_NO_CACHE
Using the Client
Once your .novarc file is created and sourced, you can use the nova command to manage your Cloud Servers from the command line. Here are a few examples:
List all flavors:
List all images:
Create an Ubuntu 12.04 server in Chicago with 15GB of RAM called "server01":
nova boot --os_region_name ORD boot --image 5cebb13a-f783-4f8c-8058-c4182c724ccd --flavor 7 server01
Reboot your server:
nova reboot --hard server01
These are just a few of the many commands you can use with rackspace-novaclient's CLI tool for quick and easy server management. The great thing about rackspace-novaclient is it works with both the Rackspace Public Cloud and OpenStack Private Clouds. If you are using multiple OpenStack Compute environments, you can use a tool called Supernova, written by Major Hayden. With Supernova, you are basically creating multiple .novarc files for use with different Compute environments and using a different CLI tool to manage those environments. Supernova also has other features like keyring support.