Attached volume migration failed, due to incorrect arguments order passed to swap_volume

Bug #1451860 reported by Peter Wang
46
This bug affects 5 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Chhavi Agarwal
Kilo
Fix Released
Undecided
Unassigned
OpenStack-Ansible
Fix Released
Medium
Kevin Carter

Bug Description

Steps to reproduce:
1. create a volume in cinder
2. boot a server from image in nova
3. attach this volume to server
4. use ' cinder migrate --force-host-copy True 3fa956b6-ba59-46df-8a26-97fcbc18fc82 openstack-wangp11-02@pool_backend_1#Pool_1'

log from nova compute:( see attched from detail info):

2015-05-05 00:33:31.768 ERROR root [req-b8424cde-e126-41b0-a27a-ef675e0c207f admin admin] Original exception being dropped: ['Traceback (most recent ca
ll last):\n', ' File "/opt/stack/nova/nova/compute/manager.py", line 351, in decorated_function\n return function(self, context, *args, **kwargs)\n
', ' File "/opt/stack/nova/nova/compute/manager.py", line 4982, in swap_volume\n context, old_volume_id, instance_uuid=instance.uuid)\n', "Attribut
eError: 'unicode' object has no attribute 'uuid'\n"]

according to my debug result:
# here parameters passed to swap_volume
    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)
# swap_volume function
    @wrap_exception()
    @reverts_task_state
    @wrap_instance_fault
    def swap_volume(self, context, old_volume_id, new_volume_id, instance):
        """Swap volume for an instance."""
        context = context.elevated()

        bdm = objects.BlockDeviceMapping.get_by_volume_id(
                context, old_volume_id, instance_uuid=instance.uuid)
        connector = self.driver.get_volume_connector(instance)

You can find: passed in order is "self, ctxt, instance, old_volume_id, new_volume_id" while function definition is "self, context, old_volume_id, new_volume_id, instance"

this cause the 'unicode' object has no attribute 'uuid'\n" error when trying to access instance['uuid']

BTW: this problem was introduced in https://review.openstack.org/#/c/172152

affect both Kilo and master

Thanks
Peter

Revision history for this message
Peter Wang (peter.wang) wrote :
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/180279

Changed in nova:
assignee: nobody → Chhavi Agarwal (chhagarw)
status: New → In Progress
Matt Riedemann (mriedem)
tags: added: kilo-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/180287

Matt Riedemann (mriedem)
Changed in nova:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/180279
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=80832d9bb42da2b86853748874ad38dd30b9342d
Submitter: Jenkins
Branch: master

commit 80832d9bb42da2b86853748874ad38dd30b9342d
Author: chhagarw <email address hidden>
Date: Wed May 6 00:54:59 2015 +0530

    Incorrect argument order passed to swap_volume

    swap_volume method in _ComputeV4Proxy has incorrect
    argument ordering, due to which attach volume migration
    is failing with AttributeError
    Modified the _ComputeV4Proxy detach_volume to have correct
    argument ordering.

    Change-Id: I899c053246f9eb4ac9b13a8434161a82193d1cef
    Closes-Bug: #1451860

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

Reviewed: https://review.openstack.org/180287
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=7ae9466fc506db7c01469a2e4e5b8a735fc7ab41
Submitter: Jenkins
Branch: stable/kilo

commit 7ae9466fc506db7c01469a2e4e5b8a735fc7ab41
Author: chhagarw <email address hidden>
Date: Wed May 6 00:54:59 2015 +0530

    Incorrect argument order passed to swap_volume

    swap_volume method in _ComputeV4Proxy has incorrect
    argument ordering, due to which attach volume migration
    is failing with AttributeError
    Modified the _ComputeV4Proxy detach_volume to have correct
    argument ordering.

    Change-Id: I899c053246f9eb4ac9b13a8434161a82193d1cef
    Closes-Bug: #1451860
    (cherry picked from commit 80832d9bb42da2b86853748874ad38dd30b9342d)

tags: added: in-stable-kilo
Changed in openstack-ansible:
importance: Undecided → Medium
status: New → In Progress
assignee: nobody → Kevin Carter (kevin-carter)
milestone: none → 11.0.2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-ansible-deployment (kilo)

Fix proposed to branch: kilo
Review: https://review.openstack.org/185694

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-ansible-deployment (kilo)

Reviewed: https://review.openstack.org/185694
Committed: https://git.openstack.org/cgit/stackforge/os-ansible-deployment/commit/?id=aa472d0620dd01e670c526da0ce074b0352382ab
Submitter: Jenkins
Branch: kilo

