libvirt rollback: destroy called with wrong number of args

Bug #1694834 reported by Steve Noyes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Matt Riedemann

Bug Description

While testing live migration, I hit an exception during libvirt.driver rollback_live_migration_at_destination. The first step is this:

self.destroy(context, instance, network_info, block_device_info,
                         destroy_disks, migrate_data)

But there is no arg in the destroy method for migrate_data:

def destroy(self, context, instance, network_info, block_device_info=None,
                destroy_disks=True):

The tail end of the exception:

  File "/opt/stack/nova/nova/compute/manager.py", line 5896, in rollback_live_migration_at_destination
    destroy_disks=destroy_disks, migrate_data=migrate_data)
  File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 6690, in rollback_live_migration_at_destination
    destroy_disks, migrate_data)
TypeError: destroy() takes at most 6 arguments (7 given)

ubuntu/kvm/pike:

commit 20f47b1a3e8e80e6f9e2373cacc2480404c3cfd9
Merge: c993572 e8afd71
Author: Jenkins <email address hidden>
Date: Wed May 31 16:34:27 2017 +0000

    Merge "Add policy description for os-networks"

summary: - libvirt rollback: destory called with wrong number of args
+ libvirt rollback: destroy called with wrong number of args
Revision history for this message
Matt Riedemann (mriedem) wrote :

I don't see driver.destroy called with migrate_data here:

https://github.com/openstack/nova/blob/20f47b1a3e8e80e6f9e2373cacc2480404c3cfd9/nova/compute/manager.py

Are you sure this wasn't against some patched code of yours?

Changed in nova:
status: New → Incomplete
Revision history for this message
Steve Noyes (steve-noyes) wrote :

This seems to be in the unpatched code in libvirt.py, not compute manager.py.

https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py around line 6698.

   def rollback_live_migration_at_destination(self, context, instance,
       ...
       self.destroy(context, instance, network_info, block_device_info, destroy_disks, migrate_data)

    def destroy(self, context, instance, network_info, block_device_info=None,
destroy_disks=True):

Revision history for this message
Steve Noyes (steve-noyes) wrote :

In the above, I meant libvirt/driver.py, not libivrt.py...

Changed in nova:
status: Incomplete → Confirmed
Revision history for this message
Matt Riedemann (mriedem) wrote :

Ah yeah I see it. Sorry.

Changed in nova:
assignee: nobody → Matt Riedemann (mriedem)
importance: Undecided → High
status: Confirmed → Triaged
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/469958

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

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

commit f1b41683fc81db780c8939754f073a2644042543
Author: Matt Riedemann <email address hidden>
Date: Thu Jun 1 13:47:40 2017 -0400

    libvirt: fix call args to destroy() during live migration rollback

    This was missed during I6cca3b5ddd387dac86750be70f49c764a1be2fca
    where the migrate_data kwarg was removed from the destroy() method
    in the virt drivers.

    The existing test was already brittle in that it just asserts that
    was passed to the mocked method. This change at least makes the test
    a bit less brittle by validating the signature, but there should be
    a better way to do this with autospecing and mock, but I couldn't
    figure it out.

    Change-Id: Iaec2db92b4aa0e6d069c9c5071900e2627683e4e
    Closes-Bug: #1694834

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 16.0.0.0b2

This issue was fixed in the openstack/nova 16.0.0.0b2 development milestone.

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.