Creating and deleting volumes
Limitations
- A volume is removed along with all of its snapshots.
To create a volume
Admin panel
Command-line interface
Use the following command:
vinfra service compute volume create [--description <description>] [--network-install <network_install>] [--image <image>] [--snapshot <snapshot>] --storage-policy <storage_policy> --size <size-gb> <volume-name>
--description <description>
-
Volume description
A description should not contain any personally identifiable information or sensitive business data.
--network-install <network_install>
- Perform network installation (
true
orfalse
). --image <image>
- Source compute image ID or name
--snapshot <snapshot>
- Source compute volume snapshot ID or name
--storage-policy <storage_policy>
- Storage policy ID or name
--size <size-gb>
- Volume size, in gigabytes
<volume-name>
- Volume name
For example, to create a volume myvolume
sized 8 GB and with the default storage policy, run:
# vinfra service compute volume create myvolume --storage-policy default --size 8 +--------------------------------+--------------------------------------+ | Field | Value | +--------------------------------+--------------------------------------+ | attachments | [] | | availability_zone | nova | | bootable | False | | consistencygroup_id | | | created_at | 2018-09-12T12:30:12.665916 | | description | | | encrypted | False | | id | c9c0e9e7-ce7a-4566-99d5-d7e40f2987ab | | imageRef | | | migration_status | | | multiattach | False | | name | myvolume | | network_install | False | | os-vol-host-attr:host | | | os-vol-mig-status-attr:migstat | | | os-vol-mig-status-attr:name_id | | | project_id | 72a5db3a033c403a86756021e601ef34 | | replication_status | | | size | 8 | | snapshot_id | | | source_volid | | | status | creating | | storage_policy_name | default | | updated_at | | | user_id | 98bf389983c24c07af9677b931783143 | | volume_image_metadata | | +--------------------------------+--------------------------------------+
The new volume will appear in the vinfra service compute volume list
output:
# vinfra service compute volume list -c id -c name -c size -c status +--------------------------------------+----------+------+-----------+ | id | name | size | status | +--------------------------------------+----------+------+-----------+ | c9c0e9e7-ce7a-4566-99d5-d7e40f2987ab | myvolume | 8 | available | +--------------------------------------+----------+------+-----------+
To remove a volume
Admin panel
- On the Compute > Storage > Volumes tab, check the status of the volume you want to remove.
- If the status is "In use", click the volume, and then click Force detach.
- If the status is "Available", click the volume, and then click Delete.
Command-line interface
Use the following command:
vinfra service compute volume delete <volume>
<volume>
- Volume ID or name
For example, to delete the volume myvolume2
, run:
# vinfra service compute volume delete myvolume2 Operation successful