Description
===========
The LVM driver fails to create a group snapshot. It does not have a driver-specific implementation for creating group snapshots (does not implement driver method "create_share_group_snapshot"), so a default/driver agnostic approach is utilized as coded into the base driver. The default approach [1] invokes "create_snapshot" across share group members. The LVM driver fails to create individual snapshots because it relies on a share snapshot attribute that's not passed it:
manila-share[29458]: DEBUG manila.share.driver [None req-3ba98793-5b2d-4d02-b099-a77b7793bd6c None None] Attempting to create a share group snapshot f1a0f792-391c-46c4-bfa0-003f4c194c46. {{(pid=30113) create_share_group_snapshot /opt/stack/new/manila/manila/share/driver.py:1586}}
manila-share[29458]: ERROR manila.share.manager [None req-3ba98793-5b2d-4d02-b099-a77b7793bd6c None None] Share group snapshot f1a0f792-391c-46c4-bfa0-003f4c194c46: create failed
sudo[20667]: pam_unix(sudo:session): session closed for user root
manila-share[29458]: ERROR oslo_messaging.rpc.server [None req-3ba98793-5b2d-4d02-b099-a77b7793bd6c None None] Exception during message handling: KeyError: 'share_name'
manila-share[29458]: ERROR oslo_messaging.rpc.server Traceback (most recent call last):
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_messaging/rpc/server.py", line 165, in _process_incoming
manila-share[29458]: ERROR oslo_messaging.rpc.server res = self.dispatcher.dispatch(message)
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_messaging/rpc/dispatcher.py", line 273, in dispatch
manila-share[29458]: ERROR oslo_messaging.rpc.server return self._do_dispatch(endpoint, method, ctxt, args)
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_messaging/rpc/dispatcher.py", line 193, in _do_dispatch
manila-share[29458]: ERROR oslo_messaging.rpc.server result = func(ctxt, **new_args)
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/utils.py", line 568, in wrapper
manila-share[29458]: ERROR oslo_messaging.rpc.server return func(self, *args, **kwargs)
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/manager.py", line 4310, in create_share_group_snapshot
manila-share[29458]: ERROR oslo_messaging.rpc.server share_group_snapshot_id)
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
manila-share[29458]: ERROR oslo_messaging.rpc.server self.force_reraise()
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
manila-share[29458]: ERROR oslo_messaging.rpc.server six.reraise(self.type_, self.value, self.tb)
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/six.py", line 703, in reraise
manila-share[29458]: ERROR oslo_messaging.rpc.server raise value
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/manager.py", line 4251, in create_share_group_snapshot
manila-share[29458]: ERROR oslo_messaging.rpc.server context, snap_ref, share_server=share_server))
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/driver.py", line 1612, in create_share_group_snapshot
manila-share[29458]: ERROR oslo_messaging.rpc.server context, share_snapshot, share_server=share_server)
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/drivers/lvm.py", line 421, in create_snapshot
manila-share[29458]: ERROR oslo_messaging.rpc.server self._create_snapshot(context, snapshot)
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/drivers/lvm.py", line 119, in _create_snapshot
manila-share[29458]: ERROR oslo_messaging.rpc.server snapshot['share_name'])
manila-share[29458]: ERROR oslo_messaging.rpc.server KeyError: 'share_name'
manila-share[29458]: ERROR oslo_messaging.rpc.server
Steps to reproduce
==================
A chronological list of steps which will help reproduce the issue you hit:
* Setup manila with the LVM backend: https://docs.openstack.org/manila/latest/_downloads/42245fd942d8a3ac38aa3aebbc9c2ad1/lvm_local.conf
* Create a share type
manila type-create default False
* Create a share group type
manila share-group-type-create default default
* Create a share group
manila share-group-create --name test-share-group --share-types default --share-group-type default
* Create a share within the group
manila create nfs 1 --share-group test-share-group --name test-group-share-1
* Create a share group snapshot
manila share-group-snapshot-create test-share-group --name test-group-snapshot
* Check the snapshot status, it would be in error:
manila share-group-snapshot-list
+--------------------------------------+---------------------+--------+-------------+
| id | name | status | description |
+--------------------------------------+---------------------+--------+-------------+
| 7d96531a-c201-4526-a4d6-703effe4824d | test-group-snapshot | error | None |
+--------------------------------------+---------------------+--------+-------------+
Check the manila log, and you'll see an error like this:
manila-share[29458]: DEBUG manila.share.driver [None req-3ba98793-5b2d-4d02-b099-a77b7793bd6c None None] Attempting to create a share group snapshot 7d96531a-c201-4526-a4d6-703effe4824d. {{(pid=30113) create_share_group_snapshot /opt/stack/new/manila/manila/share/driver.py:1586}}
manila-share[29458]: ERROR manila.share.manager [None req-3ba98793-5b2d-4d02-b099-a77b7793bd6c None None] Share group snapshot 7d96531a-c201-4526-a4d6-703effe4824d: create failed
sudo[20667]: pam_unix(sudo:session): session closed for user root
manila-share[29458]: ERROR oslo_messaging.rpc.server [None req-3ba98793-5b2d-4d02-b099-a77b7793bd6c None None] Exception during message handling: KeyError: 'share_name'
manila-share[29458]: ERROR oslo_messaging.rpc.server Traceback (most recent call last):
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_messaging/rpc/server.py", line 165, in _process_incoming
manila-share[29458]: ERROR oslo_messaging.rpc.server res = self.dispatcher.dispatch(message)
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_messaging/rpc/dispatcher.py", line 273, in dispatch
manila-share[29458]: ERROR oslo_messaging.rpc.server return self._do_dispatch(endpoint, method, ctxt, args)
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_messaging/rpc/dispatcher.py", line 193, in _do_dispatch
manila-share[29458]: ERROR oslo_messaging.rpc.server result = func(ctxt, **new_args)
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/utils.py", line 568, in wrapper
manila-share[29458]: ERROR oslo_messaging.rpc.server return func(self, *args, **kwargs)
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/manager.py", line 4310, in create_share_group_snapshot
manila-share[29458]: ERROR oslo_messaging.rpc.server share_group_snapshot_id)
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
manila-share[29458]: ERROR oslo_messaging.rpc.server self.force_reraise()
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
manila-share[29458]: ERROR oslo_messaging.rpc.server six.reraise(self.type_, self.value, self.tb)
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/six.py", line 703, in reraise
manila-share[29458]: ERROR oslo_messaging.rpc.server raise value
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/manager.py", line 4251, in create_share_group_snapshot
manila-share[29458]: ERROR oslo_messaging.rpc.server context, snap_ref, share_server=share_server))
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/driver.py", line 1612, in create_share_group_snapshot
manila-share[29458]: ERROR oslo_messaging.rpc.server context, share_snapshot, share_server=share_server)
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/drivers/lvm.py", line 421, in create_snapshot
manila-share[29458]: ERROR oslo_messaging.rpc.server self._create_snapshot(context, snapshot)
manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/drivers/lvm.py", line 119, in _create_snapshot
manila-share[29458]: ERROR oslo_messaging.rpc.server snapshot['share_name'])
manila-share[29458]: ERROR oslo_messaging.rpc.server KeyError: 'share_name'
manila-share[29458]: ERROR oslo_messaging.rpc.server
Environment
===========
1. Exact version of OpenStack Manila you are running: main/trunk branch
2. Which storage backend did you use? LVM
3. Which networking type did you use? N/A
[1] https://opendev.org/openstack/manila/src/commit/8cccb73f46df763f907171e63d960fb1e6a81fd0/manila/share/driver.py#L1535-L1636
Fix proposed to branch: master /review. opendev. org/743009
Review: https:/