Skip to content

Compute service CLI reference

See https://docs.openstack.org/ocata/cli-reference/nova.html.

These commands allow you to perform various operations on instances, such as listing, creating, deleting, and resizing instances, as well as managing flavors and key pairs. The <server_id_or_name>, <flavor_id_or_name>, and <keypair_name> parameters are placeholders that should be replaced with the actual IDs or names of the resources you are working with.

List instances

Bash
openstack server list

Show instance details

Bash
openstack server show <server_id_or_name>

Create an instance

Bash
openstack server create --flavor <flavor_id_or_name> --image <image_id_or_name> --key-name <keypair_name> --network <network_id_or_name> <server_name>

Delete an instance

Bash
openstack server delete <server_id_or_name>

Start an instance

Bash
openstack server start <server_id_or_name>

Stop an instance

Bash
openstack server stop <server_id_or_name>

Reboot an instance

Bash
openstack server reboot <server_id_or_name>

Resize an instance

Bash
openstack server resize --flavor <new_flavor_id_or_name> <server_id_or_name>

List flavors

Bash
openstack flavor list

Show flavor details

Bash
openstack flavor show <flavor_id_or_name>

Create a flavor

Bash
openstack flavor create --id <flavor_id> --ram <ram_in_mb> --disk <disk_in_gb> --vcpus <num_vcpus> <flavor_name>

Delete a flavor

Bash
openstack flavor delete <flavor_id_or_name>

List key pairs

Bash
openstack keypair list

Create a key pair

Bash
openstack keypair create --public-key <public_key_file> <keypair_name>

Delete a key pair

Bash
openstack keypair delete <keypair_name>