]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: skip `port_in_use` during redeploy
authorMichael Fritch <mfritch@suse.com>
Mon, 18 May 2020 21:40:39 +0000 (15:40 -0600)
committerMichael Fritch <mfritch@suse.com>
Mon, 18 May 2020 23:27:59 +0000 (17:27 -0600)
skip the `port_in_use` check during reconfig/redeploy
of the monitoring components and nfs-ganesha

Signed-off-by: Michael Fritch <mfritch@suse.com>
src/cephadm/cephadm

index dbf9cef977c1c3f828905f04058e627938dce54d..b549b28f3fd5c47a15de39cc5d436718f4bc416b 100755 (executable)
@@ -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) ?