swap volume is not available because the parameters are opposite

Bug #1536442 reported by jingtao liang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
New
Undecided
Unassigned

Bug Description

version: kilo

description:

in the file:/nova/compute/manager.py . the functions like this:

class _ComputeV4Proxy(object):

    def swap_volume(self, ctxt, instance, old_volume_id, new_volume_id):
        return self.manager.swap_volume(ctxt, instance, old_volume_id,
                                        new_volume_id)

class ComputeManager(manager.Manager):

   @wrap_exception()
    @reverts_task_state
    @wrap_instance_fault
    def swap_volume(self, context, old_volume_id, new_volume_id, instance):

you see ,the parameters of instance should be in the right place .

product steps:

1 create a volume
2 create a vm
3 attach the volume to the vm
4 migrate the volume to another backend.

error logs:

2016-01-21 10:57:24.916 24271 ERROR root [req-15d4d656-06ee-4c02-8da0-af77aaaa9944 9134a1a11e5441c29e37757231f36450 32bfe3124bb2478aad3e6aa1cee09f14 - - -] Original exception being dropped: ['Traceback (most recent call last):\n', ' File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 392, in decorated_function\n return function(self, context, *args, **kwargs)\n', ' File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 5628, in swap_volume\n instance.uuid)\n', "AttributeError: 'unicode' object has no attribute 'uuid'\n"]
2016-01-21 10:57:24.916 24271 ERROR root [req-15d4d656-06ee-4c02-8da0-af77aaaa9944 9134a1a11e5441c29e37757231f36450 32bfe3124bb2478aad3e6aa1cee09f14 - - -] Original exception being dropped: ['Traceback (most recent call last):\n', ' File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 347, in decorated_function\n return function(self, context, *args, **kwargs)\n', ' File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 404, in decorated_function\n kwargs[\'instance\'], e, sys.exc_info())\n', ' File "/usr/lib/python2.7/site-packages/nova/compute/utils.py", line 89, in add_instance_fault_from_exc\n fault_obj.instance_uuid = instance.uuid\n', "AttributeError: 'unicode' object has no attribute 'uuid'\n"]
2016-01-21 10:57:24.917 24271 ERROR oslo_messaging.rpc.dispatcher [req-15d4d656-06ee-4c02-8da0-af77aaaa9944 9134a1a11e5441c29e37757231f36450 32bfe3124bb2478aad3e6aa1cee09f14 - - -] Exception during message handling: string indices must be integers
2016-01-21 10:57:24.917 24271 TRACE oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2016-01-21 10:57:24.917 24271 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply
2016-01-21 10:57:24.917 24271 TRACE oslo_messaging.rpc.dispatcher executor_callback))
2016-01-21 10:57:24.917 24271 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
2016-01-21 10:57:24.917 24271 TRACE oslo_messaging.rpc.dispatcher executor_callback)
2016-01-21 10:57:24.917 24271 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 130, in _do_dispatch
2016-01-21 10:57:24.917 24271 TRACE oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2016-01-21 10:57:24.917 24271 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 8262, in swap_volume
2016-01-21 10:57:24.917 24271 TRACE oslo_messaging.rpc.dispatcher new_volume_id)
2016-01-21 10:57:24.917 24271 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/exception.py", line 88, in wrapped
2016-01-21 10:57:24.917 24271 TRACE oslo_messaging.rpc.dispatcher payload)
2016-01-21 10:57:24.917 24271 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 85, in __exit__
2016-01-21 10:57:24.917 24271 TRACE oslo_messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2016-01-21 10:57:24.917 24271 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/exception.py", line 71, in wrapped
2016-01-21 10:57:24.917 24271 TRACE oslo_messaging.rpc.dispatcher return f(self, context, *args, **kw)
2016-01-21 10:57:24.917 24271 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 363, in decorated_function
2016-01-21 10:57:24.917 24271 TRACE oslo_messaging.rpc.dispatcher instance_uuid = keyed_args['instance']['uuid']
2016-01-21 10:57:24.917 24271 TRACE oslo_messaging.rpc.dispatcher TypeError: string indices must be integers

please check this bug, tks.

Tags: volumes
Changed in cinder:
assignee: nobody → jingtao liang (liang-jingtao)
assignee: jingtao liang (liang-jingtao) → nobody
no longer affects: cinder
tags: added: volumes
Revision history for this message
Vivek Dhayaal (vivekdhayaal) wrote :
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.