Swapping volume does not change non-bootable volume's 'Bootable' flag to True

Bug #1642492 reported by Hussain Chachuliya
6
This bug affects 1 person
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-1262-45da-a1c0-053759a182da

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-37a2-48c0-8936-6537e8f8c99a | available | lvm_non_bootable | 1 | lvmdriver-1 | false | |
| 636978d3-ef65-4c01-9fa6-fb338b1ed2d0 | available | lvm_bootable | 1 | lvmdriver-1 | true | |
+--------------------------------------+-----------+------------------+------+-------------+----------+-------------+

4. Boot an instance using the bootable volume.
nova boot test1 --flavor 1 --boot-volume 636978d3-ef65-4c01-9fa6-fb338b1ed2d0

5. Swap the bootable volume with the non-bootable volume.
nova volume-update test1 636978d3-ef65-4c01-9fa6-fb338b1ed2d0 15acd26a-37a2-48c0-8936-6537e8f8c99a

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-37a2-48c0-8936-6537e8f8c99a | in-use | lvm_non_bootable | 1 | lvmdriver-1 | false | d46f50f9-7be3-4e8d-8673-a5fece60184c |
| 636978d3-ef65-4c01-9fa6-fb338b1ed2d0 | available | lvm_bootable | 1 | lvmdriver-1 | true | |
+--------------------------------------+-----------+------------------+------+-------------+----------+--------------------------------------+

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-37a2-48c0-8936-6537e8f8c99a

ERROR (BadRequest): Block Device 15acd26a-37a2-48c0-8936-6537e8f8c99a is not bootable. (HTTP 400) (Request-ID: req-f26cdfba-8d41-4034-a094-27ba944b37e0)

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.

Tags: volumes
Changed in nova:
assignee: nobody → Hussain Chachuliya (hussainchachuliya)
description: updated
description: updated
Changed in nova:
status: New → In Progress
Revision history for this message
Maciej Szankin (mszankin) wrote :

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.

Changed in nova:
importance: Undecided → Low
tags: added: volumes
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/407346

Changed in nova:
assignee: Hussain Chachuliya (hussainchachuliya) → Pooja Jadhav (poojajadhav)
Changed in nova:
assignee: Pooja Jadhav (poojajadhav) → Bhagyashri Shewale (bhagyashri-shewale)
Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :

If do so then what is impact on existing instance ? I mean if non bootable volume is swapped then that instance can be accessed without any issue ? and new non bootable volume can be used?

If so then stopping non bootable volume swap, will change the instance usage if someone using it that way.

I do not have running env as of now. i will update on this once have. till then if you have tried those scenario pleas update.

Revision history for this message
Matt Riedemann (mriedem) wrote :

This is a super old bug that is arguably not really a bug - I don't see how it's really an issue. You can't boot from a non-bootable volume, which is what the user is trying to do here. If you're swapping the root volume to a non-bootable volume with no image then I'd expect reboot of the server to fail (because where is the operating system for the server?). There could be other weird edge cases like swapping to a non-bootable volume and then rebuilding the server, but we kind of need more details here.

Changed in nova:
status: In Progress → Invalid
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Matt Riedemann (<email address hidden>) on branch: master
Review: https://review.opendev.org/407346
Reason: This is a super old bug that is arguably not really a bug - I don't see how it's really an issue. You can't boot from a non-bootable volume, which is what the user is trying to do here. If you're swapping the root volume to a non-bootable volume with no image then I'd expect reboot of the server to fail (because where is the operating system for the server?). There could be other weird edge cases like swapping to a non-bootable volume and then rebuilding the server, but we kind of need more details here.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.