revert-to-snapshot operation failed if the cinder volume has a metadata.

Solution Verified - Updated -

Issue

  • revert-to-snapshot operation failed if the cinder volume has a metadata.
    cinder-volume.log will have logs like below.
DEBUG cinder.manager [req-26d544bf-10f1-4748-8589-6c7deded0c99 - - - - -] Notifying Schedulers of capabilities ... _publish_service_capabilities /usr/lib
/python2.7/site-packages/cinder/manager.py:194
INFO cinder.volume.manager [req-e1ca2ca3-81da-48fb-952e-3d3484e221af a219576c0c7a431e8fe54f4b78011d7e 2e0b0df6eff14a12b715b1459f9fd731 - default default]
 Start to perform revert to snapshot process.
ERROR root [req-e1ca2ca3-81da-48fb-952e-3d3484e221af a219576c0c7a431e8fe54f4b78011d7e 2e0b0df6eff14a12b715b1459f9fd731 - default default] Original exception being dropped: ['Traceback (most recent call last):\n', '  File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 998, in revert_to_snapshot\n    "revert.start")\n', '  File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 2584, in _notify_about_snapshot_usage\n    extra_usage_info=extra_usage_info, host=self.host)\n', '  File "/usr/lib/python2.7/site-packages/cinder/utils.py", line 1197, in wrapped\n    return f(*args, **kwargs)\n', '  File "/usr/lib/python2.7/site-packages/cinder/volume/utils.py"
, line 197, in notify_about_snapshot_usage\n    usage_info = _usage_from_snapshot(snapshot, context, **extra_usage_info)\n', '  File "/usr/lib/python2.7/site-packages/cinder/volume/utils.py", line 181, in _usage_from_snapshot\n    \'metadata\': null_safe_str(snapshot.metadata),\n', '  File "/usr/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 68, in getter\n    return getattr(self, attrname)\n', "AttributeError: 'Snapshot' object has no attribute '_obj_metadata'\n"]
ERROR oslo_messaging.rpc.server [req-e1ca2ca3-81da-48fb-952e-3d3484e221af a219576c0c7a431e8fe54f4b78011d7e 2e0b0df6eff14a12b715b1459f9fd731 - default default] Exception during message handling: AttributeError: 'Snapshot' object has no attribute '_obj_metadata'
ERROR oslo_messaging.rpc.server Traceback (most recent call last):
ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/server.py", line 163, in _process_incoming
ERROR oslo_messaging.rpc.server     res = self.dispatcher.dispatch(message)
ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 220, in dispatch
ERROR oslo_messaging.rpc.server     return self._do_dispatch(endpoint, method, ctxt, args)
ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 190, in _do_dispatch
ERROR oslo_messaging.rpc.server     result = func(ctxt, **new_args)
ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 1012, in revert_to_snapshot
ERROR oslo_messaging.rpc.server     "revert.end")
ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 2584, in _notify_about_snapshot_usage
ERROR oslo_messaging.rpc.server     extra_usage_info=extra_usage_info, host=self.host)
ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/cinder/utils.py", line 1197, in wrapped
ERROR oslo_messaging.rpc.server     return f(*args, **kwargs)
ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/cinder/volume/utils.py", line 197, in notify_about_snapshot_usage
ERROR oslo_messaging.rpc.server     usage_info = _usage_from_snapshot(snapshot, context, **extra_usage_info)
ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/cinder/volume/utils.py", line 181, in _usage_from_snapshot
ERROR oslo_messaging.rpc.server     'metadata': null_safe_str(snapshot.metadata),
ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 68, in getter
ERROR oslo_messaging.rpc.server     return getattr(self, attrname)
ERROR oslo_messaging.rpc.server AttributeError: 'Snapshot' object has no attribute '_obj_metadata'
ERROR oslo_messaging.rpc.server 
DEBUG oslo_service.periodic_task [req-26d544bf-10f1-4748-8589-6c7deded0c99 - - - - -] Running periodic task VolumeManager.publish_service_capabilities run_periodic_tasks /usr/lib/python2.7/site-packages/oslo_service/periodic_task.py:215

Environment

  • Red Hat OpenStack Platform 13
  • cinder

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content