]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: Allows enabling NFS Ganesha NLM 56909/head
authorTeoman ONAY <tonay@ibm.com>
Tue, 26 Mar 2024 08:34:16 +0000 (09:34 +0100)
committerAdam King <adking@redhat.com>
Mon, 15 Apr 2024 18:01:24 +0000 (14:01 -0400)
Enable_NLM was harcoded to "false" which prevented enabling file
locking. It can now be enabled using enable_nlm in spec file

Fixes: https://tracker.ceph.com/issues/65144
Signed-off-by: Teoman ONAY <tonay@ibm.com>
(cherry picked from commit 29331919df222e136ce7b0788376859b3a9cb2aa)

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
src/python-common/ceph/deployment/service_spec.py

index e0c61b117e7ebcd808d7f0e7735d138d25933adc..f46f65b084beaeb3da97ac6665ba34f99da2e7ca 100644 (file)
@@ -120,6 +120,7 @@ class NFSService(CephService):
                 "bind_addr": bind_addr,
                 "haproxy_hosts": [],
                 "nfs_idmap_conf": nfs_idmap_conf,
+                "enable_nlm": str(spec.enable_nlm).lower(),
             }
             if spec.enable_haproxy_protocol:
                 context["haproxy_hosts"] = self._haproxy_hosts()
index 7bc0278d7ed12b448c2288a562f1e57beebe099d..ded403169c976e68bee5e4c8185cae475719d5af 100644 (file)
@@ -1,6 +1,6 @@
 # {{ cephadm_managed }}
 NFS_CORE_PARAM {
-        Enable_NLM = false;
+        Enable_NLM = {{ enable_nlm }};
         Enable_RQUOTA = false;
         Protocols = 4;
         NFS_Port = {{ port }};
index 1265a39f69055d4f998aee30a3251ab27f4e9720..257bf147f292ee5056a11e78a8b428c14454f36d 100644 (file)
@@ -2376,6 +2376,7 @@ class TestIngressService:
                 hosts=['host1', 'host2']),
             port=12049,
             enable_haproxy_protocol=True,
+            enable_nlm=True,
         )
 
         ispec = IngressSpec(
@@ -2445,7 +2446,7 @@ class TestIngressService:
         nfs_ganesha_txt = (
             "# This file is generated by cephadm.\n"
             'NFS_CORE_PARAM {\n'
-            '        Enable_NLM = false;\n'
+            '        Enable_NLM = true;\n'
             '        Enable_RQUOTA = false;\n'
             '        Protocols = 4;\n'
             '        NFS_Port = 2049;\n'
index 704dfe6f01b1a7cc54ec7010306b9fb89bf179da..df021e23d0a1235841a541c5f1091e48f9a62b87 100644 (file)
@@ -1067,6 +1067,7 @@ class NFSServiceSpec(ServiceSpec):
                  networks: Optional[List[str]] = None,
                  port: Optional[int] = None,
                  virtual_ip: Optional[str] = None,
+                 enable_nlm: bool = False,
                  extra_container_args: Optional[GeneralArgList] = None,
                  extra_entrypoint_args: Optional[GeneralArgList] = None,
                  enable_haproxy_protocol: bool = False,
@@ -1084,6 +1085,7 @@ class NFSServiceSpec(ServiceSpec):
         self.virtual_ip = virtual_ip
         self.enable_haproxy_protocol = enable_haproxy_protocol
         self.idmap_conf = idmap_conf
+        self.enable_nlm = enable_nlm
 
     def get_port_start(self) -> List[int]:
         if self.port: