From c353b788ebe41d0ddb76e2c764d852d2ef475b63 Mon Sep 17 00:00:00 2001 From: Adam King Date: Wed, 29 Jan 2025 12:02:50 -0500 Subject: [PATCH] mgr/cephadm: add Server_Scope = to NFSv4 section of ganesha conf From the ganesha team """ In the NFSv4 param block, we need a parameter Server_Scope set to some value common among all servers in a cluster. The default with it blank is to use the hostname which may be different for each server in the cluster. """ This is related to ongoing work on high availability nfs. From the cephadm side we just need to make sure all nfs daemons in the cluster end up with the same value for the Server_Scope field. This patch uses the cluster id (which we already brought into the template as the "namespace" attribute) Signed-off-by: Adam King --- src/pybind/mgr/cephadm/services/nfs.py | 1 + src/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2 | 1 + src/pybind/mgr/cephadm/tests/test_services.py | 1 + 3 files changed, 3 insertions(+) diff --git a/src/pybind/mgr/cephadm/services/nfs.py b/src/pybind/mgr/cephadm/services/nfs.py index 89a977c4624df..2701233d3af4e 100644 --- a/src/pybind/mgr/cephadm/services/nfs.py +++ b/src/pybind/mgr/cephadm/services/nfs.py @@ -122,6 +122,7 @@ class NFSService(CephService): "haproxy_hosts": [], "nfs_idmap_conf": nfs_idmap_conf, "enable_nlm": str(spec.enable_nlm).lower(), + "cluster_id": self.mgr._cluster_fsid, } if spec.enable_haproxy_protocol: context["haproxy_hosts"] = self._haproxy_hosts() diff --git a/src/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2 b/src/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2 index b85ccd7b7fbad..136b1fa8668dc 100644 --- a/src/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2 +++ b/src/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2 @@ -19,6 +19,7 @@ NFSv4 { Delegations = false; RecoveryBackend = 'rados_cluster'; Minor_Versions = 1, 2; + Server_Scope = {{ cluster_id }}-{{ namespace }} {% if nfs_idmap_conf %} IdmapConf = "{{ nfs_idmap_conf }}"; {% endif %} diff --git a/src/pybind/mgr/cephadm/tests/test_services.py b/src/pybind/mgr/cephadm/tests/test_services.py index 36c2121e29a43..4d8a2a8442322 100644 --- a/src/pybind/mgr/cephadm/tests/test_services.py +++ b/src/pybind/mgr/cephadm/tests/test_services.py @@ -3292,6 +3292,7 @@ class TestIngressService: ' Delegations = false;\n' " RecoveryBackend = 'rados_cluster';\n" ' Minor_Versions = 1, 2;\n' + f' Server_Scope = {cephadm_module._cluster_fsid}-foo\n' ' IdmapConf = "/etc/ganesha/idmap.conf";\n' '}\n' '\n' -- 2.39.5