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 to create volumes. The option --size
creates a default, empty volume, and options --snapshot
, --source
, and --image
copy existing volumes.
--description <volume-description>
: additional volume descriptions
openstack volume create --size <size-in-GiB> <new-volume-name>
openstack volume create --snapshot <snapshot-name-or-id> <new-volume-name>
openstack volume create --source <volume-name-or-id> <new-volume-name>
openstack volume create --image <image-name-or-id> <new-volume-name>
Delete a Volume
openstack volume delete <volume-name-or-id>
Attach a Volume to an Instance
--enable-delete-on-termination
: deletes volume if instance is deleted--disable-delete-on-termination
: (default) keeps the volume if 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
The new size should be larger than the existing size.
openstack volume set --size <size-in-GiB> <volume-name-or-id>
List Snapshots
openstack volume snapshot list
Take a Volume Snapshot
openstack volume snapshot create --volume <volume-name-or-id> <new-snapshot-name>
Delete a Snapshot
openstack volume snapshot delete <snapshot-name-or-id>
Transfer a Volume to a Different Project
Create a Transfer Request
Create the transfer request on the project with the volume. Switch to that project with source <openrc-file>
. Note down the auth-key and transfer request id that are generated; you will need it later.
openstack volume transfer request create <volume-name-or-id>
Accept a Transfer Request
Switch to the destination project with source <other-openrc-file>
, and accept the request.
openstack volume transfer request accept --auth-key <key> <transfer-request-id>