KeyError "extra_specs" in _cold_migrate

Bug #1394569 reported by Eduard Biceri-Matei
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Davanum Srinivas (DIMS)
Juno
Fix Released
Low
Dave Walker

Bug Description

Trying cold migrate

stack@o11n200:/root$ nova list
+--------------------------------------+-------------------+--------+------------+-------------+--------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+-------------------+--------+------------+-------------+--------------------+
| 476324ba-644c-472b-9de7-e4434d8211bc | fedora_instance_1 | ACTIVE | - | Running | private=10.140.0.2 |
| 3dae14aa-9168-4b5c-bb7f-3f38315dc791 | fedora_instance_2 | ACTIVE | - | Running | private=10.140.0.6 |
| e80b5863-f228-49ac-b35f-8d10a0d6e4eb | fedora_instance_3 | ACTIVE | - | Running | private=10.140.0.8 |
| 05b2ea29-ebcd-4a25-9582-6fbd223fba73 | fedora_instance_4 | ACTIVE | - | Running | private=10.140.0.7 |
+--------------------------------------+-------------------+--------+------------+-------------+--------------------+
stack@o11n200:/root$ nova migrate fedora_instance_3
ERROR (BadRequest): The server could not comply with the request since it is either malformed or otherwise incorrect. (HTTP 400) (Request-ID: req-86801856-94cf-43c1-b21e-cb084abf8aac)

Screen (n-api)

2014-11-20 14:01:48.426 ERROR nova.api.openstack.compute.contrib.admin_actions [req-86801856-94cf-43c1-b21e-cb084abf8aac admin admin] Error in migrate u'\'extra_specs\'\nTraceb
ack (most recent call last):\n\n File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 134, in _dispatch_and_reply\n incoming.message))\n\n
File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 177, in _dispatch\n return self._do_dispatch(endpoint, method, ctxt, args)\n\n File "/u
sr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 123, in _do_dispatch\n result = getattr(endpoint, method)(ctxt, **new_args)\n\n File "/usr/loca
l/lib/python2.7/dist-packages/oslo/messaging/rpc/server.py", line 139, in inner\n return func(*args, **kwargs)\n\n File "/opt/stack/nova/nova/conductor/manager.py", line 49
0, in migrate_server\n reservations)\n\n File "/opt/stack/nova/nova/conductor/manager.py", line 550, in _cold_migrate\n quotas.rollback()\n\n File "/usr/local/lib/pytho
n2.7/dist-packages/oslo/utils/excutils.py", line 82, in __exit__\n six.reraise(self.type_, self.value, self.tb)\n\n File "/opt/stack/nova/nova/conductor/manager.py", line 5
36, in _cold_migrate\n request_spec[\'instance_type\'].pop(\'extra_specs\')\n\nKeyError: \'extra_specs\'\n'
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions Traceback (most recent call last):
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions File "/opt/stack/nova/nova/api/openstack/compute/contrib/admin_actions.py", line 151, in _migrate
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions self.compute_api.resize(req.environ['nova.context'], instance)
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions File "/opt/stack/nova/nova/compute/api.py", line 221, in wrapped
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions return func(self, context, target, *args, **kwargs)
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions File "/opt/stack/nova/nova/compute/api.py", line 211, in inner
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions return function(self, context, instance, *args, **kwargs)
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions File "/opt/stack/nova/nova/compute/api.py", line 238, in _wrapped
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions return fn(self, context, instance, *args, **kwargs)
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions File "/opt/stack/nova/nova/compute/api.py", line 192, in inner
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions return f(self, context, instance, *args, **kw)
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions File "/opt/stack/nova/nova/compute/api.py", line 2598, in resize
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions reservations=quotas.reservations or [])
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions File "/opt/stack/nova/nova/conductor/api.py", line 345, in resize_instance
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions None, None, reservations)
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions File "/opt/stack/nova/nova/conductor/rpcapi.py", line 414, in migrate_server
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions reservations=reservations)
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/client.py", line 152, in call
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions retry=self.retry)
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/transport.py", line 90, in _send
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions timeout=timeout, retry=retry)
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/_drivers/amqpdriver.py", line 408, in send
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions retry=retry)
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/_drivers/amqpdriver.py", line 399, in _send
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions raise result
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions KeyError: u'\'extra_specs\'\nTraceback (most recent call last):\n\n File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 134, in _dispatch_and_reply\n incoming.message))\n\n File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 177, in _dispatch\n return self._do_dispatch(endpoint, method, ctxt, args)\n\n File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 123, in _do_dispatch\n result = getattr(endpoint, method)(ctxt, **new_args)\n\n File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/server.py", line 139, in inner\n return func(*args, **kwargs)\n\n File "/opt/stack/nova/nova/conductor/manager.py", line 490, in migrate_server\n reservations)\n\n File "/opt/stack/nova/nova/conductor/manager.py", line 550, in _cold_migrate\n quotas.rollback()\n\n File "/usr/local/lib/python2.7/dist-packages/oslo/utils/excutils.py", line 82, in __exit__\n six.reraise(self.type_, self.value, self.tb)\n\n File "/opt/stack/nova/nova/conductor/manager.py", line 536, in _cold_migrate\n request_spec[\'instance_type\'].pop(\'extra_specs\')\n\nKeyError: \'extra_specs\'\n'
2014-11-20 14:01:48.426 TRACE nova.api.openstack.compute.contrib.admin_actions

stack@o11n200:/root$ nova-manage --version
2015.1

Changed in nova:
assignee: nobody → Vladik Romanovsky (vladik-romanovsky)
Changed in nova:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

Vladik, i'd like to work on this one, if it's ok

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

Changed in nova:
assignee: Vladik Romanovsky (vladik-romanovsky) → Davanum Srinivas (DIMS) (dims-v)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/136747
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=709aee3370be6719db92b8860e8b9f73aec866fc
Submitter: Jenkins
Branch: master

commit 709aee3370be6719db92b8860e8b9f73aec866fc
Author: Davanum Srinivas <email address hidden>
Date: Mon Nov 24 07:37:11 2014 -0500

    Fix for extra_specs KeyError

    During _cold_migrate, there is a code path when
    extra_specs is not present in the request_spec['instance_type']
    bag. Identified one test case where removing extra_specs
    causes the same error as reported in the bug below. We
    just need to tolerate this by using a default value for pop()

    Closes-Bug: #1394569

    Change-Id: I9d4d02069322af1a1f0b84c1e86d2e586c6712d8

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

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/137036

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

Reviewed: https://review.openstack.org/137036
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=04d6471f48f72657950198c8e566a2978f0583b2
Submitter: Jenkins
Branch: stable/juno

commit 04d6471f48f72657950198c8e566a2978f0583b2
Author: Davanum Srinivas <email address hidden>
Date: Mon Nov 24 07:37:11 2014 -0500

    Fix for extra_specs KeyError

    During _cold_migrate, there is a code path when
    extra_specs is not present in the request_spec['instance_type']
    bag. Identified one test case where removing extra_specs
    causes the same error as reported in the bug below. We
    just need to tolerate this by using a default value for pop()

    Closes-Bug: #1394569

    Conflicts:
            nova/tests/unit/conductor/test_conductor.py

    Change-Id: I9d4d02069322af1a1f0b84c1e86d2e586c6712d8
    (cherry picked from commit 709aee3370be6719db92b8860e8b9f73aec866fc)

Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-1 → 2015.1.0
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.