Cloning volumes
Limitations
- You can clone volumes that are not attached to VMs or attached to stopped VMs.
Prerequisites
- A volume is created, as described in Creating and deleting volumes.
To clone a volume
Admin panel
Command-line interface
Use the following command:
vinfra service compute volume clone --name <name> [--size <size-gb>] [--storage-policy <storage_policy>] <volume>
--name <name>
- New volume name
--size <size-gb>
- Volume size, in gigabytes
--storage-policy <storage_policy>
- Storage policy ID or name
<volume>
- Volume ID or name
For example, to clone the volume myvolume
to myvolume2
, run:
# vinfra service compute volume clone myvolume --name myvolume2 +--------------------------------+------------------------------------------+ | Field | Value | +--------------------------------+------------------------------------------+ | attachments | [] | | availability_zone | nova | | bootable | True | | consistencygroup_id | | | created_at | 2021-10-18T16:36:39.937068 | | description | | | encrypted | False | | id | 22eb7529-0a2c-44ce-a73c-24f3152bdb54 | | imageRef | | | migration_status | | | multiattach | False | | name | myvolume2 | | network_install | False | | os-vol-host-attr:host | node003.vstoragedomain@vstorage#vstorage | | os-vol-mig-status-attr:migstat | | | os-vol-mig-status-attr:name_id | | | project_id | b906404c55bb44729da99987536ac5bc | | replication_status | | | size | 64 | | snapshot_id | | | source_volid | c80f58c9-c52e-41c4-ad5f-d5b5ed072d4a | | status | creating | | storage_policy_name | default | | traits | [] | | updated_at | 2021-10-18T16:36:40.133516 | | user_id | c727a901a6444ee1a8ad31e3d5b53b3a | | volume_image_metadata | | +--------------------------------+------------------------------------------+