Skip to main content
OpenStack CLI
Last update:

OpenStack CLI

OpenStack CLI is a console client for working with the OpenStack API. You can manage your cloud infrastructure in Selectel through the OpenStack CLI: servers, placement groups, network volumes, networks, images and load balancers.

Documentation on working with products through the OpenStack CLI can be found on the tab OpenStack In the instructions, for example, Create a cloud server or Attach the volume.

The current versions of the components that are supported in Selectel can be viewed in the table below OpenStack component versions.

The OpenStack CLI can be installed on your local system.

  1. Install the OpenStack CLI and additional packages. If you want to use a Docker container to work with the OpenStack CLI, you do not need to perform this step.
  2. Create a service user for authorization in the OpenStack API.
  3. Configure authorization in the OpenStack API.

OpenStack component versions

Release versionAPI version
KeystoneZed3.14
PlacementZed1.0 (maximum microversion is 1.39)
NovaZed2.1 (maximum microversion is 2.93)
NeutronUssuri2.0
CinderWallaby3.0 (maximum microversion is 3.64)
GlanceZed2.16
KarborWallaby1.0
ManilaZed2.0 (maximum microversion is 2.75)
HeatZed1.0
Octavia2023.12.26
Gnocchi4.51.0

Install the OpenStack CLI

  1. Open the CLI.

  2. Install Python 3:

    sudo apt update
    sudo apt install python3
  3. Install pip3:

    sudo apt install python3-pip
  4. Install the OpenStack CLI:

    pip3 install python-openstackclient
  5. Verify that the OpenStack CLI is installed:

    openstack --version

    The version number will appear in the response.

  6. Optional: install Octavia component to work with cloud load balancers — Yoga release version 3.4.0 is required for compatibility with the Yoga release version:

    pip3 install python-octaviaclient===3.4.0
  7. Optional: install the Glance component to work with the images:

    pip3 install python-glanceclient

Create a service user

To authorize in OpenStack API you need to create service user with the role Project Administrator or Project Supervisor and add it to the project.

  1. In the control panel go to Access controlUser management.

  2. Click Add user.

  3. Select type Service user.

  4. Enter a user name. This will be used for authorization.

  5. Enter a password for the user or generate one.

  6. Save password — once a user is created, you cannot view the password, only change it.

  7. Select user role:

    • Project administrator — can create, edit, and delete project resources;
    • Project viewer — can view project resources.
  8. Check the projects to which you want to add the user.

  9. Click Add user.

Set up authorization

To authorize in the OpenStack API, you need to add environment variables. In Unix systems (Ubuntu, Debian, CentOS, and macOS), you need to run a script from an RC file that can be downloaded from the control panel; in Windows, you need to add variables manually.

carefully

Authorization in the OpenStack API can be configured for only one service user, projects and pool. If necessary, you can change the authorization data.

  1. In the control panel go to Access controlUser management.

  2. Open the tab Service users.

  3. Open the page created service user with the role of Project Administrator or Project Supervisor → tab Access.

  4. In the block RC files:

    4.1 Select project.

    4.2 Select region.

    4.3. Select pool. Only this pool will be able to manage the project infrastructure.

    4.4. Press Download.

  5. On the local system, navigate to the directory with the downloaded RC file:

    cd <directory_name>

    Specify <directory_name> — name of the directory with the RC file.

  6. Run the script from the RC file:

    source <file_name.sh>

    Specify <file_name.sh> — RC file name, default rc.sh.

  7. Enter the OpenStack password — the password of the service user for which the RC file was created.

  8. Verify the OpenStack CLI is working, for example, by opening the list of cloud servers:

    openstack server list

    If cloud servers have been created in the pool and project specified in the RC file, their list will appear in the command output. If no servers have been created yet, the command output will be empty.

Change authorization data

To change the authorization details:

  • set new values for environment variables. For Ubuntu, Debian, CentOS and macOS, change the variables in the RC file; for Windows, set the values directly;
  • pass the new values in OpenStack CLI commands with keys. For example, to change the pool, use the key --os-region-name. A list of all options and examples can be found in the section Options OpenStack documentation.