Skip to content

Boot from volume

Note

We recommend avoiding using this feature if you can. The boot from volume feature was introduced in OpenStack when virtual machines were by default created on the local disk of the hypervisor. This means that a hypervisor failure could make the virtual machine unavailable. Nowadays on the infomaniak Public Cloud infrastructure, the VM local disk is created on a clustered file system tolerant to hypervisors failure, therefore the boot from volume option doesn't provide advantages anymore.

Warning

If you still want to continue, be aware that several VM operations doesn't work and will require manual steps to achieve the operation, such as rescuing, rebuilding, backuping it...

Step 1 Create a volume from an image

First of all pick an image

openstack image list

Then create your volume

openstack volume create --size 20 --image ${IMAGE-ID-OR-NAME} my-boot-from-volume-disk

If it works you should see a similar output

+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| attachments         | []                                   |
| availability_zone   | nova                                 |
| bootable            | false                                |
| consistencygroup_id | None                                 |
| created_at          | 2021-03-04T12:02:08.000000           |
| description         | None                                 |
| encrypted           | False                                |
| id                  | 61ffca4d-b7d5-4754-ab5c-73f8fc9072f7 |
| multiattach         | False                                |
| name                | my-boot-from-volume-disk             |
| properties          |                                      |
| replication_status  | None                                 |
| size                | 10                                   |
| snapshot_id         | None                                 |
| source_volid        | None                                 |
| status              | creating                             |
| type                | CEPH_1                               |
| updated_at          | None                                 |
| user_id             | b1580497f51e4d10b9110c60c154562c     |
+---------------------+--------------------------------------+

Checking the status again using openstack volume show will allow the volume creation to be followed.

  • downloading means that the volume contents is being transferred from the image service to the volume service
  • available means the volume can now be used for booting. A set of volume_image meta data is also copied from the image service.
taylor@laptop:~$ openstack volume list
+--------------------------------------+--------------------------+-----------+------+-------------+
| ID                                   | Name                     | Status    | Size | Attached to |
+--------------------------------------+--------------------------+-----------+------+-------------+
| ecfec650-aa3e-45a7-a505-b334cbe60247 | my-boot-from-volume-disk | available |   20 |             |
+--------------------------------------+--------------------------+-----------+------+-------------+

Step 2 Create the VM using this volume

taylor@laptop:~$ openstack server create --flavor  a4-ram8-disk0 --key-name mykeypair --volume  my-boot-from-volume-disk --network ext-net1 my-boot-from-volume-vm
+-----------------------------+------------------------------------------------------+
| Field                       | Value                                                |
+-----------------------------+------------------------------------------------------+
| OS-DCF:diskConfig           | MANUAL                                               |
| OS-EXT-AZ:availability_zone |                                                      |
| OS-EXT-STS:power_state      | NOSTATE                                              |
| OS-EXT-STS:task_state       | scheduling                                           |
| OS-EXT-STS:vm_state         | building                                             |
| OS-SRV-USG:launched_at      | None                                                 |
| OS-SRV-USG:terminated_at    | None                                                 |
| accessIPv4                  |                                                      |
| accessIPv6                  |                                                      |
| addresses                   |                                                      |
| adminPass                   | 6fRYwUtmjHUU                                         |
| config_drive                |                                                      |
| created                     | 2021-05-28T12:08:58Z                                 |
| flavor                      | a4-ram8-disk0 (8e5deff9-d4e9-4f6f-952c-10875acecda8) |
| hostId                      |                                                      |
| id                          | ac81cfb6-651d-4802-bbb7-81567aac5e8a                 |
| image                       | N/A (booted from volume)                             |
| key_name                    | yubikey-taylor                                       |
| name                        | my-boot-from-volume-vm                               |
| progress                    | 0                                                    |
| project_id                  | e37a74373c674066bdd68936cb2379a5                     |
| properties                  |                                                      |
| security_groups             | name='default'                                       |
| status                      | BUILD                                                |
| updated                     | 2021-05-28T12:08:58Z                                 |
| user_id                     | 76e28fda35054408bb3e1ac3c8aed404                     |
| volumes_attached            |                                                      |
+-----------------------------+------------------------------------------------------+

Your VM is ready :

taylor@laptop:~$ openstack server list
+--------------------------------------+------------------------+--------+-----------------------------------------------+---------------------------------+----------------------------+
| ID                                   | Name                   | Status | Networks                                      | Image                           | Flavor                     |
+--------------------------------------+------------------------+--------+-----------------------------------------------+---------------------------------+----------------------------+
| ac81cfb6-651d-4802-bbb7-81567aac5e8a | my-boot-from-volume-vm | ACTIVE | ext-net1=195.15.240.127, 2001:1600:10:100::8f | N/A (booted from volume)        | a4-ram8-disk0              |
+--------------------------------------+------------------------+--------+-----------------------------------------------+---------------------------------+----------------------------+
taylor@laptop:~$ openstack server show  my-boot-from-volume-vm
+-----------------------------+----------------------------------------------------------+
| Field                       | Value                                                    |
+-----------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig           | MANUAL                                                   |
| OS-EXT-AZ:availability_zone | dc3-a-04                                                 |
| OS-EXT-STS:power_state      | Running                                                  |
| OS-EXT-STS:task_state       | None                                                     |
| OS-EXT-STS:vm_state         | active                                                   |
| OS-SRV-USG:launched_at      | 2021-05-28T12:09:04.000000                               |
| OS-SRV-USG:terminated_at    | None                                                     |
| accessIPv4                  |                                                          |
| accessIPv6                  |                                                          |
| addresses                   | ext-net1=195.15.240.127, 2001:1600:10:100::8f            |
| config_drive                |                                                          |
| created                     | 2021-05-28T12:08:58Z                                     |
| flavor                      | a4-ram8-disk0 (8e5deff9-d4e9-4f6f-952c-10875acecda8)     |
| hostId                      | eb5010c6e36f92f516207aceaff6c1c8144eb8e5b892b1ca5fa6f08b |
| id                          | ac81cfb6-651d-4802-bbb7-81567aac5e8a                     |
| image                       | N/A (booted from volume)                                 |
| key_name                    | yubikey-taylor                                           |
| name                        | my-boot-from-volume-vm                                   |
| progress                    | 0                                                        |
| project_id                  | e37a74373c674066bdd68936cb2379a5                         |
| properties                  |                                                          |
| security_groups             | name='default'                                           |
| status                      | ACTIVE                                                   |
| updated                     | 2021-05-28T12:09:04Z                                     |
| user_id                     | 76e28fda35054408bb3e1ac3c8aed404                         |
| volumes_attached            | id='3fbae1c9-0a2e-4e6f-9361-6156b1371189'                |
+-----------------------------+----------------------------------------------------------+
Back to top