]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/volumes: Disallow subvolume group level snapshots
authorShyamsundar Ranganathan <srangana@redhat.com>
Tue, 25 Aug 2020 22:46:12 +0000 (18:46 -0400)
committerShyamsundar Ranganathan <srangana@redhat.com>
Wed, 26 Aug 2020 17:41:26 +0000 (13:41 -0400)
Fixes: https://tracker.ceph.com/issues/47154
Signed-off-by: Shyamsundar Ranganathan <srangana@redhat.com>
doc/cephfs/fs-volumes.rst
qa/suites/fs/basic_functional/tasks/volumes.yaml
qa/tasks/cephfs/test_volumes.py
src/pybind/mgr/volumes/fs/volume.py

index e5811041ae734ecf6d587fc7fdbe1079c4517cba..689ad0b0fd4df871cc6ae442ffd2e74fb4b73219 100644 (file)
@@ -91,12 +91,8 @@ List subvolume groups using::
 
     $ ceph fs subvolumegroup ls <vol_name>
 
-Create a snapshot (see :doc:`/cephfs/experimental-features`) of a
-subvolume group using::
-
-    $ ceph fs subvolumegroup snapshot create <vol_name> <group_name> <snap_name>
-
-This implicitly snapshots all the subvolumes under the subvolume group.
+.. note:: Subvolume group snapshot feature is no longer supported in mainline CephFS (existing group
+          snapshots can still be listed and deleted)
 
 Remove a snapshot of a subvolume group using::
 
index e94728f9ebf7db9034d4bcab55303f5e97e0c175..1315980eda2eb186783ab8d694999fb660537724 100644 (file)
@@ -15,5 +15,6 @@ overrides:
 
 tasks:
   - cephfs_test_runner:
+      fail_on_skip: false
       modules:
         - tasks.cephfs.test_volumes
index 88cbe0eb3aeada082c71791a5f81e9624207e6ee..580dcfece298e6450fa1f847650fc62b39bf3110 100644 (file)
@@ -6,6 +6,7 @@ import random
 import logging
 import collections
 import uuid
+import unittest
 from hashlib import md5
 from textwrap import dedent
 
@@ -1681,6 +1682,25 @@ class TestVolumes(CephFSTestCase):
         # verify trash dir is clean
         self._wait_for_trash_empty()
 
+    def test_subvolume_group_snapshot_unsupported_status(self):
+        group = self._generate_random_group_name()
+        snapshot = self._generate_random_snapshot_name()
+
+        # create group
+        self._fs_cmd("subvolumegroup", "create", self.volname, group)
+
+        # snapshot group
+        try:
+            self._fs_cmd("subvolumegroup", "snapshot", "create", self.volname, group, snapshot)
+        except CommandFailedError as ce:
+            self.assertEqual(ce.exitstatus, errno.ENOSYS, "invalid error code on subvolumegroup snapshot create")
+        else:
+            self.fail("expected subvolumegroup snapshot create command to fail")
+
+        # remove group
+        self._fs_cmd("subvolumegroup", "rm", self.volname, group)
+
+    @unittest.skip("skipping subvolumegroup snapshot tests")
     def test_subvolume_group_snapshot_create_and_rm(self):
         subvolume = self._generate_random_subvolume_name()
         group = self._generate_random_group_name()
@@ -1707,6 +1727,7 @@ class TestVolumes(CephFSTestCase):
         # remove group
         self._fs_cmd("subvolumegroup", "rm", self.volname, group)
 
+    @unittest.skip("skipping subvolumegroup snapshot tests")
     def test_subvolume_group_snapshot_idempotence(self):
         subvolume = self._generate_random_subvolume_name()
         group = self._generate_random_group_name()
@@ -1736,6 +1757,7 @@ class TestVolumes(CephFSTestCase):
         # remove group
         self._fs_cmd("subvolumegroup", "rm", self.volname, group)
 
+    @unittest.skip("skipping subvolumegroup snapshot tests")
     def test_nonexistent_subvolume_group_snapshot_rm(self):
         subvolume = self._generate_random_subvolume_name()
         group = self._generate_random_group_name()
@@ -1771,6 +1793,7 @@ class TestVolumes(CephFSTestCase):
         # remove group
         self._fs_cmd("subvolumegroup", "rm", self.volname, group)
 
+    @unittest.skip("skipping subvolumegroup snapshot tests")
     def test_subvolume_group_snapshot_rm_force(self):
         # test removing non-existing subvolume group snapshot with --force
         group = self._generate_random_group_name()
@@ -1781,6 +1804,7 @@ class TestVolumes(CephFSTestCase):
         except CommandFailedError:
             raise RuntimeError("expected the 'fs subvolumegroup snapshot rm --force' command to succeed")
 
+    @unittest.skip("skipping subvolumegroup snapshot tests")
     def test_subvolume_group_snapshot_ls(self):
         # tests the 'fs subvolumegroup snapshot ls' command
 
index bc621bd88b5ce3b8e05972539dcada4db8d76687..9f2a277ca107a1a127864cb54eede8de7b9df990 100644 (file)
@@ -569,15 +569,18 @@ class VolumeClient(CephfsClient):
     ### group snapshot
 
     def create_subvolume_group_snapshot(self, **kwargs):
-        ret       = 0, "", ""
+        ret       = -errno.ENOSYS, "", "subvolume group snapshots are not supported"
         volname   = kwargs['vol_name']
         groupname = kwargs['group_name']
-        snapname  = kwargs['snap_name']
+        snapname  = kwargs['snap_name']
 
         try:
             with open_volume(self, volname) as fs_handle:
                 with open_group(fs_handle, self.volspec, groupname) as group:
-                    group.create_snapshot(snapname)
+                    # as subvolumes are marked with the vxattr ceph.dir.subvolume deny snapshots
+                    # at the subvolume group (see: https://tracker.ceph.com/issues/46074)
+                    # group.create_snapshot(snapname)
+                    pass
         except VolumeException as ve:
             ret = self.volume_exception_to_retval(ve)
         return ret