Deprecate create snapshot from share group in CephFS

Deprecate the create snapshot from share group feature
in CephFS drivers (both Native and NFS Ganesha).

This needs to be done since the subvolume group snapshot
feature is no longer supported in mainline CephFS, meaning that,
if we leave the call in place, an exception will be raised
from the backend and lead to an error status for the attempted
snapshot from share group.

Existing group snapshots can still be listed and deleted, so these
operations stay the same.

Closes-Bug: #1925332
Change-Id: I49efb7042d38257416875f40c03923e974b2eb8e
This commit is contained in:
Victoria Martinez de la Cruz 2021-07-19 14:40:57 +00:00
parent 6c329e1a80
commit cf4af61638
4 changed files with 27 additions and 30 deletions

View File

@ -41,7 +41,7 @@ Supported Operations
The following operations are supported with CephFS backend: The following operations are supported with CephFS backend:
- Create/delete share - Create, delete, update and list share
- Allow/deny access to share - Allow/deny access to share
* Only ``cephx`` access type is supported for CephFS native protocol. * Only ``cephx`` access type is supported for CephFS native protocol.
@ -49,10 +49,12 @@ The following operations are supported with CephFS backend:
* ``read-only`` and ``read-write`` access levels are supported. * ``read-only`` and ``read-write`` access levels are supported.
- Extend/shrink share - Extend/shrink share
- Create/delete snapshot - Create, delete, update and list snapshot
- Create/delete share groups - Create, delete, update and list share groups
- Create/delete share group snapshots - Delete and list share group snapshots
.. important:: Share group snapshot creation is no longer supported in mainline
CephFS. This feature has been removed from manila W release.
Prerequisites Prerequisites
~~~~~~~~~~~~~ ~~~~~~~~~~~~~

View File

@ -601,7 +601,7 @@ class CephFSDriver(driver.ExecuteMixin, driver.GaneshaMixin,
rados_command(self.rados_client, "fs subvolumegroup create", argdict) rados_command(self.rados_client, "fs subvolumegroup create", argdict)
def delete_share_group(self, context, sg_dict, share_server=None): def delete_share_group(self, context, sg_dict, share_server=None):
# create a FS group # delete a FS group
LOG.debug("[%(be)s]: delete_share_group: share_group=%(id)s.", LOG.debug("[%(be)s]: delete_share_group: share_group=%(id)s.",
{"be": self.backend_name, "id": sg_dict['id']}) {"be": self.backend_name, "id": sg_dict['id']})
@ -641,16 +641,10 @@ class CephFSDriver(driver.ExecuteMixin, driver.GaneshaMixin,
{"be": self.backend_name, "id": snap_dict['share_group_id'], {"be": self.backend_name, "id": snap_dict['share_group_id'],
"sn": snap_dict["id"]}) "sn": snap_dict["id"]})
argdict = { msg = _("Share group snapshot feature is no longer supported in "
"vol_name": self.volname, "mainline CephFS (existing group snapshots can still be "
"group_name": snap_dict["share_group_id"], "listed and deleted).")
"snap_name": snap_dict["id"] raise exception.ShareBackendException(msg=msg)
}
rados_command(
self.rados_client, "fs subvolumegroup snapshot create", argdict)
return None, []
def _get_clone_status(self, share): def _get_clone_status(self, share):
"""Check the status of a newly cloned share.""" """Check the status of a newly cloned share."""

View File

@ -409,22 +409,15 @@ class CephFSDriverTestCase(test.TestCase):
group_delete_prefix, group_delete_dict) group_delete_prefix, group_delete_dict)
def test_create_share_group_snapshot(self): def test_create_share_group_snapshot(self):
group_snapshot_create_prefix = "fs subvolumegroup snapshot create" msg = ("Share group snapshot feature is no longer supported in "
"mainline CephFS (existing group snapshots can still be "
"listed and deleted).")
driver.rados_command.side_effect = exception.ShareBackendException(msg)
group_snapshot_create_dict = { self.assertRaises(exception.ShareBackendException,
"vol_name": self._driver.volname, self._driver.create_share_group_snapshot,
"group_name": "sgid", self._context, {'share_group_id': 'sgid',
"snap_name": "snapid", 'id': 'snapid'})
}
self._driver.create_share_group_snapshot(self._context, {
'share_group_id': 'sgid',
'id': 'snapid',
})
driver.rados_command.assert_called_once_with(
self._driver.rados_client,
group_snapshot_create_prefix, group_snapshot_create_dict)
def test_delete_share_group_snapshot(self): def test_delete_share_group_snapshot(self):
group_snapshot_delete_prefix = "fs subvolumegroup snapshot rm" group_snapshot_delete_prefix = "fs subvolumegroup snapshot rm"

View File

@ -0,0 +1,8 @@
---
deprecations:
- |
Create share group snapshot feature is no longer supported
in manila CephFS drivers (both Native and NFS Ganesha) since
the subvolume group snapshot feature is no longer supported
in mainline CephFS (existing group snapshots can still
be listed and deleted).