VM do not resume if attach an volume when suspended

Bug #1241337 reported by Guangya Liu (Jay Lau)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Guangya Liu (Jay Lau)
Havana
Fix Released
Undecided
Unassigned

Bug Description

1) nova suspend vm2
2) nova attach vm2 6ac2e985-9586-438f-a027-bc9591fa5b43 /dev/sdb
3) nova volume-attach vm2 6ac2e985-9586-438f-a027-bc9591fa5b43 /dev/sdb
4) nova resume vm2

VM failed to resume and nova compute report the following errors.

2013-10-18 12:16:33.175 ERROR nova.openstack.common.rpc.amqp [req-a8b196e3-dbd5-45f4-814e-56a715b07fdf admin admin] Exception during message handling
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp Traceback (most recent call last):
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/openstack/common/rpc/amqp.py", line 461, in _process_data
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp **args)
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/openstack/common/rpc/dispatcher.py", line 172, in dispatch
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp result = getattr(proxyobj, method)(ctxt, **kwargs)
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/compute/manager.py", line 354, in decorated_function
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp return function(self, context, *args, **kwargs)
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/exception.py", line 90, in wrapped
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp payload)
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/exception.py", line 73, in wrapped
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp return f(self, context, *args, **kw)
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/compute/manager.py", line 244, in decorated_function
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp pass
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/compute/manager.py", line 230, in decorated_function
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp return function(self, context, *args, **kwargs)
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/compute/manager.py", line 295, in decorated_function
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp function(self, context, *args, **kwargs)
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/compute/manager.py", line 272, in decorated_function
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp e, sys.exc_info())
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/compute/manager.py", line 259, in decorated_function
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp return function(self, context, *args, **kwargs)
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/compute/manager.py", line 3314, in resume_instance
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp block_device_info)
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 1969, in resume
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp block_device_info)
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 3206, in _create_domain_and_network
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp {'connection_info': jsonutils.dumps(connection_info)})
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/compute/manager.py", line 420, in block_device_mapping_update
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp context, bdm_id, values)
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/conductor/api.py", line 170, in block_device_mapping_update
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp context, values, create=False)
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/conductor/rpcapi.py", line 244, in block_device_mapping_update_or_create
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp values=values, create=create)
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/rpcclient.py", line 85, in call
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp return self._invoke(self.proxy.call, ctxt, method, **kwargs)
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/rpcclient.py", line 63, in _invoke
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp return cast_or_call(ctxt, msg, **self.kwargs)
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/openstack/common/rpc/proxy.py", line 126, in call
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp result = rpc.call(context, real_topic, msg, timeout)
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/openstack/common/rpc/__init__.py", line 139, in call
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp return _get_impl().call(CONF, context, topic, msg, timeout)
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/openstack/common/rpc/impl_kombu.py", line 816, in call
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp rpc_amqp.get_connection_pool(conf, Connection))
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/openstack/common/rpc/amqp.py", line 572, in call
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp rv = multicall(conf, context, topic, msg, timeout, connection_pool)
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/openstack/common/rpc/amqp.py", line 558, in multicall
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp pack_context(msg, context)
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/openstack/common/rpc/amqp.py", line 308, in pack_context
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp for (key, value) in context.to_dict().iteritems()])
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp AttributeError: 'NoneType' object has no attribute 'to_dict'
2013-10-18 12:16:33.175 TRACE nova.openstack.common.rpc.amqp

Changed in nova:
assignee: nobody → Jay Lau (jay-lau-513)
Changed in nova:
importance: Undecided → Medium
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/52581

Changed in nova:
status: New → In Progress
Mark McLoughlin (markmc)
tags: added: havana-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit de4158861000dedc204314c545cc5682aa38f5f1
Author: Jay Lau <email address hidden>
Date: Thu Nov 14 22:12:27 2013 +0800

    Add context as parameter for resume

    Now for KVM when resume an instance with block storage, nova
    compute will throw exception and failed to resume the VM.

    The root cause is that when resume a VM with block storage,
    libvirt driver needs to call conductor via rpcapi to update
    block device, but the function of resume() do not have context,
    this will cause RPC api failed.

    Change-Id: I712777ed1d893a2b6463d30c407b0a677e37b602
    Closes-Bug: #1241337

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/59872

Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/havana)

Reviewed: https://review.openstack.org/59872
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=b56453526f52b6f962e8a3a324050349e87a3f65
Submitter: Jenkins
Branch: stable/havana

commit b56453526f52b6f962e8a3a324050349e87a3f65
Author: Jay Lau <email address hidden>
Date: Thu Nov 14 22:12:27 2013 +0800

    Add context as parameter for resume

    Now for KVM when resume an instance with block storage, nova
    compute will throw exception and failed to resume the VM.

    The root cause is that when resume a VM with block storage,
    libvirt driver needs to call conductor via rpcapi to update
    block device, but the function of resume() do not have context,
    this will cause RPC api failed.

    Change-Id: I712777ed1d893a2b6463d30c407b0a677e37b602
    Closes-Bug: #1241337
    (cherry picked from commit de4158861000dedc204314c545cc5682aa38f5f1)

tags: added: in-stable-havana
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-1 → 2014.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.