]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: Allows enabling NFS Ganesha NLM 56901/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 15:23:01 +0000 (11:23 -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 be92ae7c874ec7a7f7ca2fd591c4f85b60dc57df..5d86e53ca51a5d443634443b75431405a1e55019 100644 (file)
@@ -2430,6 +2430,7 @@ class TestIngressService:
                 hosts=['host1', 'host2']),
             port=12049,
             enable_haproxy_protocol=True,
+            enable_nlm=True,
         )
 
         ispec = IngressSpec(
@@ -2499,7 +2500,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 55548076a1cea4aa225e8d4b29ddba01c8bf579e..259a16287a401e86446508a996a2fa8e4fa4934e 100644 (file)
@@ -1091,6 +1091,7 @@ class NFSServiceSpec(ServiceSpec):
                  networks: Optional[List[str]] = None,
                  port: Optional[int] = None,
                  virtual_ip: Optional[str] = None,
+                 enable_nlm: bool = False,
                  enable_haproxy_protocol: bool = False,
                  extra_container_args: Optional[GeneralArgList] = None,
                  extra_entrypoint_args: Optional[GeneralArgList] = None,
@@ -1108,6 +1109,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: