DreamCompute command-line interface cheat sheet

This article lists several common commands for your reference.

If you have multiple images or volumes with the same name, you will need to use IDs instead of names in the commands below.

Some of the examples below contain a back slash character at the end of each line. This back slash continues the command on the next line. If you like, you can remove this character and put the entire command on a single line.

Images

List images you can access

[[email protected]]$ openstack image list

Delete specified image

[[email protected]]$ openstack image delete IMAGE

Describe a specific image

[[email protected]]$ openstack image show IMAGE

Compute

List instances, check status of instance

[[email protected]]$ openstack server list

List flavors

[[email protected]]$ openstack flavor list

Boot an ephemeral instance

[[email protected]]$ openstack server create --image IMAGE \
--flavor FLAVOR --key-name KEY INSTANCE_NAME

Show details of instance

[[email protected]]$ openstack server show INSTANCE

View console log of instance

[[email protected]]$ openstack console log show INSTANCE

Generate console URL for instance

[[email protected]]$ openstack console url show INSTANCE

Set metadata on an instance

[[email protected]]$ openstack server set --property newmeta='my meta data' INSTANCE

Create and verify details of an instance snapshot

[[email protected]]$ openstack server image create --name IMAGE --wait INSTANCE
[[email protected]]$ openstack image show IMAGE

Pause, suspend, stop, resize, rebuild, reboot an instance

Pause

[[email protected]]$ openstack server pause INSTANCE

Unpause

[[email protected]]$ openstack server unpause INSTANCE

Suspend

[[email protected]]$ openstack server suspend INSTANCE

Unsuspend

[[email protected]]$ openstack server resume INSTANCE

Stop

[[email protected]]$ openstack server stop INSTANCE

Start

[[email protected]]$ openstack server start INSTANCE

Resize

[[email protected]]$ openstack resize --flavor FLAVOR INSTANCE
[[email protected]]$ openstack resize --confirm --wait INSTANCE
[[email protected]]$ openstack resize --revert --wait INSTANCE

Rebuild

[[email protected]]$ openstack server rebuild --wait INSTANCE

Reboot

[[email protected]]$ openstack server reboot --wait --soft INSTANCE
[[email protected]]$ openstack server reboot --hard --wait INSTANCE

Block Storage

Used to manage volumes that attach to instances and volume snapshots.

Create a new and empty 6 GB volume.

[[email protected]]$ openstack volume create --size 6 VOLUME

Boot an instance to attach the new volume to.

[[email protected]]$ openstack server create --image IMAGE \
--flavor FLAVOR --key-name KEY INSTANCE

List volumes and view status of volume.

[[email protected]]$ openstack volume list

Attach volume to an instance after instance is active and volume is available.

[[email protected]]$ openstack server add volume INSTANCE VOLUME

Did this article answer your questions?

Article last updated PST.