Driver object has no attribute 'update_migrated_volume'

Bug #1471807 reported by Erlon R. Cruz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
High
Eric Harney

Bug Description

The update_migrated_volume() function on volume/manager.py calls the update_migrated_volume() from the driver. If the driver does not implement the function, the manager falls back (by catching the NotImplementedError exception ) and implements a default behavior, not renaming the volume.

If the driver does not have the function implemented, the migration will fail as in this case, an AttributeError exception will be raised.

-------------------------------------
ERROR oslo_messaging.rpc.dispatcher [req-9c63bb4d-0ac2-46c4-9ed1-38628ea32ac1 407e8cfe21514420be000cd21de3e27f f09e3a587762408e94db26143ff68486] Exception during messag
e handling: 'HDSNFSDriver' object has no attribute 'update_migrated_volume'
2015-06-22 12:25:01.954 TRACE oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2015-06-22 12:25:01.954 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply
2015-06-22 12:25:01.954 TRACE oslo_messaging.rpc.dispatcher executor_callback))
2015-06-22 12:25:01.954 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
2015-06-22 12:25:01.954 TRACE oslo_messaging.rpc.dispatcher executor_callback)
2015-06-22 12:25:01.954 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-22 12:25:01.954 TRACE oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2015-06-22 12:25:01.954 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 105, in wrapper
2015-06-22 12:25:01.954 TRACE oslo_messaging.rpc.dispatcher return f(*args, **kwargs)
2015-06-22 12:25:01.954 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/cinder/cinder/volume/manager.py", line 2583, in update_migrated_volume
2015-06-22 12:25:01.954 TRACE oslo_messaging.rpc.dispatcher model_update = self.driver.update_migrated_volume(ctxt,
2015-06-22 12:25:01.954 TRACE oslo_messaging.rpc.dispatcher AttributeError: 'HDSNFSDriver' object has no attribute 'update_migrated_volume'

Changed in cinder:
assignee: nobody → Erlon R. Cruz (sombrafam)
status: New → In Progress
Revision history for this message
Eric Harney (eharney) wrote :

This is broken for the NFS driver as well.

2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher executor_callback))
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher executor_callback)
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 129, in _do_dispatch
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 105, in wrapper
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher return f(*args, **kwargs)
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 105, in wrapper
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher return f(*args, **kwargs)
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/cinder/cinder/volume/manager.py", line 2597, in update_migrated_volume
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher model_update = self.driver.update_migrated_volume(ctxt,
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher AttributeError: 'NfsDriver' object has no attribute 'update_migrated_volume'
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher
2015-07-27 15:20:46.695 TRACE oslo_messaging.rpc.dispatcher

Changed in cinder:
importance: Undecided → High
summary: - Update migration function error
+ Driver object has no attribute 'update_migrated_volume'
Revision history for this message
Jon Bernard (jbernard) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/206210

Changed in cinder:
assignee: Erlon R. Cruz (sombrafam) → Eric Harney (eharney)
Revision history for this message
Erlon R. Cruz (sombrafam) wrote :

I have sent a patch for this quite a while ago. https://review.openstack.org/#/c/198731/, wonder why the link is not in this BUG.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (master)

Change abandoned by Eric Harney (<email address hidden>) on branch: master
Review: https://review.openstack.org/206210
Reason: Great, we're now duplicating fixes because integration between gerrit and launchpad isn't working right.

https://review.openstack.org/#/c/198731/

Eric Harney (eharney)
Changed in cinder:
assignee: Eric Harney (eharney) → Erlon R. Cruz (sombrafam)
Changed in cinder:
assignee: Erlon R. Cruz (sombrafam) → Eric Harney (eharney)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to cinder (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/206559

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/198731
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=162f4125e13493d8e51e41363986c5167999f481
Submitter: Jenkins
Branch: master

commit 162f4125e13493d8e51e41363986c5167999f481
Author: Erlon R. Cruz <email address hidden>
Date: Tue Jul 7 11:30:15 2015 -0300

    Move update_migrated_volume() to BaseVD

    The update_migrated_volume() function on volume/manager.py
    calls the update_migrated_volume() from the driver. If the
    driver does not implement the function, the manager falls
    back (by catching the NotImplementedError exception) and
    implements a default behavior, not renaming the volume. If
    the driver does not have the function implemented, the
    migration will fail as in this case, an AttributeError
    exception can be raised.

    We fix this by implementing the method
    update_migrate_volume() in the BaseVD driver so all drivers
    now throw the proper exception.

    Change-Id: I9f3cbdc5ae1cdcbf8fe61168abf35b985d4182c6
    Closes-Bug: #1471807

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

Reviewed: https://review.openstack.org/206559
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=0eb3014195a3e300e6179296c2cfabfa4e785821
Submitter: Jenkins
Branch: master

commit 0eb3014195a3e300e6179296c2cfabfa4e785821
Author: Eric Harney <email address hidden>
Date: Tue Jul 28 10:19:07 2015 -0400

    Remove RetypeVD class, fix NFS driver retype

    retype() only exists in the deprecated VolumeDriver() class
    and not BaseVD. This means that drivers inheriting from *VD
    hit attribute errors when trying to call driver.retype().

    The thinking here is that RetypeVD isn't really necessary,
    since all drivers must implement some version of the retype
    method (even if it's a no-op with just a standard return code).

    Therefore, just rely on this being in the base driver class(es)
    rather than making it a separate abc class.

    Closes-Bug: #1478987
    Related-Bug: #1471807

    Change-Id: Ie0c6f23caf68080a05a10cc7ad245878a057fb02

Thierry Carrez (ttx)
Changed in cinder:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to cinder (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/221425

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: master
Review: https://review.openstack.org/221445

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to cinder (master)

Reviewed: https://review.openstack.org/221425
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=223fbd36b7ec433040f5b95dcbaacf46f6939b79
Submitter: Jenkins
Branch: master

commit 223fbd36b7ec433040f5b95dcbaacf46f6939b79
Author: Eric Harney <email address hidden>
Date: Tue Sep 8 13:31:31 2015 -0400

    Add migrate_volume to BaseVD

    migrate_volume() only exists in the deprecated VolumeDriver()
    class and not BaseVD. This means that drivers inheriting from
    *VD hit attribute errors when trying to call driver.migrate_volume().

    I suspect this indicates that we should rework some of our
    abc class structure a little bit, but this seems like a
    reasonable fix for now.

    Related-Bug: #1478987
    Related-Bug: #1471807
    Closes-Bug: #1493286

    Change-Id: I3d555507416606db265b8ebe335b51a08fe32328

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/221445
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=7edc87ff0e92043f5a21d630bbb9b966f5e34535
Submitter: Jenkins
Branch: master

commit 7edc87ff0e92043f5a21d630bbb9b966f5e34535
Author: Eric Harney <email address hidden>
Date: Tue Sep 8 14:10:55 2015 -0400

    Add manage_existing and unmanage to BaseVD

    manage_existing() and unmanage() only exist in the deprecated
    VolumeDriver() class and not BaseVD. This means that drivers
    inheriting from *VD hit attribute errors when trying to call
    either of these methods.

    Related-Bug: #1478987
    Related-Bug: #1493286
    Related-Bug: #1471807
    Closes-Bug: #1487329

    Change-Id: Ie8aba971b51e1f5eaac5a4e681ea06b358ebb7b8

Thierry Carrez (ttx)
Changed in cinder:
milestone: liberty-3 → 7.0.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.