Preparing boot volumes
The instruction for preparing a boot volume differs depending on the source type.
To make a boot volume from an existing virtual machine
Admin panel
Command-line interface
-
Shut down the VM which boot volume you want to use. For example:
# vinfra service compute server stop myvm
-
Find out the boot volume's ID. For example:
# vinfra service compute server show myvm +---------------+--------------------------------------------+ | Field | Value | +---------------+--------------------------------------------+ | config_drive | | | created | 2021-06-10T08:55:53Z | | description | | | fault | | | flavor | disk: 0 | | | ephemeral: 0 | | | extra_specs: {} | | | original_name: tiny | | | ram: 512 | | | swap: 0 | | | vcpus: 1 | | ha_enabled | True | | host | amigai-ac-ve0.vstoragedomain | | host_status | UP | | id | 6d0fc132-7ea7-41f0-81ca-a4a2b2a2c893 | | key_name | | | metadata | {} | | name | myvm | | networks | - id: bd17c207-5291-4096-be6a-0a8a4bf67792 | | | ipam_enabled: true | | | ips: | | | - 192.168.128.100 | | | mac_addr: fa:16:3e:6b:6c:83 | | | name: private | | | spoofing_protection: true | | orig_hostname | amigai-ac-ve0 | | placements | [] | | power_state | SHUTDOWN | | project_id | dfd99654b8c94b939b638f94abb2ad73 | | status | SHUTOFF | | task_state | | | updated | 2021-06-15T11:24:05Z | | user_data | | | vm_state | stopped | | volumes | - delete_on_termination: false | | | id: 49be1057-c026-494f-b85d-e013728d41bd | | | - delete_on_termination: false | | | id: eca9f679-7e35-4768-ad20-9bcb6af6fd59 | +---------------+--------------------------------------------+
The first volume in the output is the boot one.
-
Clone the boot volume specifying the name of the new volume. For example:
# vinfra service compute volume clone 49be1057-c026-494f-b85d-e013728d41bd \ --name cloned_volume
The cloned volume will appear in the vinfra service compute volume list
output:
# vinfra service compute volume list +------------------+-------------------------+------+-----------+---------------------------+ | id | name | size | status | os-vol-host-attr:host | +------------------+-------------------------+------+-----------+---------------------------+ | 14f4053e-cff5<…> | cloned_volume | 1 | available | node003.vstoragedomain<…> | | 504078c7-9035<…> | myvm/cirros/Boot volume | 1 | in-use | node002.vstoragedomain<…> | +------------------+-------------------------+------+-----------+---------------------------+
To make a boot volume from a template
Admin panel
- Go to the Compute > Storage > Images tab, and then click the required image.
- On the image panel, click Create volume.
-
In the Create volume window, specify the volume name, size, and select a storage policy.
- Click Create.
The new volume will appear on the Compute > Storage > Volumes tab.
Command-line interface
Use the following command:
vinfra service compute volume create [--description <description>] [--image <image>] --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.
--image <image>
- Source compute image 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 called cirros_volume
with the size of 1 GB and the default storage policy from the cirros
image, run:
# vinfra service compute volume create cirros_volume --image cirros --storage-policy default --size 1
The new volume will appear in the vinfra service compute volume list
output:
# vinfra service compute volume list +------------------+-------------------------+------+-----------+---------------------------+ | id | name | size | status | os-vol-host-attr:host | +------------------+-------------------------+------+-----------+---------------------------+ | 232d09db-bc75<…> | cirros_volume | 1 | available | node003.vstoragedomain<…> | | 14f4053e-cff5<…> | cloned_volume | 1 | available | node003.vstoragedomain<…> | | 504078c7-9035<…> | myvm/cirros/Boot volume | 1 | in-use | node002.vstoragedomain<…> | +------------------+-------------------------+------+-----------+---------------------------+