instance rebuild with volumes attached fails

Bug #1071547 reported by clayg
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Rick Harris

Bug Description

In rebuild, where we call driver.destroy we're not passing a copy of the block device mapping, so no attempt is made to disconnect the volumes.

When the new instance is started, it's unable to "check_attach" on the already "in-use" volumes.

2012-10-25 18:43:18 ERROR nova.compute.manager [req-d507ef16-dc8a-4259-b509-d85301096872 212975 706689] [instance: 75083163-7756-49b4-b91c-5bf0bab46de8] Invalid volume: status must be available. Setting instance vm_state to ERROR

passing the block_device_mapping into destroy (as is done in terminate) may not be the ideal solution because the mountpoints would get lost on the attachments. Removing the call to check_attach may not work since _setup_block_device_mapping is re-used on run_instance in _prep_block_device.

clayg (clay-gerrard)
summary: - instance rebuild with volumes attached
+ instance rebuild with volumes attached fails
Changed in nova:
status: New → Triaged
importance: Undecided → High
tags: added: folsom-backport-potential
clayg (clay-gerrard)
description: updated
Revision history for this message
Cory Stone (corystone) wrote :

If rebuild is modified to issue the detaches, libvirt happily reattaches the volumes but xen does not.

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

Changed in nova:
assignee: nobody → Rick Harris (rconradharris)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/20673
Committed: http://github.com/openstack/nova/commit/8705f49a4ad9c6f3a93f33e333475285a8f70a30
Submitter: Jenkins
Branch: master

commit 8705f49a4ad9c6f3a93f33e333475285a8f70a30
Author: Rick Harris <email address hidden>
Date: Tue Jan 29 07:26:48 2013 +0000

    Fix rebuild with volumes attached

    This patch assumes that the correct behavior for instance rebuild is to
    maintain attached volumes across a rebuild operation.

    Two important changes are:

    1) Detaching all volumes during a rebuild so that they won't be 'in-use'
       when prep_block_devices is called to reattach them.

    2) xenapi: Allowing additional volumes, not just root volumes, to be
       attached before boot. To handle this, we cycle through all
       block-device-mappings, not just the root-device, create the VDI, and
       later, create the VBD.

    Small changes include:

    * Using `connection_data` instead of `dev_params` (to match other parts of
      the code base)

    * Renaming `get_vdis_for_boot_from_vol` to `get_vdi_uuid_for_volume` to
      reflect its more general and simpler semantics.

    Fixes bug 1071547

    Change-Id: Ie54a16be4bae2a718ed7d506f32777d0847b9089

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