Cannot rebuild a instance booted from volume

Bug #1474253 reported by Hiroyuki Eguchi
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
In Progress
Undecided
Rambo

Bug Description

User rebuild a instance booted from volume in the following steps.

1. Stop a instance
2. Detach a root device volume.
3. Attach a new root device volume.
4. Start a instance

But, currently, It's impossible by these reasons.

1. User not allowed to detach a root device volume.
   - detach boot device volume without warning
     (https://bugs.launchpad.net/nova/+bug/1279300)

2. User not allowed to attach a root device volume expect when creating a instance.
   - A get_next_device_name which is executed when attaching volume, never return a root_device_name.

Changed in nova:
assignee: nobody → Hiroyuki Eguchi (h-eguchi)
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/201458

Changed in nova:
status: New → In Progress
Changed in nova:
assignee: Hiroyuki Eguchi (h-eguchi) → Sean Dague (sdague)
Revision history for this message
Feodor Tersin (ftersin) wrote :
Changed in nova:
assignee: Sean Dague (sdague) → Hiroyuki Eguchi (h-eguchi)
Revision history for this message
Dane Fichter (dane-fichter) wrote :

Why would you need to change the root device of a single instance? Seems like you'd just make a new instance for the new root device? Could you explain the bug in more detail and/or provide steps to recreate it?

Revision history for this message
Zhenyu Zheng (zhengzhenyu) wrote :

@dane-fichter, Hi, it is easy, just rebuild an volume-backed instance using "nova rebuild" , you will find that the root device will not be changed.

Revision history for this message
Paul Murray (pmurray) wrote :

I think this is not a bug - it is deliberate. Most code in nova assumes the root device is always there. The detach explicitly disallows the detach of a root device.

Having said that there is a case for doing this and the following spec is a step towards allowing it: https://review.openstack.org/#/c/221732/

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

I'm going to mark this as invalid given https://review.openstack.org/#/c/221732/.

tags: added: rebuild volumes
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.openstack.org/201458
Reason: This looks abandoned, if you still think this is an issue please restore and address the comments.

Changed in nova:
assignee: Hiroyuki Eguchi (h-eguchi) → Laszlo Hegedus (laszlo-hegedus)
status: Invalid → In Progress
Changed in nova:
assignee: Laszlo Hegedus (laszlo-hegedus) → Zhenyu Zheng (zhengzhenyu)
Changed in nova:
assignee: Zhenyu Zheng (zhengzhenyu) → Laszlo Hegedus (laszlo-hegedus)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Laszlo Hegedus (<email address hidden>) on branch: master
Review: https://review.openstack.org/305079
Reason: I abandon this, since a proper solution would require rethinking of rebuild. It is not defined yet how rebuild should work with volume-backed instances. Someone should write a bp about this.

Changed in nova:
assignee: Laszlo Hegedus (laszlo-hegedus) → nobody
status: In Progress → Confirmed
Revision history for this message
Maciej Szankin (mszankin) wrote :

Cleaning up this bug as it was reopened automatically by infra due to change in gerrit. This should be fixed now fixed given Matt's comment. Feel free to reopen if I am mistaken.

Changed in nova:
status: Confirmed → Invalid
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/442295

Changed in nova:
assignee: nobody → Akira KAMIO (kamio)
status: Invalid → In Progress
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.openstack.org/442295
Reason: Abandoning as a duplicate of https://review.openstack.org/#/c/305079/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Mr Rambo (<email address hidden>) on branch: master
Review: https://review.openstack.org/528994
Reason: Repeat submit
https://review.openstack.org/#/c/528994/

Changed in nova:
assignee: Akira KAMIO (kamio) → Rambo (1rambo)
Revision history for this message
Maxim Monin (maximmonin) wrote :

in Openstack yoga with 3.68 cinder api and 2.90 nova api volume based rebuild can be done successfully with:

1. Server Stop.
2. Set volume status = available (admin rights) - actually we do not change attachments.
3. Volume Reimage.
4. Set volume status = in-use. (admin rights)
5. Start server. Cloud init initialaize new vm with new image with old vm metadata (keys + passwords, userdata, vendordata).

Before step5 can be done:
4.5 server rebuild.
Actually it do nothing in 2.90 nova with volume-backed vm, but enable to change passwords and ssh key metadata before cloud-init.

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

Other bug subscribers

Related blueprints

Remote bug watches

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