From b9d1e96fba143f31c79844fcb99d976cb66f3f46 Mon Sep 17 00:00:00 2001 From: Omid Yoosefi Date: Wed, 29 Jan 2025 11:33:49 -0500 Subject: [PATCH] pybind/mgr/cephadm: fix issue with multiple nfs clusters on the same port Currently even if ingress and virtual_ip are used, the port_in_use check in cephadm fails when the same port is used. This PR fixes the issue by ensuring that the daemon spec includes the virtual ip address for the endpoint to be checked is included so it doesn't default to checking `0.0.0.0:port` only. Fixes: https://tracker.ceph.com/issues/69744 Signed-off-by: Omid Yoosefi --- src/pybind/mgr/cephadm/services/nfs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/cephadm/services/nfs.py b/src/pybind/mgr/cephadm/services/nfs.py index 74ecfb486bdaa..aa2a12fd6c2a5 100644 --- a/src/pybind/mgr/cephadm/services/nfs.py +++ b/src/pybind/mgr/cephadm/services/nfs.py @@ -97,11 +97,14 @@ class NFSService(CephService): # create the rados config object self.create_rados_config_obj(spec) + port = daemon_spec.ports[0] if daemon_spec.ports else 2049 + # create the RGW keyring rgw_user = f'{rados_user}-rgw' rgw_keyring = self.create_rgw_keyring(daemon_spec) if spec.virtual_ip: bind_addr = spec.virtual_ip + daemon_spec.port_ips = {str(port): spec.virtual_ip} else: bind_addr = daemon_spec.ip if daemon_spec.ip else '' if not bind_addr: @@ -119,7 +122,7 @@ class NFSService(CephService): "rgw_user": rgw_user, "url": f'rados://{POOL_NAME}/{spec.service_id}/{spec.rados_config_name()}', # fall back to default NFS port if not present in daemon_spec - "port": daemon_spec.ports[0] if daemon_spec.ports else 2049, + "port": port, "monitoring_port": spec.monitoring_port if spec.monitoring_port else 9587, "bind_addr": bind_addr, "haproxy_hosts": [], -- 2.39.5