]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: add Server_Scope = <fsid> to NFSv4 section of ganesha conf 61571/head
authorAdam King <adking@redhat.com>
Wed, 29 Jan 2025 17:02:50 +0000 (12:02 -0500)
committerAdam King <adking@redhat.com>
Thu, 30 Jan 2025 20:39:42 +0000 (15:39 -0500)
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 <adking@redhat.com>
src/pybind/mgr/cephadm/services/nfs.py
src/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2
src/pybind/mgr/cephadm/tests/test_services.py

index 89a977c4624df3acf2a2d05c9af2f3a90a0474b6..2701233d3af4e432bb5d286cb3661c27a616c956 100644 (file)
@@ -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()
index b85ccd7b7fbadd8e20efb1336f3067ce7583cd67..136b1fa8668dc1764e14fadde1d10adcf18885dd 100644 (file)
@@ -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 %}
index 36c2121e29a4345320b5b15245a7d5a8511885db..4d8a2a8442322393e5cb131fbc892c752b1e0b00 100644 (file)
@@ -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'