rescue instance with libvirt and "boot from volume"

Bug #1067744 reported by Alex Handle
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Nikola Đipanov

Bug Description

Hello!

I tried to use the rescue call with a "boot from volumes" instance, which didn't work,
because the rescue function (nova/compute/manager.py) does not pass the block_device_info to the libvirt driver.

I dug a little deeper and made some changes in nova/virt/libvirt/driver.py.
i modified the resuce function to pass the block_device_info for the to_xml and _create_image function.
Then i modified some more code to get the libvirt xml right.

Please see my attached patch.

Please note i'm a beginner in python and nova coding :)

Alex

Revision history for this message
Alex Handle (alexhandle) wrote :
Revision history for this message
Vish Ishaya (vishvananda) wrote :

This looks mostly correct, although it probably needs similar additions to the other drivers. Assigning to rmk to see if he can clean it up and propose it.

Changed in nova:
importance: Undecided → Medium
status: New → Triaged
assignee: nobody → Rafi Khardalian (rkhardalian)
Revision history for this message
Rafi Khardalian (rkhardalian) wrote :

Hi Alex -- Thanks for the patch.

It looks like a reasonable solution, though I do have some minor nits we can work out via the review process. Are you comfortable submitting this via the standard Gerrit workflow (http://wiki.openstack.org/GerritWorkflow)? This would set you up for future contributions as well.

Or, I can also submit it on your behalf, if you prefer.

Revision history for this message
Alex Handle (alexhandle) wrote :

Hi!

I will try to submit it to gerrit in the next days.

Alex

Revision history for this message
Rafi Khardalian (rkhardalian) wrote :

Hi Alex,

I haven't seen this submitted yet. Do you need some help? Would you like me to submit it on your behalf?

Revision history for this message
Alex Handle (alexhandle) wrote :

Hi Rafi!

I would submit it, but i think it needs some additions to the other hypervisor drivers,
because i changed the parameters in the drivers rescue function.

I don't really have the infrastructure or knowledge to test the this fix on different hypervisors.
So maybe you can make the changes on my behalf?

Revision history for this message
Rafi Khardalian (rkhardalian) wrote :

Sure, no problem.

Revision history for this message
Nikola Đipanov (ndipanov) wrote :

Looking at the code - this actually seems to be the intended behaviour. Rescue is supposed to just create a way to log into a wayward instance if something goes wrong with the base image that may have had some data (logfiles etc.) and make it possible to grab that - block devices are assumed to be accessible by attaching them again and are considered persistant so no need for rescue there.

Having all this in mind it does make sense to dissallow rescuing an instance booted from volume as it does not make any sens (all the data is persisted to the volume anyway), so this might be a worthwhile fix.

This may change in the future tho since we may add support for booting form volumes that are targeted to local discs (kind of like using a volume for an image) however this is not the case yet so disabling resuce if instance is booted from volume makes sense.

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/23834

Changed in nova:
assignee: Rafi Khardalian (rkhardalian) → Nikola Đipanov (ndipanov)
status: Triaged → In Progress
Joe Gordon (jogo)
Changed in nova:
milestone: none → grizzly-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/23834
Committed: http://github.com/openstack/nova/commit/cbc0df73015702a2503f83885ea11355c8f2bcc4
Submitter: Jenkins
Branch: master

commit cbc0df73015702a2503f83885ea11355c8f2bcc4
Author: Nikola Dipanov <email address hidden>
Date: Thu Mar 7 17:48:54 2013 +0100

    Prevent rescue for volume-backed instances

    This patch prevents rescuing of volume_backed instances, by checking
    for it in the API layer and raising an exception if instance on which a
    rescue was attempted is volume backed.

    Rescue is supposed to just be a way to log into a wayward instance
    if something goes wrong with the base image that may have had some data
    (logfiles etc.) and make it possible to grab that - block devices are
    assumed to be accessible by re-attaching them, and are considered
    persistant so no need for rescue there.

    Fixes bug: #1067744
    blueprint: improve-boot-from-volume

    Change-Id: I8a4b1ccff7406837de3086aa413034e8e647b8fa

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-rc1 → 2013.1
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.