Swapping volume does not change non-bootable volume's 'Bootable' flag to True
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Invalid
|
Low
|
Bhagyashri Shewale |
Bug Description
If an instance is booted using a bootable volume and then the volume is swapped with a non-bootable volume, it is possible to reboot the instance along with all the data from the previous volume intact.
But, if the instance is deleted so that the non-bootable volume becomes available; then it is not possible to boot a new instance using the non-bootable volume unless its Bootable flag is set to True explicitly by the user.
Steps to reproduce:
1. Create a bootable volume.
cinder create 1 --name lvm_bootable --image-id ab18becb-
2. Create a non-bootable volume.
cinder create 1 --name lvm_non_bootable
3. Note the Bootable flag of both the volumes by using cinder list command.
cinder list
+------
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+------
| 15acd26a-
| 636978d3-
+------
4. Boot an instance using the bootable volume.
nova boot test1 --flavor 1 --boot-volume 636978d3-
5. Swap the bootable volume with the non-bootable volume.
nova volume-update test1 636978d3-
6. Reboot the instance.
nova reboot test1
7. Note that the Bootable flag of the non-bootable volume is still set to False.
cinder list
+------
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+------
| 15acd26a-
| 636978d3-
+------
8. Delete the instance created in step 4 so that the non-bootable volume becomes available.
9. Try to boot another instance using the non-bootable volume.
nova boot test2 --flavor 1 --boot-volume 15acd26a-
ERROR (BadRequest): Block Device 15acd26a-
Possible solutions:
1. Non-bootable volumes should not be allowed to swap with any other bootable volume.
2. Bootable flag of the non-bootable volume should be set to True in the code after volume swap so that it can be used to boot an instance when available.
3. Explicitly setting Bootable flag of the available non-bootable volume after volume swapping, if required to boot an instance.
Changed in nova: | |
assignee: | nobody → Hussain Chachuliya (hussainchachuliya) |
description: | updated |
description: | updated |
Changed in nova: | |
status: | New → In Progress |
Changed in nova: | |
assignee: | Hussain Chachuliya (hussainchachuliya) → Pooja Jadhav (poojajadhav) |
Changed in nova: | |
assignee: | Pooja Jadhav (poojajadhav) → Bhagyashri Shewale (bhagyashri-shewale) |
I am just curious how does it even work to boot a VM from a non-bootable volume. Anyway, the first approach sounds the most reasonable to me as the most consistent one.