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

  • Install latest OpenStack-Command line Client and required plugins

Prerequisites

  • PC/MAC
  • Admin rights
  • Basic computer skills
  • We assume you know how to utilise SSH and SSH-keys.

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 following command:

sudo easy_install pip

Python dependencies

To work around an OSX issue run the following command:

sudo -H pip install --ignore-installed six pyparsing pyOpenSSL

Alternatively running a "virtual environment" with virtualenv also works, to have a separate 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:

sudo -H pip install python-openstackclient python-heatclient

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 python-heatclient

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-minimal python-pip

Ubuntu oder Debian

apt install -q -y python-minimal python-pip

OpenStack Client

If there are dependency errors alternatively running a "virtual environment" with virtualenv also works, to have a separate 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:

pip install python-openstackclient python-heatclient

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

One has the possibility to install plugins. Place the corresponding plugin name into the following command:

pip install python-<PLUGINNAME>client

Installing the heat plugin:

pip install python-heatclient

Required plugins for the SysEleven Stack:

  • heat - Orchestration API

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