From: Anoop C S Date: Fri, 7 Mar 2025 11:28:04 +0000 (+0530) Subject: mgr/smb: Add ceph_snapshots vfs module to share definition X-Git-Tag: v20.3.0~318^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cf0e9308836b24d6f3f51c4f2fa72ff5e99eb77e;p=ceph.git mgr/smb: Add ceph_snapshots vfs module to share definition In order to expose and manage snapshots as previous versions from Windows we make use of the existing ceph_snapshots vfs module from Samba. vfs_ceph_snapshots by default assumes the snap directory to be named ".snap" with an option to configure a different name to match the value for 'client_snapdir' parameter for CephFS client. We follow the default behaviour to avoid further complications on a live running cluster and thereby recommend to keep the default for 'client_snapdir'. This limitation may slightly change in future to dynamically detect the current snap directory name while shares are created and not afterwards. ref: https://www.samba.org/samba/docs/current/man-html/vfs_ceph_snapshots.8.html Signed-off-by: Anoop C S --- diff --git a/qa/suites/orch/cephadm/smb/tasks/deploy_smb_basic.yaml b/qa/suites/orch/cephadm/smb/tasks/deploy_smb_basic.yaml index f4d8ac2ab5c..d92ccad96f2 100644 --- a/qa/suites/orch/cephadm/smb/tasks/deploy_smb_basic.yaml +++ b/qa/suites/orch/cephadm/smb/tasks/deploy_smb_basic.yaml @@ -43,7 +43,7 @@ tasks: globals = ["default", "domain"] instance_name = "SAMBA" [shares.share1.options] - "vfs objects" = "acl_xattr ceph" + "vfs objects" = "acl_xattr ceph_snapshots ceph" path = "/" "acl_xattr:security_acl_name" = "user.NTACL" "ceph:config_file" = "/etc/ceph/ceph.conf" diff --git a/qa/suites/orch/cephadm/smb/tasks/deploy_smb_domain.yaml b/qa/suites/orch/cephadm/smb/tasks/deploy_smb_domain.yaml index a0c85249dd8..c8c91f908df 100644 --- a/qa/suites/orch/cephadm/smb/tasks/deploy_smb_domain.yaml +++ b/qa/suites/orch/cephadm/smb/tasks/deploy_smb_domain.yaml @@ -42,7 +42,7 @@ tasks: globals = ["default", "domain"] instance_name = "SAMBA" [shares.share1.options] - "vfs objects" = "acl_xattr ceph" + "vfs objects" = "acl_xattr ceph_snapshots ceph" path = "/" "acl_xattr:security_acl_name" = "user.NTACL" "ceph:config_file" = "/etc/ceph/ceph.conf" diff --git a/src/pybind/mgr/smb/handler.py b/src/pybind/mgr/smb/handler.py index 3df4b05fc58..e0dc9518902 100644 --- a/src/pybind/mgr/smb/handler.py +++ b/src/pybind/mgr/smb/handler.py @@ -1187,7 +1187,7 @@ def _generate_share( # smb.conf options 'options': { 'path': path, - "vfs objects": f"acl_xattr {ceph_vfs}", + "vfs objects": f"acl_xattr ceph_snapshots {ceph_vfs}", 'acl_xattr:security_acl_name': 'user.NTACL', f'{ceph_vfs}:config_file': '/etc/ceph/ceph.conf', f'{ceph_vfs}:filesystem': cephfs.volume,