From 71613e61fa66e3479693f61ce63732550f756e17 Mon Sep 17 00:00:00 2001 From: Adam King Date: Mon, 8 Feb 2021 14:55:45 -0500 Subject: [PATCH] cephadm: allow redeploy of daemons in error state if container running Signed-off-by: Adam King --- src/cephadm/cephadm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 1f3f92b4ebfae..faf9074eaced4 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -1972,6 +1972,13 @@ def check_units(ctx, units, enabler=None): return False +def is_container_running(ctx: CephadmContext, name: str) -> bool: + out, err, ret = call_throws(ctx, [ + ctx.container_path, 'ps', + '--format', '{{.Names}}']) + return name in out + + def get_legacy_config_fsid(cluster, legacy_dir=None): # type: (str, Optional[str]) -> Optional[str] config_file = '/etc/ceph/%s.conf' % cluster @@ -3970,8 +3977,9 @@ def command_deploy(ctx): redeploy = False unit_name = get_unit_name(ctx.fsid, daemon_type, daemon_id) + container_name = 'ceph-%s-%s.%s' % (ctx.fsid, daemon_type, daemon_id) (_, state, _) = check_unit(ctx, unit_name) - if state == 'running': + if state == 'running' or is_container_running(ctx, container_name): redeploy = True if ctx.reconfig: -- 2.39.5