Step 2. Install the nova Client with the Cloud Networks Extension

If you want to run the cURL examples, skip this step and proceed to the section called “Step 3. Authenticate”.

To manage your servers from the command line, you can use the open-source nova client application called python-novaclient.

To install the nova client, you first install the rackspace-novaclient package, which includes the nova client and the Rackspace extensions including the Cloud Networks extension.

If you want to use the Cloud Networks virtual interface extension, you must also install the os_virtual_interfacesv2_python_novaclient_ext package.

[Note]Note

The python-novaclient is developed and maintained by the OpenStack community. While we do not directly support python-novaclient, you can post in the comments below if you run into any difficulties.

Before you begin, install the following prerequisite software:

Table 3. Nova Client Prerequisite Software
Prerequisite Description

Python 2.6 or later

Currently, the nova client does not support Python 3.

setuptools package

Installed by default on Mac OS X.

Many Linux distributions provide packages to make setuptools easy to install.

Search your package manager for setuptools to find an installation package. If you cannot find one, download the setuptools package directly from http://pypi.python.org/pypi/setuptools.

pip package

To install the nova client on a Mac OS X or Linux system, use pip because it is easy and ensures that you get the latest version of the nova client from the Python Package Index. Also, it lets you update the package later on.

Install pip through the package manager for your system:

  • Mac OS X

    $ sudo easy_install pip
  • Ubuntu

    $ aptitude install python-pip 
  • Debian

    $ aptitude install python-pip 
  • Fedora

    $ yum install python-pip
  • CentOS, or RHEL (from EPEL or another 3rd party repository)

    $ yum install python-pip

 

To install the nova client with Rackspace extensions:

  1. Install or update the nova client package with Rackspace extensions

    The rackspace-novaclient package includes the nova client and Rackspace extensions, including the Cloud Networks extension.

    Run the following command to install the rackspace-novaclient package:

    $ sudo pip install rackspace-novaclient
    [Note]Note

    If you previously installed the rackspace-novaclient package, run the following command for your operating system to upgrade it:

    $ sudo pip install --upgrade rackspace-novaclient

    [Important]Important
    • If you previously installed the earlier rax_networks_python_novaclient_ext package, run the following command for your operating system to remove it:

      $ sudo pip uninstall rax_networks_python_novaclient_ext

    • If you have trouble using pip to install the nova client, you can:

      Download a nova client installation package from the python package repository.

      or

      Use pip to individually install the python-novaclient and rackspace-auth-openstack packages.

      or

      Use python-pip or yum commands instead of pip.

  2. Set environment variables

    Edit your bash profile to add and set environment variables that enable the nova client to connect to your Rackspace Cloud account. Use nano or an editor of your choice to edit your .bash_profile file:

    $ nano ~/.bash_profile 

    Depending on your account location, add one of the following sets of lines to your bash profile and save the file:

    [Tip]Tip

    To help you decide which regionalized endpoint to use, read about special considerations for choosing a data center at http://ord.admin.kc.rakr.net/knowledge_center/article/about-regions.

     

    Example 4. US Data Center Example

    export OS_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0/
    export OS_AUTH_SYSTEM=rackspace
    export OS_REGION_NAME=DFW
    export OS_USERNAME=<username>
    export OS_TENANT_NAME=<tenant_id>
    export NOVA_RAX_AUTH=1
    export OS_PASSWORD=<api_key>
    export OS_PROJECT_ID=<tenant_id>
    export OS_NO_CACHE=1


     

    Example 5. UK Data Center Example

    export OS_AUTH_URL=https://lon.identity.api.rackspacecloud.com/v2.0/
    export OS_AUTH_SYSTEM=rackspace_uk
    export OS_REGION_NAME=LON
    export OS_USERNAME=<username>
    export OS_TENANT_NAME=<tenant_id>
    export NOVA_RAX_AUTH=1
    export OS_PASSWORD=<apikey>
    export OS_PROJECT_ID=<tenant_id>
    export OS_NO_CACHE=1


    For descriptions of the environment variables, see Environment Variables for the nova Client.

  3. Set permissions on the bash profile

    Because the bash profile contains a password, set permissions on it so other people cannot read it:

    $  chmod 600 ~/.bash_profile 
  4. Source the environment variables

    To source the variables to make them available in your current shell, run the following command:

    $ source ~/.bash_profile 
  5. Test the nova client

    To verify that you can talk to the API server, authenticate and list images:

    $ nova credentials 
    $ nova image-list 
  6. Get help for nova client commands

    To get help for nova client commands, run the following command:

    $ nova help 

    To get help for a specific command, type the command name after the help parameter, as follows:

    $ nova help <command_name> 

    You cannot use every command that is listed. The nova client was written for use with recent development versions of OpenStack, so it includes support for some features that are not available in the Rackspace Cloud.

    [Note]Note

    To show and become familiar with the underlying API v2 request for a command, specify the --debug parameter as the first parameter on any command. For example:

    $ nova --debug list
  7. Troubleshooting

    The python-novaclient is developed and maintained by the OpenStack community.

    • If you cannot run commands successfully, make sure that you entered your user name, password, and account number correctly in the bash profile file.

    • If you change any environment variables, either log out and back in or source your bash profile again.

    • To override some environment variable settings, you can use the options that are listed at the end of the nova help output. For example, you can override the OS_PASSWORD setting in the bash profile by specifying a password on a nova command, as follows:

      $ nova --password <password> image-list 

      Where password is your Rackspace password.

    • While Rackspace does not directly support python-novaclient, if the above steps don't help, you can post a question in the comments below.