The OpenStack Client is a command-line client for OpenStack that brings the command set for Compute, Identity, Image, Object Storage and Block Storage APIs together in a single shell with a uniform command structure.
Installation
OpenStack Client can be installed from PyPI using pip:
pip install python-openstackclient
The pip command could be executed within a python virtual environment or conda environment.
Once installed it is possible to invoke the openstack client.
There are a few variants on getting help. A list of global options and supported commands is shown with --help:
openstack --help
There is also a help command that can be used to get help text for a specific command:
openstack help openstack help server create
Plugins Commands Installation
The commands to manage and interact with certain OpenStack services are not included in the main python-openstackclient
package.
Additional clients can be installed as plugin to the main OpenStack Client via pip.
The plugins are usually called with the name "python-<openstack project>client
" :
pip install python-<openstack project>client
Example for the python-manilaclient plugin :
pip install python-manilaclient
For the list of available services and related possible plugins consult the page EWC - ECMWF CCI - Openstack version and services and the linked reference OpenStack documentation.
Getting Started
In order to use the command line, it is first required to configure the shell environment by sourcing the OpenStack RC File:
$ source <project name>-openrc.sh
or in alternative have installed previously the provided clouds.yaml file under: ~/.config/openstack/clouds.yaml
Once done it should be possible to run the openstack client.
For example when using the OpenStack RC File :
$ openstack server list
or in case the clouds.yaml is used:
$ openstack --os-cloud=openstack server list
For the complete set of commands please consult the OpenStack documentation linked to EWC - ECMWF CCI - Openstack version and services.
Import SSH key
In order to be able to connect to the created Virtual Machines it is required to configure first the SSH keys in OpenStack.
It is possible to import the public key with the following command:
$ openstack --os-cloud=openstack keypair create --public-key /path/to/public_key <key_name>