From cf0e9308836b24d6f3f51c4f2fa72ff5e99eb77e Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Fri, 7 Mar 2025 16:58:04 +0530 Subject: [PATCH] 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 --- qa/suites/orch/cephadm/smb/tasks/deploy_smb_basic.yaml | 2 +- qa/suites/orch/cephadm/smb/tasks/deploy_smb_domain.yaml | 2 +- src/pybind/mgr/smb/handler.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 f4d8ac2ab5c0..d92ccad96f25 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 a0c85249dd8f..c8c91f908df3 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 3df4b05fc587..e0dc95189025 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, -- 2.47.3