Skip to content

Commit b9d1e96

Browse files
author
Omid Yoosefi
committed
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 <[email protected]>
1 parent 470fb04 commit b9d1e96

File tree

1 file changed

+4
-1
lines changed
  • src/pybind/mgr/cephadm/services

1 file changed

+4
-1
lines changed

src/pybind/mgr/cephadm/services/nfs.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,14 @@ def generate_config(self, daemon_spec: CephadmDaemonDeploySpec) -> Tuple[Dict[st
9797
# create the rados config object
9898
self.create_rados_config_obj(spec)
9999

100+
port = daemon_spec.ports[0] if daemon_spec.ports else 2049
101+
100102
# create the RGW keyring
101103
rgw_user = f'{rados_user}-rgw'
102104
rgw_keyring = self.create_rgw_keyring(daemon_spec)
103105
if spec.virtual_ip:
104106
bind_addr = spec.virtual_ip
107+
daemon_spec.port_ips = {str(port): spec.virtual_ip}
105108
else:
106109
bind_addr = daemon_spec.ip if daemon_spec.ip else ''
107110
if not bind_addr:
@@ -119,7 +122,7 @@ def get_ganesha_conf() -> str:
119122
"rgw_user": rgw_user,
120123
"url": f'rados://{POOL_NAME}/{spec.service_id}/{spec.rados_config_name()}',
121124
# fall back to default NFS port if not present in daemon_spec
122-
"port": daemon_spec.ports[0] if daemon_spec.ports else 2049,
125+
"port": port,
123126
"monitoring_port": spec.monitoring_port if spec.monitoring_port else 9587,
124127
"bind_addr": bind_addr,
125128
"haproxy_hosts": [],

0 commit comments

Comments
 (0)