'RBDDriver' object has no attribute 'unmanage_snapshot'

Bug #1645288 reported by int32bit
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
lihaijing

Bug Description

If we use rbd as storage backend, trying to unmanage snapshot will hit an AttributeError: 'RBDDriver' object has no attribute 'unmanage_snapshot':

2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher [req-d770b86b-efd5-4e08-9d62-c1032d2aa815 24d97e40fec0477bb75fdd8660a7b66f 66124df8b15b46dead4bff69ab35cdfb - - -] Exception during message handling: 'RBDDriver' object has no attribute 'unmanage_snapshot'
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 138, in _dispatch_and_reply
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher incoming.message))
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 183, in _dispatch
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher return self._do_dispatch(endpoint, method, ctxt, args)
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 127, in _do_dispatch
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 210, in lso_inner1
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher return lso_inner2(inst, context, snapshot, **kwargs)
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_concurrency/lockutils.py", line 271, in inner
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher return f(*args, **kwargs)
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 209, in lso_inner2
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher return f(*_args, **_kwargs)
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 913, in delete_snapshot
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher snapshot.save()
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher self.force_reraise()
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 901, in delete_snapshot
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher self.driver.unmanage_snapshot(snapshot)
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher AttributeError: 'RBDDriver' object has no attribute 'unmanage_snapshot'
2016-11-28 16:19:04.448 2121 ERROR oslo_messaging.rpc.dispatcher

Revision history for this message
int32bit (int32bit) wrote :

Our RBDDriver neither extends `ManageableSnapshotsVD` nor implements `unmanage_snapshot` method in current version, so obviously the attribute `unmanage_snapshot` doesn't exist, but we don't check it in our current code :

https://github.com/openstack/cinder/blob/master/cinder/volume/manager.py#L882

Changed in cinder:
assignee: nobody → int32bit (int32bit)
Revision history for this message
int32bit (int32bit) wrote :

We can add `unmanage_snapshot` in `BaseVD`, or just check it in `delete_snapshost`:

https://github.com/openstack/cinder/blob/master/cinder/volume/manager.py#L882

I addition, if we fail to delete volume or snapshot, I prefer raise it to user rather than suppress it.

https://github.com/openstack/cinder/blob/master/cinder/volume/manager.py#L885-L890

Current, user can't get any error from server.

Revision history for this message
Jon Bernard (jbernard) wrote :
Jon Bernard (jbernard)
Changed in cinder:
status: New → Invalid
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/521486

Changed in cinder:
assignee: int32bit (int32bit) → lihaijing (lihaijing)
status: Invalid → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (master)

Change abandoned by lihaijing (<email address hidden>) on branch: master
Review: https://review.openstack.org/521486
Reason: Alread add this method in master branch

Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) wrote :

unmanage_snapshot method was added to rbd driver in rocky: https://github.com/openstack/cinder/blob/stable/rocky/cinder/volume/drivers/rbd.py#L1824-L1831

So it seems, that this bug has no sense anymore and might be considered as resolved.

Changed in cinder:
status: In Progress → Fix Released
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.