Cannot unshelve instance with user volumes

Bug #1305399 reported by Liusheng
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Mehdi Abaakouk

Bug Description

the steps to reproduce:

1. boot an instance with user volume: nova boot --flavor 11 --image cirros --block-device-mapping /dev/vdb=a6118113-bce9-4e0f-89ce-d2aecb0148f8 test_vm1

2. shelve the instance: nova shelve 958b6615-1a02-46a7-a0cf-a4b253f1b9de

3. unshelve the instance: nova unshelve 958b6615-1a02-46a7-a0cf-a4b253f1b9de

the instance will be in task_state of "unshelving", and the error message in log file is:

[-] Exception during message handling: Invalid volume: status must be 'available'
Traceback (most recent call last):
  File "/opt/stack/oslo.messaging/oslo/messaging/rpc/dispatcher.py", line 133, in _dispatch_and_reply
    incoming.message))
  File "/opt/stack/oslo.messaging/oslo/messaging/rpc/dispatcher.py", line 176, in _dispatch
    return self._do_dispatch(endpoint, method, ctxt, args)
  File "/opt/stack/oslo.messaging/oslo/messaging/rpc/dispatcher.py", line 122, in _do_dispatch
    result = getattr(endpoint, method)(ctxt, **new_args)
  File "/opt/stack/nova/nova/exception.py", line 88, in wrapped
    payload)
  File "/opt/stack/nova/nova/openstack/common/excutils.py", line 68, in __exit__
    six.reraise(self.type_, self.value, self.tb)
  File "/opt/stack/nova/nova/exception.py", line 71, in wrapped
    return f(self, context, *args, **kw)
  File "/opt/stack/nova/nova/compute/manager.py", line 243, in decorated_function
    pass
  File "/opt/stack/nova/nova/openstack/common/excutils.py", line 68, in __exit__
    six.reraise(self.type_, self.value, self.tb)
  File "/opt/stack/nova/nova/compute/manager.py", line 229, in decorated_function
    return function(self, context, *args, **kwargs)
  File "/opt/stack/nova/nova/compute/manager.py", line 294, in decorated_function
    function(self, context, *args, **kwargs)
  File "/opt/stack/nova/nova/compute/manager.py", line 271, in decorated_function
    e, sys.exc_info())
  File "/opt/stack/nova/nova/openstack/common/excutils.py", line 68, in __exit__
    six.reraise(self.type_, self.value, self.tb)
  File "/opt/stack/nova/nova/compute/manager.py", line 258, in decorated_function
    return function(self, context, *args, **kwargs)
  File "/opt/stack/nova/nova/compute/manager.py", line 3593, in unshelve_instance
    do_unshelve_instance()
  File "/opt/stack/nova/nova/openstack/common/lockutils.py", line 249, in inner
    return f(*args, **kwargs)
  File "/opt/stack/nova/nova/compute/manager.py", line 3592, in do_unshelve_instance
    filter_properties, node)
  File "/opt/stack/nova/nova/compute/manager.py", line 3617, in _unshelve_instance
    block_device_info = self._prep_block_device(context, instance, bdms)
  File "/opt/stack/nova/nova/compute/manager.py", line 1463, in _prep_block_device
    instance=instance)
  File "/opt/stack/nova/nova/openstack/common/excutils.py", line 68, in __exit__
    six.reraise(self.type_, self.value, self.tb)
  File "/opt/stack/nova/nova/compute/manager.py", line 1442, in _prep_block_device
    self.driver, self._await_block_device_map_created) +
  File "/opt/stack/nova/nova/virt/block_device.py", line 364, in attach_block_devices
    map(_log_and_attach, block_device_mapping)
  File "/opt/stack/nova/nova/virt/block_device.py", line 362, in _log_and_attach
    bdm.attach(*attach_args, **attach_kwargs)
  File "/opt/stack/nova/nova/virt/block_device.py", line 44, in wrapped
    ret_val = method(obj, context, *args, **kwargs)
  File "/opt/stack/nova/nova/virt/block_device.py", line 218, in attach
    volume_api.check_attach(context, volume, instance=instance)
  File "/opt/stack/nova/nova/volume/cinder.py", line 229, in check_attach
    raise exception.InvalidVolume(reason=msg)
InvalidVolume: Invalid volume: status must be 'available'

Tags: volumes
Liusheng (liusheng)
Changed in nova:
assignee: nobody → Liusheng (liusheng)
Tracy Jones (tjones-i)
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/87188

Changed in nova:
status: New → In Progress
Mehdi Abaakouk (sileht)
Changed in nova:
assignee: Liusheng (liusheng) → Mehdi Abaakouk (sileht)
Revision history for this message
Tracy Jones (tjones-i) wrote :

this has not been touched in a long time and the patches are abandoned. Please set back to in progress if you start to work on it

Changed in nova:
status: In Progress → Triaged
Revision history for this message
Liusheng (liusheng) wrote :

the abandoned patch is duplicate with patch: https://review.openstack.org/#/c/84793 uploaded by Mehdi Abaakouk, this patch is still in reviewing and need others' review. thanks

Changed in nova:
status: Triaged → In Progress
Dan Prince (dan-prince)
Changed in nova:
importance: Undecided → High
Revision history for this message
Jay Pipes (jaypipes) wrote :

Dan, you hit to -Workflow button on https://review.openstack.org/#/c/84793, which was Mehdi's patch that fixes this bug. Can you explain why that was and why the patch is abandoned?

Thanks!

-jay

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/84793
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=8831f3d0e2e2a81a6b406cc9c8bf89bc15989065
Submitter: Jenkins
Branch: master

commit 8831f3d0e2e2a81a6b406cc9c8bf89bc15989065
Author: Mehdi Abaakouk <email address hidden>
Date: Wed Apr 2 15:31:23 2014 +0200

    Allow to unshelve instance booted from volume

    When we shelve an instance, volumes are not detached from cinder to kept
    them 'In-Use' in cinder
    But when you unshelve this instance, nova ask cinder the reattach theses
    volumes. This fails, because volume cannot be attached twice.

    This patch permits when we ask the libvirt DriverBlockDevice to attach a
    device to the instance to bypass the cinder attachement code that is not needed
    when we unshelve an instance, because the cinder volume is kept 'In-use'
    during the 'shelved' state.

    Co-Authored-By: Sahid Orentino Ferdjaoui <email address hidden>
    Closes-bug: #1305399
    Change-Id: I780a9407feeb48ecd3e295508ce3e6bc3b09d3e6

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