
Installing the OpenStack clients
There are a number of OpenStack clients available that are used to interact with OpenStack from the command line. Historically, each service in OpenStack has its own client. For example, the OpenStack Compute project, Nova, has its own nova
client. Similarly, the OpenStack networking project, Neutron, also has its own client called neutron
client. And so on.
Officially, there is a convergence to using one client: the OpenStack client. However, not all commands and features are available under this one tool. Moreover, the OpenStack client still requires each individual project command-line tool installed to function; however, it provides a more consistent interface without the need to remember each individual project name.
Getting ready
As we are preparing your desktop for interacting with OpenStack from the command line, you will appreciate that there are a variety of choices you can make for your desktop OS of choice. This section will describe the installation of OpenStack clients.
As we will be installing the OpenStack clients using pip
, ensure that this is installed by following these steps:
- First, load up a Terminal and become the root user with the following command:
sudo -i
- We'll be using
pip
to install the clients. Ifpip
is not installed, carry out the following steps:On macOS or variants use this:
wget https://bootstrap.pypa.io/get-pip.py python get-pip.py
- On popular Linux systems, use your package manager to install the packages:
Ubuntu: Ensure that
python-dev
andpython-pip
are installedRed Hat: Ensure that
python-devel
andpython-pip
are installed
How to do it…
With pip
installed on our system, we are able to install the clients using the following simple steps:
- To install the OpenStack client, carry out the following command:
pip install python-openstackclient
- To install the individual clients, carry out the following commands:
pip install python-novaclient pip install python-neutronclient pip install python-glanceclient pip install python-heatclient pip install python-keystoneclient pip install python-cinderclient pip install python-swiftclient
Sometimes the clients are in development at a different pace to the projects installed in your, environment which can make for version incompatibilities. To overcome this, either use virtualenv
(https://pypi.python.org/pypi/virtualenv) or use a virtual machine, under VirtualBox, that has been preconfigured for accessing your OpenStack environments. To use a prebuilt virtual environment, carry out the following:
- Clone the client VirtualBox Vagrant environment:
git clone https://github.com/OpenStackCookbook/openstack-client.git
- Launch the client:
cd openstack-client vagrant up
- Access the virtual machine:
vagrant ssh
How it works…
Installing the OpenStack clients is made very simple using the pip
command-line tool, which is used to install Python packages. The main tool for using OpenStack on the command line is called the OpenStack client. This tool is used to control all aspects of OpenStack. However, there are some commands and options that have yet to make it into the main OpenStack clients. To overcome this, the older legacy project tools can still be used. Ensure that these are also installed using the following syntax:
pip install python-PROJECTclient
Replace PROJECT with the specific name of the OpenStack project, such as glance or neutron.
Alternatively, create these tools in small virtual machine so that the tools are always available. A Vagrant OpenStack client environment is available from https://github.com/OpenStackCookbook/ope.