From: Omid Yoosefi Date: Wed, 29 Jan 2025 16:33:49 +0000 (-0500) Subject: pybind/mgr/cephadm: fix issue with multiple nfs clusters on the same port X-Git-Tag: testing/wip-rishabh-testing-20250207.203802~2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b9d1e96fba143f31c79844fcb99d976cb66f3f46;p=ceph-ci.git 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 --- diff --git a/src/pybind/mgr/cephadm/services/nfs.py b/src/pybind/mgr/cephadm/services/nfs.py index 74ecfb486bd..aa2a12fd6c2 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": [],