Skip to content

Instances CLI reference

See https://docs.openstack.org/nova/2023.2/cli/index.html.

These commands allow you to perform various operations related to instance management, such as creating, listing, showing details of, starting, stopping, and deleting instances, as well as managing instance sizes, snapshots, volumes, and floating IPs. The <server_id_or_name>, <flavor_id_or_name>, <image_id_or_name>, <network_id_or_name>, <snapshot_name>, <volume_id_or_name>, and <floating_ip_address> in the commands are placeholders that should be replaced with the actual IDs or names of the resources.

Note

The term server here refers to server instances. Both "server" and "server instance" refer to virtual machines that you’ve provisioned for your project.

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> --network <network_id_or_name> <server_name>
  • <flavor_id_or_name>: ID or name of the flavor.
  • <image_id_or_name>: ID or name of the image.
  • <network_id_or_name>: ID or name of the network.
  • <server_name>: Name of the new instance.

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 --hard <server_id_or_name>
  • Use --soft for a soft reboot.

Resize an instance

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

Confirm resize

Bash
openstack server resize confirm <server_id_or_name>

Revert resize

Bash
openstack server resize revert <server_id_or_name>

Create an image snapshot of an instance

Bash
openstack server image create --name <snapshot_name> <server_id_or_name>

Attach a volume to an instance

Bash
openstack server add volume <server_id_or_name> <volume_id_or_name>

Detach a volume from an instance

Bash
openstack server remove volume <server_id_or_name> <volume_id_or_name>

Associate a floating IP with an instance

Bash
openstack server add floating ip <server_id_or_name> <floating_ip_address>

Disassociate a floating IP from an instance

Bash
openstack server remove floating ip <server_id_or_name> <floating_ip_address>