Compute v2
Add fixed IP address to server
openstack server add fixed ip
[--fixed-ip-address <ip-address>]
[--tag <tag>]
<server>
<network>
Requested fixed IP address
Tag for the attached interface. (supported by –os-compute-api-version 2.49 or above)
Server to receive the fixed IP address (name or ID)
Network to allocate the fixed IP address from (name or ID)
Add floating IP address to server
openstack server add floating ip
[--fixed-ip-address <ip-address>]
<server>
<ip-address>
Fixed IP address to associate with this floating IP address. The first server port containing the fixed IP address will be used
Server to receive the floating IP address (name or ID)
Floating IP address to assign to the first available server port (IP only)
Add network to server
openstack server add network [--tag <tag>] <server> <network>
Tag for the attached interface. (supported by –os-compute-api-version 2.49 or above)
Server to add the network to (name or ID)
Network to add to the server (name or ID)
Add port to server
openstack server add port [--tag <tag>] <server> <port>
Tag for the attached interface. (Supported by API versions ‘2.49’ - ‘2.latest’)
Server to add the port to (name or ID)
Port to add to the server (name or ID)
Add security group to server
openstack server add security group <server> <group>
Server (name or ID)
Security group to add (name or ID)
Add volume to server. Specify --os-compute-api-version 2.20
or higher to add a volume to a server with status SHELVED
or SHELVED_OFFLOADED
.
openstack server add volume
[--device <device>]
[--tag <tag>]
[--enable-delete-on-termination | --disable-delete-on-termination]
<server>
<volume>
Server internal device name for volume
Tag for the attached volume (supported by –os-compute-api-version 2.49 or above)
Delete the volume when the server is destroyed (supported by –os-compute-api-version 2.79 or above)
Do not delete the volume when the server is destroyed (supported by –os-compute-api-version 2.79 or above)
Server (name or ID)
Volume to add (name or ID)
Create a new server
openstack server create
--flavor <flavor>
(--image <image> | --image-property <key=value> | --volume <volume> | --snapshot <snapshot>)
[--boot-from-volume <volume-size>]
[--block-device-mapping <dev-name=mapping>]
[--block-device]
[--swap <swap>]
[--ephemeral <size=size[,format=format]
>]
[--network <network>]
[--port <port>]
[--nic <net-id=net-uuid,port-id=port-uuid,v4-fixed-ip=ip-addr,v6-fixed-ip=ip-addr,tag=tag,auto,none>]
[--password <password>]
[--security-group <security-group>]
[--key-name <key-name>]
[--property <key=value>]
[--file <dest-filename=source-filename>]
[--user-data <user-data>]
[--description <description>]
[--availability-zone <zone-name>]
[--host <host>]
[--hypervisor-hostname <hypervisor-hostname>]
[--hint <key=value>]
[--use-config-drive | --no-config-drive | --config-drive <config-drive-volume>|True]
[--min <count>]
[--max <count>]
[--tag <tag>]
[--hostname <hostname>]
[--wait]
[--trusted-image-cert <trusted-cert-id>]
<server-name>
Create server with this flavor (name or ID)
Create server boot disk from this image (name or ID)
Create server using the image that matches the specified property. Property must match exactly one property.
Create server using this volume as the boot disk (name or ID) This option automatically creates a block device mapping with a boot index of 0. On many hypervisors (libvirt/kvm for example) this will be device vda. Do not create a duplicate mapping using –block-device-mapping for this volume.
Create server using this snapshot as the boot disk (name or ID) This option automatically creates a block device mapping with a boot index of 0. On many hypervisors (libvirt/kvm for example) this will be device vda. Do not create a duplicate mapping using –block-device-mapping for this volume.
When used in conjunction with the --image
or --image-property
option, this option automatically creates a block device mapping with a boot index of 0 and tells the compute service to create a volume of the given size (in GB) from the specified image and use it as the root disk of the server. The root volume will not be deleted when the server is deleted. This option is mutually exclusive with the --volume
and --snapshot
options.
Deprecated Create a block device on the server. Block device mapping in the format <dev-name>=<id>:<type>:<size(GB)>:<delete-on-terminate> <dev-name>: block device name, like: vdb, xvdc (required) <id>: Name or ID of the volume, volume snapshot or image (required) <type>: volume, snapshot or image; default: volume (optional) <size(GB)>: volume size if create from image or snapshot (optional) <delete-on-terminate>: true or false; default: false (optional) Replaced by –block-device
Create a block device on the server. Either a path to a JSON file or a CSV-serialized string describing the block device mapping. The following keys are accepted for both: uuid=<uuid>: UUID of the volume, snapshot or ID (required if using source image, snapshot or volume), source_type=<source_type>: source type (one of: image, snapshot, volume, blank), destination_type=<destination_type>: destination type (one of: volume, local) (optional), disk_bus=<disk_bus>: device bus (one of: uml, lxc, virtio, …) (optional), device_type=<device_type>: device type (one of: disk, cdrom, etc. (optional), device_name=<device_name>: name of the device (optional), volume_size=<volume_size>: size of the block device in MiB (for swap) or GiB (for everything else) (optional), guest_format=<guest_format>: format of device (optional), boot_index=<boot_index>: index of disk used to order boot disk (required for volume-backed instances), delete_on_termination=<true|false>: whether to delete the volume upon deletion of server (optional), tag=<tag>: device metadata tag (optional), volume_type=<volume_type>: type of volume to create (name or ID) when source if blank, image or snapshot and dest is volume (optional)
Create and attach a local swap block device of <swap_size> MiB.
Create and attach a local ephemeral block device of <size> GiB and format it to <format>.
Create a NIC on the server and connect it to network. Specify option multiple times to create multiple NICs. This is a wrapper for the ‘–nic net-id=<network>’ parameter that provides simple syntax for the standard use case of connecting a new server to a given network. For more advanced use cases, refer to the ‘–nic’ parameter.
Create a NIC on the server and connect it to port. Specify option multiple times to create multiple NICs. This is a wrapper for the ‘–nic port-id=<port>’ parameter that provides simple syntax for the standard use case of connecting a new server to a given port. For more advanced use cases, refer to the ‘–nic’ parameter.
Create a NIC on the server. NIC in the format: net-id=<net-uuid>: attach NIC to network with this UUID, port-id=<port-uuid>: attach NIC to port with this UUID, v4-fixed-ip=<ip-addr>: IPv4 fixed address for NIC (optional), v6-fixed-ip=<ip-addr>: IPv6 fixed address for NIC (optional), tag: interface metadata tag (optional) (supported by –os-compute-api-version 2.43 or above), none: (v2.37+) no network is attached, auto: (v2.37+) the compute service will automatically allocate a network.
Specify option multiple times to create multiple NICs. Specifying a –nic of auto or none cannot be used with any other –nic value. Either net-id or port-id must be provided, but not both.
Set the password to this server. This option requires cloud support.
Security group to assign to this server (name or ID) (repeat option to set multiple groups)
Keypair to inject into this server
Set a property on this server (repeat option to set multiple values)
File(s) to inject into image before boot (repeat option to set multiple files)(supported by –os-compute-api-version 2.57 or below)
User data file to serve from the metadata server
Set description for the server (supported by –os-compute-api-version 2.19 or above)
Select an availability zone for the server. Host and node are optional parameters. Availability zone in the format <zone-name>:<host-name>:<node-name>, <zone-name>::<node-name>, <zone-name>:<host-name> or <zone-name>
Requested host to create servers. (admin only) (supported by –os-compute-api-version 2.74 or above)
Requested hypervisor hostname to create servers. (admin only) (supported by –os-compute-api-version 2.74 or above)
Hints for the scheduler
Enable config drive.
Disable config drive.
Deprecated Use specified volume as the config drive, or ‘True’ to use an ephemeral drive. Replaced by ‘–use-config-drive’.
Minimum number of servers to launch (default=1)
Maximum number of servers to launch (default=1)
Tags for the server. Specify multiple times to add multiple tags. (supported by –os-compute-api-version 2.52 or above)
Hostname configured for the server in the metadata service. If unset, a hostname will be automatically generated from the server name. A utility such as cloud-init is required to propagate the hostname in the metadata service to the guest OS itself. (supported by –os-compute-api-version 2.90 or above)
Wait for build to complete
Trusted image certificate IDs used to validate certificates during the image signature verification process. May be specified multiple times to pass multiple trusted image certificate IDs. (supported by –os-compute-api-version 2.63 or above)
New server name
Evacuate a server to a different host.
This command is used to recreate a server after the host it was on has failed. It can only be used if the compute service that manages the server is down. This command should only be used by an admin after they have confirmed that the instance is not running on the failed host.
If the server instance was created with an ephemeral root disk on non-shared storage the server will be rebuilt using the original glance image preserving the ports and any attached data volumes.
If the server uses boot for volume or has its root disk on shared storage the root disk will be preserved and reused for the evacuated instance on the new host.
openstack server evacuate
[--wait]
[--host <host>]
[--password <password> | --shared-storage]
<server>
Wait for evacuation to complete
Set the preferred host on which to rebuild the evacuated server. The host will be validated by the scheduler. (supported by –os-compute-api-version 2.29 or above)
Set the password on the evacuated instance. This option is mutually exclusive with the –shared-storage option. This option requires cloud support.
Indicate that the instance is on shared storage. This will be auto-calculated with –os-compute-api-version 2.14 and greater and should not be used with later microversions. This option is mutually exclusive with the –password option
Server (name or ID)
Delete server(s)
openstack server delete
[--force]
[--all-projects]
[--wait]
<server>
[<server> ...]
Force delete server(s)
Delete server(s) in another project by name (admin only)(can be specified using the ALL_PROJECTS envvar)
Wait for delete to complete
Server(s) to delete (name or ID)
Create a dump file in server(s)
Trigger crash dump in server(s) with features like kdump in Linux. It will create a dump file in the server(s) dumping the server(s)’ memory, and also crash the server(s). OSC sees the dump file (server dump) as a kind of resource.
This command requires --os-compute-api-version
2.17 or greater.
openstack server dump create <server> [<server> ...]
Server(s) to create dump file (name or ID)
List servers
openstack server list
[--format-config-file FORMAT_CONFIG]
[--sort-column SORT_COLUMN]
[--sort-ascending | --sort-descending]
[--reservation-id <reservation-id>]
[--ip <ip-address-regex>]
[--ip6 <ip-address-regex>]
[--name <name-regex>]
[--instance-name <server-name>]
[--status <status>]
[--flavor <flavor>]
[--image <image>]
[--host <hostname>]
[--all-projects]
[--project <project>]
[--project-domain <project-domain>]
[--user <user>]
[--user-domain <user-domain>]
[--deleted]
[--availability-zone AVAILABILITY_ZONE]
[--key-name KEY_NAME]
[--config-drive | --no-config-drive]
[--progress PROGRESS]
[--vm-state <state>]
[--task-state <state>]
[--power-state <state>]
[--long]
[-n | --name-lookup-one-by-one]
[--marker <server>]
[--limit <num-servers>]
[--changes-before <changes-before>]
[--changes-since <changes-since>]
[--locked | --unlocked]
[--tags <tag>]
[--not-tags <tag>]
Config file for the dict-to-csv formatter
specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated
sort the column(s) in ascending order
sort the column(s) in descending order
Only return instances that match the reservation
Regular expression to match IP addresses
Regular expression to match IPv6 addresses. Note that this option only applies for non-admin users when using --os-compute-api-version
2.5 or greater.
Regular expression to match names
Regular expression to match instance name (admin only)
Search by server status
Search by flavor (name or ID)
Search by image (name or ID)
Search by hostname
Include all projects (admin only) (can be specified using the ALL_PROJECTS envvar)
Search by project (admin only) (name or ID)
Domain the project belongs to (name or ID). This can be used in case collisions between project names exist.
Search by user (name or ID) (admin only before microversion 2.83)
Domain the user belongs to (name or ID). This can be used in case collisions between user names exist.
Only display deleted servers (admin only)
Search by availability zone (admin only before microversion 2.83)
Search by keypair name (admin only before microversion 2.83)
Only display servers with a config drive attached (admin only before microversion 2.83)
Only display servers without a config drive attached (admin only before microversion 2.83)
Search by progress value (%%) (admin only before microversion 2.83)
Search by vm_state value (admin only before microversion 2.83)
Search by task_state value (admin only before microversion 2.83)
Search by power_state value (admin only before microversion 2.83)
List additional fields in output
Skip flavor and image name lookup. Mutually exclusive with “–name-lookup-one-by-one” option.
When looking up flavor and image names, look them upone by one as needed instead of all together (default). Mutually exclusive with “–no-name-lookup|-n” option.
The last server of the previous page. Display list of servers after marker. Display all servers if not specified. When used with --deleted
, the marker must be an ID, otherwise a name or ID can be used.
Maximum number of servers to display. If limit equals -1, all servers will be displayed. If limit is greater than ‘osapi_max_limit’ option of Nova API, ‘osapi_max_limit’ will be used instead.
List only servers changed before a certain point of time. The provided time should be an ISO 8061 formatted time (e.g., 2016-03-05T06:27:59Z). (supported by –os-compute-api-version 2.66 or above)
List only servers changed after a certain point of time. The provided time should be an ISO 8061 formatted time (e.g., 2016-03-04T06:27:59Z).
Only display locked servers (supported by –os-compute-api-version 2.73 or above)
Only display unlocked servers (supported by –os-compute-api-version 2.73 or above)
Only list servers with the specified tag. Specify multiple times to filter on multiple tags. (supported by –os-compute-api-version 2.26 or above)
Only list servers without the specified tag. Specify multiple times to filter on multiple tags. (supported by –os-compute-api-version 2.26 or above)
Lock server(s). A non-admin user will not be able to execute actions
openstack server lock [--reason <reason>] <server> [<server> ...]
Reason for locking the server(s). Requires --os-compute-api-version
2.73 or greater.
Server(s) to lock (name or ID)
Migrate server to different host.
A migrate operation is implemented as a resize operation using the same flavor as the old server. This means that, like resize, migrate works by creating a new server using the same flavor and copying the contents of the original disk into a new one. As with resize, the migrate operation is a two-step process for the user: the first step is to perform the migrate, and the second step is to either confirm (verify) success and release the old server, or to declare a revert to release the new server and restart the old one.
openstack server migrate
[--live-migration]
[--host <hostname>]
[--shared-migration | --block-migration]
[--disk-overcommit | --no-disk-overcommit]
[--wait]
<server>
Live migrate the server; use the --host
option to specify a target host for the migration which will be validated by the scheduler
Migrate the server to the specified host. (supported with –os-compute-api-version 2.30 or above when used with the –live-migration option) (supported with –os-compute-api-version 2.56 or above when used without the –live-migration option)
Perform a shared live migration (default before –os-compute-api-version 2.25, auto after)
Perform a block live migration (auto-configured from –os-compute-api-version 2.25)
Allow disk over-commit on the destination host(supported with –os-compute-api-version 2.24 or below)
Do not over-commit disk on the destination host (default)(supported with –os-compute-api-version 2.24 or below)
Wait for migrate to complete
Server (name or ID)
DEPRECATED: Confirm server migration.
Use ‘server migration confirm’ instead.
openstack server migrate confirm <server>
Server (name or ID)
Revert server migration.
Use ‘server migration revert’ instead.
openstack server migrate revert <server>
Server (name or ID)
Pause server(s)
openstack server pause <server> [<server> ...]
Server(s) to pause (name or ID)
Perform a hard or soft server reboot
openstack server reboot [--hard | --soft] [--wait] <server>
Perform a hard reboot
Perform a soft reboot
Wait for reboot to complete
Server (name or ID)
Rebuild server
openstack server rebuild
[--image <image>]
[--name <name>]
[--password <password>]
[--property <key=value>]
[--description <description>]
[--preserve-ephemeral | --no-preserve-ephemeral]
[--key-name <key-name> | --no-key-name]
[--user-data <user-data> | --no-user-data]
[--trusted-image-cert <trusted-cert-id> | --no-trusted-image-certs]
[--hostname <hostname>]
[--wait]
<server>
Recreate server from the specified image (name or ID).Defaults to the currently used one.
Set the new name of the rebuilt server
Set the password on the rebuilt server. This option requires cloud support.
Set a new property on the rebuilt server (repeat option to set multiple values)
Set a new description on the rebuilt server (supported by –os-compute-api-version 2.19 or above)
Preserve the default ephemeral storage partition on rebuild.
Do not preserve the default ephemeral storage partition on rebuild.
Set the key name of key pair on the rebuilt server. Cannot be specified with the –key-unset option. (supported by –os-compute-api-version 2.54 or above)
Unset the key name of key pair on the rebuilt server. Cannot be specified with the –key-name option. (supported by –os-compute-api-version 2.54 or above)
Add a new user data file to the rebuilt server. Cannot be specified with the –no-user-data option. (supported by –os-compute-api-version 2.57 or above)
Remove existing user data when rebuilding server. Cannot be specified with the –user-data option. (supported by –os-compute-api-version 2.57 or above)
Trusted image certificate IDs used to validate certificates during the image signature verification process. May be specified multiple times to pass multiple trusted image certificate IDs. Cannot be specified with the –no-trusted-certs option. (supported by –os-compute-api-version 2.63 or above)
Remove any existing trusted image certificates from the server. Cannot be specified with the –trusted-certs option. (supported by –os-compute-api-version 2.63 or above)
Hostname configured for the server in the metadata service. A separate utility running in the guest is required to propagate changes to this value to the guest OS itself. (supported by –os-compute-api-version 2.90 or above)
Wait for rebuild to complete
Server (name or ID)
Remove fixed IP address from server
openstack server remove fixed ip <server> <ip-address>
Server to remove the fixed IP address from (name or ID)
Fixed IP address to remove from the server (IP only)
Remove floating IP address from server
openstack server remove floating ip <server> <ip-address>
Server to remove the floating IP address from (name or ID)
Floating IP address to remove from server (IP only)
Remove all ports of a network from server
openstack server remove network <server> <network>
Server to remove the port from (name or ID)
Network to remove from the server (name or ID)
Remove port from server
openstack server remove port <server> <port>
Server to remove the port from (name or ID)
Port to remove from the server (name or ID)
Remove security group from server
openstack server remove security group <server> <group>
Name or ID of server to use
Name or ID of security group to remove from server
Remove volume from server. Specify --os-compute-api-version 2.20
or higher to remove a volume from a server with status SHELVED
or SHELVED_OFFLOADED
.
openstack server remove volume <server> <volume>
Server (name or ID)
Volume to remove (name or ID)
Put server in rescue mode
openstack server rescue
[--image <image>]
[--password <password>]
<server>
Image (name or ID) to use for the rescue mode. Defaults to the currently used one.
Set the password on the rescued instance. This option requires cloud support.
Server (name or ID)
Scale server to a new flavor.
A resize operation is implemented by creating a new server and copying the contents of the original disk into a new one. It is a two-step process for the user: the first step is to perform the resize, and the second step is to either confirm (verify) success and release the old server or to declare a revert to release the new server and restart the old one.
openstack server resize
[--flavor <flavor> | --confirm | --revert]
[--wait]
<server>
Resize server to specified flavor
Deprecated Confirm server resize is complete. Replaced by the ‘openstack server resize confirm’ and ‘openstack server migration confirm’ commands
Deprecated Restore server state before resizeReplaced by the ‘openstack server resize revert’ and ‘openstack server migration revert’ commands
Wait for resize to complete
Server (name or ID)
Confirm server resize.
Confirm (verify) success of resize operation and release the old server.
openstack server resize confirm <server>
Server (name or ID)
Revert server resize.
Revert the resize operation. Release the new server and restart the old one.
openstack server resize revert <server>
Server (name or ID)
Restore server(s)
openstack server restore <server> [<server> ...]
Server(s) to restore (name or ID)
Resume server(s)
openstack server resume <server> [<server> ...]
Server(s) to resume (name or ID)
Set server properties
openstack server set
[--name <new-name>]
[--password PASSWORD | --no-password]
[--property <key=value>]
[--state <state>]
[--description <description>]
[--tag <tag>]
[--hostname <hostname>]
<server>
New server name
Set the server password. This option requires cloud support.
Clear the admin password for the server from the metadata service; note that this action does not actually change the server password
Property to add/change for this server (repeat option to set multiple properties)
New server state WARNING This can result in instances that are no longer usable and should be used with caution (admin only)
New server description (supported by –os-compute-api-version 2.19 or above)
Tag for the server. Specify multiple times to add multiple tags. (supported by –os-compute-api-version 2.26 or above)
Hostname configured for the server in the metadata service. A separate utility running in the guest is required to propagate changes to this value to the guest OS itself. (supported by –os-compute-api-version 2.90 or above)
Server (name or ID)
Shelve and optionally offload server(s).
Shelving a server creates a snapshot of the server and stores this snapshot before shutting down the server. This shelved server can then be offloaded or deleted from the host, freeing up remaining resources on the host, such as network interfaces. Shelved servers can be unshelved, restoring the server from the snapshot. Shelving is therefore useful where users wish to retain the UUID and IP of a server, without utilizing other resources or disks.
Most clouds are configured to automatically offload shelved servers immediately or after a small delay. For clouds where this is not configured, or where the delay is larger, offloading can be manually specified. This is an admin-only operation by default.
openstack server shelve [--offload] [--wait] <server> [<server> ...]
Remove the shelved server(s) from the host (admin only). Invoking this option on an unshelved server(s) will result in the server being shelved first
Wait for shelve and/or offload operation to complete
Server(s) to shelve (name or ID)
Show server details. Specify --os-compute-api-version 2.47
or higher to see the embedded flavor information for the server.
openstack server show [--diagnostics | --topology] <server>
Display server diagnostics information
Include topology information in the output (supported by –os-compute-api-version 2.78 or above)
Server (name or ID)
SSH to server
openstack server ssh
[-4 | -6]
[--public | --private | --address-type <address-type>]
<server>
[-- <standard ssh args> ...]
Use only IPv4 addresses
Use only IPv6 addresses
Use public IP address
Use private IP address
Use other IP address (public, private, etc)
Server (name or ID)
Any argument or option that ssh allows. Use – once between openstackclient args and SSH args.
Start server(s).
openstack server start [--all-projects] <server> [<server> ...]
Start server(s) in another project by name (admin only)(can be specified using the ALL_PROJECTS envvar)
Server(s) to start (name or ID)
Stop server(s).
openstack server stop [--all-projects] <server> [<server> ...]
Stop server(s) in another project by name (admin only)(can be specified using the ALL_PROJECTS envvar)
Server(s) to stop (name or ID)
Suspend server(s)
openstack server suspend <server> [<server> ...]
Server(s) to suspend (name or ID)
Unlock server(s)
openstack server unlock <server> [<server> ...]
Server(s) to unlock (name or ID)
Unpause server(s)
openstack server unpause <server> [<server> ...]
Server(s) to unpause (name or ID)
Restore server from rescue mode
openstack server unrescue <server>
Server (name or ID)
Unset server properties and tags
openstack server unset
[--property <key>]
[--description]
[--tag <tag>]
<server>
Property key to remove from server (repeat option to remove multiple values)
Unset server description (supported by –os-compute-api-version 2.19 or above)
Tag to remove from the server. Specify multiple times to remove multiple tags. (supported by –os-compute-api-version 2.26 or above)
Server (name or ID)
Unshelve server(s)
openstack server unshelve
[--availability-zone AVAILABILITY_ZONE]
[--wait]
<server>
[<server> ...]
Name of the availability zone in which to unshelve a SHELVED_OFFLOADED server (supported by –os-compute-api-version 2.77 or above)
Wait for unshelve operation to complete
Server(s) to unshelve (name or ID)
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.