]> git-server-git.apps.pok.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>
Thu, 28 Jan 2021 15:17:19 +0000 (10:17 -0500)
Fixes: https://tracker.ceph.com/issues/47154
Signed-off-by: Shyamsundar Ranganathan <srangana@redhat.com>
(cherry picked from commit f97e57c28c7fa7685b853e9f7f7e23267739a6c0)

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 16bba5e27b4a874fc96548fc8c62617b2f54df41..dd38e38e419bb7e6e8818314b352976f70f7e881 100644 (file)
@@ -111,12 +111,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 96ba02eec1cc956c04183b7e61bf5722ea4ac525..24572b7550ff7b2a7e42e16ffcd056836f8a12af 100644 (file)
@@ -6,6 +6,7 @@ import random
 import logging
 import collections
 import uuid
+import unittest
 from hashlib import md5
 from textwrap import dedent
 
@@ -1689,6 +1690,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()
@@ -1715,6 +1735,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()
@@ -1744,6 +1765,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()
@@ -1779,6 +1801,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()
@@ -1789,6 +1812,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 784589be70a345bd615fa02eb39e378866889046..7e20ca9a9546696d07d7aac633424cbf1bf852c1 100644 (file)
@@ -566,15 +566,18 @@ class VolumeClient(object):
     ### 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