From: Michael Fritch Date: Mon, 18 May 2020 21:40:39 +0000 (-0600) Subject: cephadm: skip `port_in_use` during redeploy X-Git-Tag: v17.0.0~2319^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c85a34aaa70aca55a79e11396b57b31ded14d0b3;p=ceph.git cephadm: skip `port_in_use` during redeploy skip the `port_in_use` check during reconfig/redeploy of the monitoring components and nfs-ganesha Signed-off-by: Michael Fritch --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index dbf9cef977c1c..b549b28f3fd5c 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -2681,6 +2681,12 @@ def command_deploy(): if daemon_type not in get_supported_daemons(): raise Error('daemon type %s not recognized' % daemon_type) + redeploy = False + unit_name = get_unit_name(args.fsid, daemon_type, daemon_id) + (_, state, _) = check_unit(unit_name) + if state == 'running': + redeploy = True + logger.info('Deploying daemon %s.%s ...' % (daemon_type, daemon_id)) if daemon_type in Ceph.daemons: @@ -2699,7 +2705,7 @@ def command_deploy(): monitoring_args = [] # type: List[str] # Default Checks - if not args.reconfig: + if not args.reconfig and not redeploy: daemon_ports = Monitoring.port_map[daemon_type] # type: List[int] if any([port_in_use(port) for port in daemon_ports]): raise Error("TCP Port(s) '{}' required for {} is already in use".format(",".join(map(str, daemon_ports)), daemon_type)) @@ -2724,7 +2730,7 @@ def command_deploy(): reconfig=args.reconfig) elif daemon_type == NFSGanesha.daemon_type: - if not args.reconfig: + if not args.reconfig and not redeploy: NFSGanesha.port_in_use() (config, keyring) = get_config_and_keyring() # TODO: extract ganesha uid/gid (997, 994) ?