Getting started
Install the OpenStack CLI¶
The OpenStack CLI, openstack, drives Breqwatr Cloud from a terminal. It's a Python package, installed with pip into a virtual environment, plus two plugins: one for load balancers and one for BKS.
What you install¶
| Package | Adds |
|---|---|
python-openstackclient |
The openstack command: instances, volumes, networks, security groups, images and more |
python-octaviaclient |
openstack loadbalancer commands |
python-magnumclient |
openstack coe commands, used for BKS clusters |
The CLI goes into a virtual environment: a folder with its own copy of Python and its own packages. It keeps the CLI apart from your operating system's Python, works the same way on Windows, macOS and Linux, and can be deleted cleanly. The steps are the same on every operating system except the command that activates the environment.
1. Get Python¶
On Windows and macOS, install Python 3.14. The CLI runs on newer releases too, but Ansible, used in the tutorials, doesn't yet run on Python 3.15. On Linux, use the Python your distribution ships.
From python.org/downloads/windows, download the installer for the latest Python 3.14 release, not 3.15, and run it. On the first screen, tick Add python.exe to PATH, then choose Install Now. In a new PowerShell window, python --version shows Python 3.14 followed by the release number.
From python.org/downloads/macos, download the installer for the latest Python 3.14 release, not 3.15, and run it. In a new Terminal window, python3.14 --version shows Python 3.14 followed by the release number.
2. Create the virtual environment¶
Open a new terminal, PowerShell on Windows, and create the environment in your home folder:
3. Activate it¶
This is the only step that differs between operating systems.
The prompt now starts with (.openstack-cli). Don't go on until it does: if activation failed, pip installs into your system's Python instead of the environment.
4. Install the CLI¶
With the environment active, and the prompt starting with (.openstack-cli), the commands are the same on every operating system:
AlmaLinux 9 and other distributions based on Red Hat Enterprise Linux 9 ship Python 3.9, so pip installs an older release of the CLI there.
Each new terminal¶
The openstack command is available only while the environment is active. In each new terminal, run the activate command from step 3 first.
Check it reaches your project¶
The CLI reads its connection details from clouds.yaml, which you downloaded in Application credentials and clouds.yaml. Put it in the .config/openstack folder in your home folder:
| Windows | macOS and Linux | |
|---|---|---|
clouds.yaml location |
%USERPROFILE%\.config\openstack\clouds.yaml |
~/.config/openstack/clouds.yaml |
Then run a command against your project, and one for each plugin. Replace <cloud-name> with the name of the entry in your clouds.yaml; Application credentials and clouds.yaml shows where to find it.
openstack --os-cloud <cloud-name> server list
openstack --os-cloud <cloud-name> loadbalancer list
openstack --os-cloud <cloud-name> coe cluster list
Each one prints a table, or nothing if the project has none of that resource yet. An error means the CLI couldn't connect; see below.
If something goes wrong¶
| Message | What to check |
|---|---|
openstack is not recognized, or command not found |
Activate the environment (step 3). The prompt starts with (.openstack-cli) when it's active |
| Running scripts is disabled on this system (Windows) | Run the Set-ExecutionPolicy command in step 3, then activate again |
Cloud <cloud-name> was not found |
clouds.yaml isn't in the folder above, or the name after --os-cloud doesn't match the entry in it |
| An authentication error | The application credential has expired or been revoked. Create a new one and download a new clouds.yaml |
Keeping it up to date¶
Activate the environment, then:
Next¶
Quotas and your bill shows what your project can use and how usage is billed.
Further reading¶
- APIs and tools: the CLI, the OpenStack provider and the Ansible collection.
- OpenStack CLI documentation: every command and option.
- Python virtual environments: how
venvworks. - About execution policies: PowerShell's script policy on Windows.