CLI Client: Volumes

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 Volumes

openstack volume list

Create a Volume

There are four ways of creating volume. Using option --size creates a default, empty volume. Where as --snapshot, --source, and --image copies existing volumes.

--description <volume-description> can be added for additional descriptions.

openstack volume create --size <size-in-GB> <volume-name>
openstack volume create --snapshot <snapshot-name-or-id> <volume-name>
openstack volume create --source <volume-name-or-id> <volume-name>
openstack volume create --image <image-name-or-id> <volume-name>

Delete a Volume

openstack volume delete <volume-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>

Extend a Volume

openstack volume set --size <size-in-GB> <volume-name-or-id>

List Snapshots

openstack volume snapshot list

Take a Volume Snapshot

openstack volume snapshot create --volume <volume-name-or-id> <snapshot-name>

Delete a Snapshot

openstack volume snapshot delete <snapshot-name-or-id>

Transfer a Volume to a Different Project

Create a Transfer Request

You must first create the transfer request on the project you want to transfer from by switching to that project with 'source <openrc-file>'. You will need the auth-key and id that is generated from this command later.

openstack volume transfer request create <volume-name-or-id>

Accept a Transfer Request

Then, you must switch to the project you want to tranfer to with You must switch project by calling source '<other-openrc-file>' and accept the request.

openstack volume transfer request accept --auth-key <key> <transfer-request-id>