...

OpenStack CLI commands for collecting information about OpenStack project resources

Published on

All data is current as of

OpenStackClient (OSC) is a unified command‑line interface (CLI) for managing and monitoring OpenStack cloud infrastructure. With OSC, you can check resource status, find issues, optimize load, and track quota consumption.

In this section we’ve gathered the core commands and their most commonly used options to help you view the state of your cloud infrastructure and available resources, for example:

  • Virtual machines (VMs): status, IP addresses, and resources in use (CPU, RAM, disk).
  • Networking: networks, subnets, routers, floating IPs, security groups, and their rules.
  • Storage: volumes, snapshots, and backups.
  • Images: available VM images, their status, format, and size.
  • Quotas and limits: current usage and limits for your project.

Note on command syntax. In the syntax below:

  • Square brackets ‘[’ ‘]’ mean an option is optional.
  • Angle brackets ‘<’ ‘>’ are placeholders you must replace with real values.
  • The vertical bar ‘|’ indicates mutually exclusive choices — pick one of the listed options or values.
  • In real commands you do not type the brackets or the vertical bar.

Prerequisites

  1. You must have an account in the Servermall Cloud Control Panel. See: “Creating an Account”.
  2. You must order the “Cloud infrastructure” service and receive a notification that it’s ready (by email bound to your account or in the Servermall Cloud Control Panel).
  3. Python and OpenStackClient must be installed as described in “Installing OpenStackClient”.
  4. You must authenticate to the cloud infrastructure as described in “OpenStackClient Authentication via Environment Variables”.

Useful global OSC flags

OSC output often benefits from extra formatting — both for readability and for automation (for example, in Infrastructure as Code workflows). To optimize output, you can add these flags to many commands:


– -fit-width — Fit tables to your terminal width. Helps prevent wide tables from breaking the layout.

Example: 
 openstack server list --fit-width


-f <format> — Change the output format. Available values for <format>: table (default), json, yaml, value (values only, no headers or borders).

Example: 
 openstack volume list -f json


-c <COLUMN> — Output only the specified column. Repeat the flag to show multiple columns.

Example: 
 openstack server list -c ID -c Name


– -sort-column <COLUMN> — Sort by the given column in ascending order. To sort in descending order, add – -sort-descending.

Example: 
 openstack image list - -sort-column Name --sort-descending


– -long — Show additional fields about the listed objects. (Not available for all commands).

Example: 
 openstack image list --long

I. Virtual machines (VMs, instances)

Commands for viewing information about VMs, flavors, and key pairs.

List all VMs
 openstack server list [--status <STATUS>]

Parameters:

– -status <STATUS>  — filter VMs by status. Common values:

ACTIVE — the VM is running.

SHUTOFF — the VM is powered off.

BUILD — the VM is being created.

ERROR — an error occurred during creation or operation.

PAUSED — the VM is paused.

SUSPENDED — the VM is hibernated (suspended).

RESCUE — the VM is in rescue mode.

RESIZE — a flavor change (resize) is in progress.

MIGRATING — the VM is migrating to another host.

SHELVED — the VM is shelved (archived).

For the full list of parameters and arguments, refer to the OpenStack documentation

Detailed information about a specific VM

 openstack server show [--diagnostics] <SERVER>

Parameters:

Seraphinite AcceleratorOptimized by Seraphinite Accelerator
Turns on site high speed to be attractive for people and search engines.