How to install OpenStackClient for Linux on EO-Lab

OpenStackClient is a very useful tool which gives the user many powerful management capabilities of their projects in the Command Line Interface. It includes additional features like the ability to run the commands from the CLI, or use scripts created in Python to automate the functions of your cloud storage. It allows you to oversee and manage your computing environment in a deeper and more precise way.

Just like in the Graphical User Interface, it is possible to gain access to OpenStack on any computer if you input the credentials (username and password).

Attention

It is highly recommended that you use virtual environments which do not affect system variables globally. Everything is happening in an isolated space, so if something goes wrong, the whole system is not affected.

This article covers the installation of Openstack Client under Ubuntu 18.04 LTS and Python 3. This method works on Ubuntu 20.04 as well.

Installation under other distributions may be similar.

Let’s start with updating our system packages to the latest version.

sudo apt update && sudo apt upgrade

Then, let’s install python3 and create a new python enviroment simply called “openstack_cli”:

sudo apt install python3-venv python3-dev
python3 -m venv openstack_cli
source openstack_cli/bin/activate

Now, let’s upgrade the Python Package Installer (pip) to the latest version using the command below:

pip install --upgrade pip

Finally, let’s install python-openstackclient:

pip install python-openstackclient

After that, we should be able to run openstack command from the console, eg:

openstack --help

If this command shows its output using a pager, you should be able use the arrows (or vim keys - J and K) to scroll and Q to exit.

If everything seems to work, we may move on to our Horizon Panel.

Log in to your account.

../_images/openstacklinux1.png

Click on your e-mail address in the upper-right corner.

../_images/openstacklinux2.png

Choose OpenStack RC File.

Save your RC file on your disk.

You can preview its content in the text editor of your choice - it should consist of many variables related to your domain account like so:

../_images/openstacklinux3.png

Change your directory to the place where you want to download the OpenStack client and execute the configuration file.

The location of this file will look like this: cloud_xxxxx/test-openrc.sh

Time to run this sh file. You will receive a prompt asking you for your domain password. Type it and press enter. If the password is correct then the access is granted to you.

. cloud_xxxxx/test-openrc.sh

Please enter your OpenStack Password for project test as user johndoe:

After that you can for example check list of your servers by typing in the terminal:

openstack server list

Output of this command should contain a table with IDs, Names, Statuses, Networks, Images and Flavors of your virtual machines.

If you receive the error Missing value identity-provider-url required for auth plugin v3samlpassword, invoke the command below and try again:

pip3 install lxml

For a cheat sheet containing common OpenStack CLI commands, you can visit this article.