CLI Client: Instances
This page describes how to use the Openstack CLI client to manage your instances.
List Instances
openstack server list
List all the instances in your project. The following filters are available:
--status <status>
: list only instances in the specified status.--flavor <flavor>
: list only instances in the specified flavor.--ip <ip address>
: list only instances with the specified IP address.
Create an Instance
openstack server create <new-instance-name>
Create a new instance using the following options. All options, except for --key-name
, are required.
- Boot Source:
--image <image-name> --boot-from-volume
: Create a boot volume from the specified image and boot from that boot volume. Please note--boot-from-volume
is required as Red Cloud 2 instances do not have ephemeral storage.--volume <volume-name-or-id>
: Launch the instance using the specified volume as the boot volume.--snapshot <snapshot-name-or-id>
: Create a volume from the specified snapshot, and boot the new instances from that volume.
--flavor <flavor-name-or-id>
: Specify the flavor of the new instance.--network <network-name-or-id>
: Specify the network on which the new instance will be created.--security-group <security-group-name-or-id>
: Specify the security group of the new instance.--key-name <key-name>
: Specify the ssh public key to be installed on the instance. You will need to use the matching private key to log into the instance for the first time.
Delete an Instance
openstack server delete <instance-name-or-id>
Shelve an Instance
openstack server shelve <instance-name-or-id>
Unshelve an Instance
openstack server unshelve <instance-name-or-id>
Resize an Instance
openstack server resize --flavor <flavor-name-or-id> <instance-name-or-id>
Confirm/Revert Instance Resize
openstack server resize confirm <instance-name-or-id>
openstack server resize revert <instance-name-or-id>
Pause an Instance
openstack server pause <instance-name-or-id>
Unpause an Instance
openstack server unpause <instance-name-or-id>
Suspend an Instance
openstack server suspend <instance-name-or-id>
Resume an Instance
openstack server resume <instance-name-or-id>
Soft / Hard Reboot an Instance
openstack server reboot <instance-name-or-id>
Reboot the specified instance.
Available options:
--soft
: soft reboot the instance (default)--hard
: hard reboot the instance (equivalent to power cycling a server)
Shut off an Instance
openstack server stop <instance-name-or-id>
Start an Instance
openstack server start <instance-name-or-id>