From: Teoman ONAY Date: Tue, 26 Mar 2024 08:34:16 +0000 (+0100) Subject: mgr/cephadm: Allows enabling NFS Ganesha NLM X-Git-Tag: testing/wip-batrick-testing-20240411.154038~23^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=29331919df222e136ce7b0788376859b3a9cb2aa;p=ceph-ci.git mgr/cephadm: Allows enabling NFS Ganesha NLM 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 --- diff --git a/src/pybind/mgr/cephadm/services/nfs.py b/src/pybind/mgr/cephadm/services/nfs.py index e0c61b117e7..f46f65b084b 100644 --- a/src/pybind/mgr/cephadm/services/nfs.py +++ b/src/pybind/mgr/cephadm/services/nfs.py @@ -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() 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 7bc0278d7ed..ded403169c9 100644 --- a/src/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2 +++ b/src/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2 @@ -1,6 +1,6 @@ # {{ cephadm_managed }} NFS_CORE_PARAM { - Enable_NLM = false; + Enable_NLM = {{ enable_nlm }}; Enable_RQUOTA = false; Protocols = 4; NFS_Port = {{ port }}; diff --git a/src/pybind/mgr/cephadm/tests/test_services.py b/src/pybind/mgr/cephadm/tests/test_services.py index 48a9c3f0618..0434a79e4d4 100644 --- a/src/pybind/mgr/cephadm/tests/test_services.py +++ b/src/pybind/mgr/cephadm/tests/test_services.py @@ -2491,6 +2491,7 @@ class TestIngressService: hosts=['host1', 'host2']), port=12049, enable_haproxy_protocol=True, + enable_nlm=True, ) ispec = IngressSpec( @@ -2560,7 +2561,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' diff --git a/src/python-common/ceph/deployment/service_spec.py b/src/python-common/ceph/deployment/service_spec.py index 767e1e6f468..d55e874f8f7 100644 --- a/src/python-common/ceph/deployment/service_spec.py +++ b/src/python-common/ceph/deployment/service_spec.py @@ -1093,6 +1093,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, @@ -1110,6 +1111,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: