Install OpenStack CLI

Overview

This tutorial serves as manual on how to install the OpenStack CLI (Command Line Interface). With the OpenStack CLI you can manage and monitor your Stacks.

Goal

Prerequisites

In this manual we expect that you haven't installed any of the required tools. If you already installed any of the tools, please skip that specific step.

Required OpenStack client version to work with the SysEleven Cloud

OpenStack client version 3.13.x is the minimum to work with multiple regions.
Please make sure to install the latest stable version.

Installation for MAC

First open Terminal or if installed iTerm2.

PIP

To install the required packages, we use PIP as package manager.

We install PIPwith the follwowing command:

sudo easy_install pip

Python dependencies

To work around an OSX issue run the following command:

sudo pip install --ignore-installed six pyparsing pyOpenSSL

Alternatively running a "virtual environemnt" with virtualenv also works, to have a seperat environment for the OpenStack Client.

OpenStack Client

After the installation of PIP finished, we need to install the OpenStack CLI client and required plugins, to be able to communicate with the corresponding OpenStack API:

for plugin in openstack cinder glance heat neutron nova ; do sudo pip install python-"$plugin"client ; done

Installation for Windows

Python

To be able to use the OpenStack Client on Windows we first need Python 2.7. After the installation is finished, we open our command prompt and ensure that we're in the following directory: C:\Python27\Scripts

PIP

Now we use the easy_install command to install PIP as package manager:

C:\Python27\Scripts>easy_install pip

OpenStack Client

After the installation of PIP finished, we need to install the OpenStack CLI as last step:

C:\Python27\Scripts>pip install python-openstackclient

OpenStack Plugins

After that install the required plugins to be able to talk to the corresponding OpenStack APIs.


Installation for Linux

PIP

To install the required packages, we use PIP as package manager.

Red Hat Enterprise Linux, CentOS or Fedora

yum install python-devel python3-pip

Ubuntu or Debian

apt-get install python-dev python3-pip

OpenStack Client

If there are dependency errors alternatively running a "virtual environemnt" with virtualenv also works, to have a seperate environment for the OpenStack Client.

After the installation of PIP finished, we need to install the OpenStack CLI client and required plugins, to be able to communicate with the corresponding OpenStack API:

for plugin in openstack cinder glance heat neutron nova ; do sudo pip3 install python-"$plugin"client ; done

Conclusion

We have installed the OpenStack Client and we now can use it.
To be able to use the OpenStack CLI tools the API access needs to be configured now.

If needed you can list all commands:

openstack --help

Additional information

Installation of more plugins

Now we have the possibility to install more plugins. To do that we place the corresponding plugin name into the following command:

pip install python-<PLUGINNAME>client

More plugins can be installed as follows:

for plugin in <List of plugins seperated by spaces> ; do pip install python-"$plugin"client ; done

Required plugins for the SysEvelenStack:


Virtualenv

If the OpenStack Client was installed successfully already, this is not required.

Virtualenv provides a virtual environment to avoid problems with dependencies and other programs when installing the OpenStack Client. This manual applies for MAC and Linux systems.

Install virtualenv with the following command:

pip install virtualenv

Now create a project folder e.g. myproject into which we create a virtualenv:

cd myproject/
virtualenv venv

If required virtualenv can inherit global installed packages (e.g IPython or Numpy). Use the following command to configure this:

virtualenv venv --system-site-packages

These commands create a virtual subfolder within the project folder into which everything is being installed. However one has to activate the folder first (within the terminal that we use to work on the project):

source myproject/venv/bin/activate

Now we should see (venv) at the beginning of our terminal prompt, that confirms that we are working within a virtualenv. If we install something now the installed programs end up within our project folders and do not create any conflics with other projects.

To exit the virutal environment we use:

deactivate