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
- You must have an account in the Peerobyte Control Panel. See: “Creating an Account”.
- You must order the “Cloud infrastructure” service and receive a notification that it’s ready (by email bound to your account or in the Peerobyte Control Panel).
- Python and OpenStackClient must be installed as described in “Installing OpenStackClient”.
- 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.
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).
openstack volume list -f json
-c <COLUMN> — Output only the specified column. Repeat the flag to show multiple columns.
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.
openstack image list - -sort-column Name --sort-descending
– -long — Show additional fields about the listed objects. (Not available for all commands).
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>]
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:
<SERVER> — the server name or ID.
For the full list of parameters and arguments, refer to the OpenStack documentation.
List key pairs
openstack keypair list For the full list of parameters and arguments, refer to the OpenStack documentation.
List VM flavors
openstack flavor list For the full list of parameters and arguments, refer to the OpenStack documentation.
Detailed information about a specific flavor
openstack flavor show <FLAVOR> Parameters:
<FLAVOR> — the flavor name or ID.
For the full list of parameters and arguments, refer to the OpenStack documentation.
II. Networking resources
Commands for viewing networks, subnets, routers, floating IPs, and security groups.
List networks
openstack network list [--external] [--long] Parameters:
– -external — show only external (internet‑accessible) networks.
– -long — show extended information.
For the full list of parameters and arguments, refer to the OpenStack documentation.
List subnets
openstack subnet list [--network <NETWORK>] Parameters:
– -network <NETWORK> — filter subnets by the specified network. <NETWORK> can be a name or ID.
For the full list of parameters and arguments, refer to the OpenStack documentation.
List routers and their status
openstack router list For the full list of parameters and arguments, refer to the OpenStack documentation.
List floating IP addresses
openstack floating ip list
[--fixed-ip-address <IP>]
[--status <STATUS>] Parameters:
– -fixed-ip-address <IP> — show floating IPs attached to the specified internal IP.
– -status <STATUS> — filter by status (ACTIVE — associated with an instance, DOWN — free).
For the full list of parameters and arguments, refer to the OpenStack documentation.
List ports
openstack port list
[--network <NETWORK>]
[--router <ROUTER> | --server <SERVER>]
[--fixed-ip subnet=<SUBNET>,ip-address=<IP-ADDRESS>] Parameters:
– -network <NETWORK> — filter ports by network (name or ID).
– -router <ROUTER> — show only ports associated with the specified router (name or ID).
– -server <SERVER> — show only ports attached to the specified server (name or ID).
– -fixed-ip subnet=<SUBNET>,ip-address=<IP-ADDRESS> — filter by IP or subnet:
subnet=<SUBNET> — specify a subnet (name or ID).
ip-address=<IP-ADDRESS> — exact IP match.
For the full list of parameters and arguments, refer to the OpenStack documentation.
List security groups
openstack security group list For the full list of parameters and arguments, refer to the OpenStack documentation.
List security group rules
openstack security group rule list <SEC_GROUP> Parameters:
<SEC_GROUP> — the security group ID or name whose rules will be shown.
For the full list of parameters and arguments, refer to the OpenStack documentation.
III. Storage
Commands for viewing volumes and snapshots.
List volumes
openstack volume list For the full list of parameters and arguments, refer to the OpenStack documentation.
List snapshots
openstack volume snapshot list [--volume <VOLUME_ID>] Parameters:
– -volume <VOLUME_ID> — show snapshots for the specified volume.
For the full list of parameters and arguments, refer to the OpenStack documentation.
Detailed information about a volume
openstack volume show <VOLUME_ID> --fit-width Parameters:
<VOLUME_ID> — the ID of the volume to display.
– -fit-width — fit the output to the terminal width.
For the full list of parameters and arguments, refer to the OpenStack documentation.
IV. Images
Commands for viewing images.
List available images
openstack image list [--public | --private] [--long] Parameters:
– -public — show images available to all users.
– -private — show images available only within your project.
– -long — additionally show image format, size, and checksum.
For the full list of parameters and arguments, refer to the OpenStack documentation.
Detailed information about a specific image
openstack image show <IMAGE_ID> [--fit-width] Parameters:
<IMAGE_ID> — the ID of the image to display.
– -fit-width — fit the output to the terminal width.
For the full list of parameters and arguments, refer to the OpenStack documentation.
V. Quotas and resource usage
How to view quotas and actual usage.
View quotas
openstack quota show [--usage] Parameters:
– -usage — additionally show actual resource consumption.
For the full list of parameters and arguments, refer to the OpenStack documentation.
What’s next?
The full list of OpenStackClient (OSC) commands with descriptions and parameters is available in the official documentation: Full list of OSC commands. Open the command you need to see the available options and usage examples.