OpenStack CLI Basics & Troubleshooting Guide
Get productive with the OpenStack CLI: source your openrc, list and inspect resources, format output, read console logs, and debug a stuck instance.
The openstack command-line client is the single tool that ties every other OpenStack service together. Whether you are launching instances, wiring up networks, or chasing a failure, it speaks to Nova, Neutron, Cinder, Keystone, and the rest through one consistent interface. Getting fluent with it is the difference between guessing and diagnosing.
This guide is a practical toolbelt: how to authenticate, the command grammar that applies everywhere, the output tricks that make scripting painless, and a first-line troubleshooting workflow for when something is stuck. It is the connective tissue between the other tutorials, from creating a project and user to launching an instance.
Prerequisites
- Access to an OpenStack 2025.2 cloud and credentials (an
openrcfile or aclouds.yamlentry). - The unified client installed:
pip install python-openstackclient.
Step 1: Authenticate by sourcing your openrc
Every command needs a token. The classic approach is to source an RC file that exports the OS_* environment variables; you will be prompted for your password:
source ~/acme-openrc
openstack token issueOr use clouds.yaml for multiple clouds
If you juggle several clouds, define them once in ~/.config/openstack/clouds.yaml and select with --os-cloud. This avoids re-sourcing files:
openstack --os-cloud acme server list
export OS_CLOUD=acme # set a default for the sessionStep 2: Learn the command grammar
Almost every command follows openstack <object> <action> [args]. Once you internalise this, you can guess commands you have never used:
openstack server list openstack server show web-01 openstack server create ... openstack server delete web-01
openstack network list openstack volume list openstack image list
Step 3: Format and filter output
The CLI can emit tables, plain values, JSON, or YAML โ essential for scripting. Use -f for format and -c to select columns:
# A single value, perfect for scripts openstack server show web-01 -f value -c statusJSON for piping into jq
openstack server list -f json | jq '.[].Name'
Pick specific columns
openstack server list -c Name -c Status -c Networks
Discover any command
When you do not know the exact syntax, the client documents itself. List commands and read per-command help:
openstack help
openstack server create --helpStep 4: Inspect resources in depth
The show verb is your microscope. Combined with column selection it surfaces exactly the field you need โ a fault message, an IP, a status:
openstack server show web-01 -c status -c addresses -c fault
openstack network show acme-net
openstack volume show data-vol01 -c status -c attachmentsStep 5: A first-line troubleshooting workflow
When something is wrong, work from the symptom inward. These four moves resolve most everyday issues.
Read the instance fault and status
If a server is in ERROR, the fault field usually says why โ no valid host, image problem, quota:
openstack server show web-01 -c status -c fault
openstack server event list web-01Read the console log
For boot failures, SSH problems, or cloud-init issues, the console log is the ground truth from inside the VM:
openstack console log show web-01 | tail -n 40Check service and agent health
If many operations fail, a control-plane service or agent may be down. Look for anything not up/enabled:
openstack compute service list
openstack network agent list
openstack volume service listTurn on debug for API errors
When a command fails with an opaque error, --debug prints the full REST request and response, including the real error from the service:
openstack server create ... --debug 2>&1 | lessCommon errors and troubleshooting
The request you have made requires authentication
Your token expired or the RC variables are not set. Re-source your openrc and confirm with openstack token issue. Check env | grep OS_ to see what is actually exported.
Public endpoint for ... not found
The client cannot find a service in the catalog โ often a wrong region or a service that is not deployed. Verify with openstack catalog list and set OS_REGION_NAME correctly.
Could not find resource <name>
Names are scoped to your project. Confirm you are in the right project (openstack token issue shows the scope) and that the resource exists with openstack <object> list; use the ID instead of the name to disambiguate.
SSL or certificate errors
For a lab with self-signed certs, point the client at the CA bundle with OS_CACERT, or as a last resort use --insecure โ never in production.
A handy alias and tab completion
Enable shell completion so you spend less time typing object and action names:
openstack complete | sudo tee /etc/bash_completion.d/osc.bash
source /etc/bash_completion.d/osc.bashConclusion
With authentication, the universal command grammar, output formatting, and a tight troubleshooting loop, the OpenStack CLI becomes the hub that connects every other skill โ identity, compute, networking, and storage. Master it and the rest of OpenStack stops being mysterious.
clouditiv gives you this same CLI and API on a managed, sovereign cloud โ plus a polished dashboard for the operations you would rather click than type, so teams get the power of the command line and the convenience of a managed platform.