From: Adam King Date: Wed, 29 Jan 2025 17:02:50 +0000 (-0500) Subject: mgr/cephadm: add Server_Scope = to NFSv4 section of ganesha conf X-Git-Tag: testing/wip-pdonnell-testing-20250205.170831-debug~5^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c353b788ebe41d0ddb76e2c764d852d2ef475b63;p=ceph-ci.git 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 --- diff --git a/src/pybind/mgr/cephadm/services/nfs.py b/src/pybind/mgr/cephadm/services/nfs.py index 89a977c4624..2701233d3af 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 b85ccd7b7fb..136b1fa8668 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 36c2121e29a..4d8a2a84423 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'