Install Openstack CLI
Overview
This How-to serves as manual on how to install the OpenStack CLI (Command Line Interface). With the OpenStack CLI you can manage and monitor your stacks.
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._
Snap on Linux
If you are using snap
on your Linux distro, you only need the following step for installing openstackclient:
sudo snap install openstackclients
You can now proceed to conclusion.
Python and virtual environment
We recommend to use Python and install the OpenStack client into a python virtual environment. Even though you could install the OpenStack client system-wide, we will describe the procedure to install it in a virtual environment instead. A virtual environment has the advantage to not collide with dependencies other projects may have on your system.
Python installation
MAC
You may need to install a different Python than the one provided by Apple's XCode tools. At the time of writing this there were problems installing certain python modules if you use Apple's python. You could install Python using the installer available on python.org or install it from Homebrew.
First open Terminal
or if installed iTerm.
To install python from Homebrew:
brew install python
Red Hat Enterprise Linux, CentOS or Fedora
Install python and some essential build tools which might be needed when you install the openstack client later.
sudo yum install python python-devel gcc
Ubuntu or Debian
Install python and some essential build tools which might be needed when you install the openstack client later.
sudo apt install -q -y python-is-python3 python3-venv python-dev-is-python3 build-essential
Windows
Install Python using the installer available for download on python.org.
After the installation is finished, open the command prompt (cmd) and check that the python
(or python
) command opens a python prompt. Exit the prompt with Ctrl+Z and Enter.
Virtualenv
Create a virtual environment called "env", which will create a subdirectory "env". Activate the virtual environment and upgrade pip
in it.
MAC or Linux
python -m venv env
source env/bin/activate
pip install --upgrade pip
Windows
python -m venv env
env\Scripts\activate.bat
pip install --upgrade pip
OpenStack Client
Install the OpenStack CLI client and recommended plugins, to be able to communicate with the corresponding OpenStack APIs:
pip install python-openstackclient python-barbicanclient python-cinderclient python-designateclient python-glanceclient python-heatclient python-neutronclient python-novaclient python-octaviaclient
The command above will install the general OpenStack client and the plugins for the following OpenStack APIs:
- barbican - Key Manager API
- cinder - Block Storage Volume API
- designate - Domain Name Service API
- glance - Image API
- heat - Orchestration API
- neutron - Network API
- nova - Compute API
- octavia - Load Balancer API
On Windows the installation may fail because of missing development tools. Follow the instructions you see on your screen to install those.
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