commit aa472d0620dd01e670c526da0ce074b0352382ab
Author: kevin <email address hidden>
Date: Tue May 26 11:41:04 2015 -0700

    Updated Kilo to use the head of the kilo branches

    This commit revs all services, and other to use the head of the
    stable/kilo branches. This change brings in various bug fixes
    and updates that will allow us to ensure that we have a stable and
    capable deployment system.

    Change-Id: I9badd032554000d0f4ea42f0d17c43ececd8ad9a
    Closes-Bug: 1451860

Changed in openstack-ansible:
status: In Progress → Fix Committed
Changed in openstack-ansible:
status: Fix Committed → Fix Released
Revision history for this message
Bjoern (bjoern-t) wrote :
Download full text (13.0 KiB)

That seems to work now, although it threw an rpc message error:

cinder migrate 68e364bb-c767-41cf-83b5-6ad5d1a773b4 "cinder01_cinder_volumes_container-b9c480ca@lvm#LVM_iSCSI"

cinder status :
compute02:~# cinder list |grep 50gtake3
| 40e20ced-fc9e-46a1-ab0c-99add0b6550b | attaching | 50gtake3 | 50 | None | false | |
| 68e364bb-c767-41cf-83b5-6ad5d1a773b4 | in-use | 50gtake3 | 50 | None | false | fc4d8d0f-3a7c-465a-8abf-18ad7d58139e |

compute02:~# cinder show 68e364bb-c767-41cf-83b5-6ad5d1a773b4 |grep -i mig
| os-vol-mig-status-attr:migstat | completing |
| os-vol-mig-status-attr:name_id | None |

libvirt domain config:
<disk type='block' device='disk'>
 <source dev='/dev/disk/by-path/ip-172.29.239.19:3260-iscsi-iqn.2010-10.org.openstack:volume-68e364bb-c767-41cf-83b5-6ad5d1a773b4-lun-1'/>
 <mirror file='/dev/disk/by-path/ip-172.29.238.110:3260-iscsi-iqn.2010-10.org.openstack:volume-40e20ced-fc9e-46a1-ab0c-99add0b6550b-lun-1' format='raw'/>
 <alias name='virtio-disk2'/>
</disk>

compute02:~# ll /dev/disk/by-path/ip-172.29.238.110:3260-iscsi-iqn.2010-10.org.openstack:volume-40e20ced-fc9e-46a1-ab0c-99add0b6550b-lun-1
lrwxrwxrwx 1 root root 9 Jun 9 17:01 /dev/disk/by-path/ip-172.29.238.110:3260-iscsi-iqn.2010-10.org.openstack:volume-40e20ced-fc9e-46a1-ab0c-99add0b6550b-lun-1 -> ../../sdd

compute02:~# iostat -xm 2 sdd
Linux 3.13.0-48-generic (compute02) 06/09/2015 _x86_64_ (24 CPU)

avg-cpu: %user %nice %system %iowait %steal %idle
           0.08 0.00 1.07 3.41 0.00 95.43

Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
sdd 0.00 0.00 0.00 337.50 0.00 160.50 973.94 6.52 19.02 0.00 19.02 1.30 43.80

The migration finished although it threw an rpc message error:

2015-06-09 17:09:24.282 47230 ERROR oslo_messaging.rpc.dispatcher [req-2df6b831-f299-4c32-b8aa-950eb7f693a7 cd93ded7844d44cc9da5f67104813993 fd2714bd133c4ca7b7d09db35735adb2 -
 - -] Exception during message handling: Internal Server Error (HTTP 500) (Request-ID: req-31f70227-f8c4-4a6c-bff6-db541f0ac6c0)
2015-06-09 17:09:24.282 47230 TRACE oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2015-06-09 17:09:24.282 47230 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_
reply
015-06-09 17:09:24.282 47230 TRACE oslo_messaging.rpc.dispatcher executor_callback))
2015-06-09 17:09:24.282 47230 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
2015-06-09 17:09:24.282 47230 TRACE oslo_messaging.rpc.dispatcher executor_callback)
2015-06-09 17:09:24.282 47230 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 130, in _do_dispatch
2015-06-09 17:09:24.282 47230 TRACE oslo_messaging.rpc.dis...

Thierry Carrez (ttx)
Changed in nova:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: liberty-1 → 12.0.0
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/openstack-ansible 11.2.11

This issue was fixed in the openstack/openstack-ansible 11.2.11 release.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/openstack-ansible 11.2.12

This issue was fixed in the openstack/openstack-ansible 11.2.12 release.

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/openstack-ansible 11.2.14

This issue was fixed in the openstack/openstack-ansible 11.2.14 release.

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.