CLI Client: Instances

Note

Red Cloud 2 is currently in beta testing and not available to all users. If you are not a Red Cloud 2 beta tester, use the production Red Cloud instead. This Red Cloud 2 documentation is still under development.

Beta testers: Report all problems to CAC Help. Please specify Red Cloud 2 when reporting problems. Thank you!

List Instances

openstack server list 

Create an Instance

You should choose and set the following options, all of which should be create before making the instance.

  • --description <description>: can be added for additional descriptions.
  • sources such as image, volume, or snapshot, which should have been created before making an instance.
    • --image <image-name-or-id>: specify a source image
    • --volume <volume-name-or-id>: specify a volume image
    • --snapshot <snapshot-name-or-id>: specify a snapshot image
  • --flavor <flavor-name-or-id>: specify a flavor name, eg. c2.m16, or flavor id.
  • --nic <network-id> or --auto-network: either a priviate network or public network.
  • --security-group <security-group-name-or-id>: security group for this instance.
  • --key-name <keypair-name-or-id>: keypair for this instance.
openstack server create --description <description> --image/volume/snapshot <image/volume/snapshot-name-or-id> --flavor <flavor-name-or-id> --auto-network/--nic <network-id> --security-group <security-group-name-or-id> --key-name <keypair-name-or-id> <instance-name>

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

For --flavor option, it could be flavor name, eg. c2.m16, or flavor id.

openstack server resize --flavor <flavor-name-or-id> <instance-name-or-id>

Confirm/Revert Instance Resize

After resizing, confirm or revert by doing one of the following:

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>

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 --hard <instance-name-or-id>
openstack server reboot --soft <instance-name-or-id>

Attach a Volume to an Instance

Two useful options are --enable-delete-on-termination and --disable-delete-on-termination. --enable-delete-on-termination deletes the volume once instance is deleted. --disable-delete-on-termination keeps the volume in the project once instance is deleted.

openstack server add volume <instance-name-or-id> <volume-name-or-id>

Detach a Volume from an Instance

openstack server remove volume <instance-name-or-id> <volume-name-or-id>