Getting Started with the OpenStack Flex CLI

How to get started using the OpenStack CLI with your Flex Project

The following guide will get you started in using the OpenStack CLI with your Rackspace OpenStack Flex project.

OpenStack Flex CLI Setup Guide

Prerequisites

  • Rackspace OpenStack Flex account
  • macOS or Linux (or WSL2 on Windows)
  • Python 3 installed (python3 --version)
  • pip package manager (pip3 --version)
  • venv module (usually included with Python 3)
  • Internet access to install Python packages
  • openrc.sh file from your OpenStack Flex Project

1. Create a Directory for Virtual Environments

mkdir virtual_environments
cd virtual_environments/

2. Create the Python Virtual Environment

python3 -m venv flextest

3. Enter the Virtual Environment Directory

cd flextest/

4. Activate the Virtual Environment

source bin/activate

You should see the environment name (e.g., (flextest)) in your shell prompt.

5. Install Required Python Packages

pip3 install openstacksdk
pip3 install python-openstackclient

6. Source Your OpenStack Credentials File

  1. To obtain your openrc.sh file for your project, you'll need to log into the Skyline UI for your project first.
  2. After logging in, click the user icon in the top right > select 'Get OpenRC File' and leave the default setting of 'Password Type' and it will download the file to your local machine.
  3. Now, place that openrc.shfile in your Python Virtual Environment directory you just created. (eg /virtual_environments/flextest)
  4. Now source the file with the below command:
source openrc.sh

You'll be prompted for your API key, and after entering that you should be finished.

7. Verify the CLI Works

Run a basic command to check your setup:

openstack image list

You should see a list of available images from your Rackspace OpenStack Flex account.

Helpful CLI Commands

Below you'll find some CLI commands that can help you see what commands are available to you, what the proper syntax is, and what they actually do.

To list all top-level commands:

openstack help

This shows categories like compute, volume, network, etc.

To list all subcommands under a specific group:

openstack <category> --help
openstack server --help       # Lists commands for managing servers (instances)
openstack volume --help       # Lists volume commands
openstack network --help      # Lists networking commands
openstack image --help        # Lists image-related commands

To list everything (including extensions/plugins):

openstack complete

This prints every available command and subcommand installed in your current environment.

This can be long but comprehensive — useful if you want to grep for specific functionality.

openstack complete | grep floating

Additional Libraries

If you're using openstackclient, many of these are installed as dependencies. But for full CLI/API or programmatic access, or for debugging, you may need these explicitly:

ServicePurposePython PackageCLI Command Example
IdentityAuthentication (Keystone)python-keystoneclientopenstack user list
ComputeVirtual machines (Nova)python-novaclientopenstack server list
NetworkingVirtual networks (Neutron)python-neutronclientopenstack network list
ImageImage service (Glance)python-glanceclientopenstack image list
VolumeBlock storage (Cinder)python-cinderclientopenstack volume list
Object StoreObject storage (Swift)python-swiftclientopenstack container list
OrchestrationHeat templates (Heat)python-heatclientopenstack stack list
ContainerContainer orchestration (Magnum)python-magnumclientopenstack coe cluster list
Load BalancerLoad balancing (Octavia)python-octaviaclientopenstack loadbalancer list
Key ManagerSecrets and certs (Barbican)python-barbicanclientopenstack secret list