From 40aeac7f52c80df0daa99bb664e3d672da3bc249 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 6 Dec 2021 10:19:16 -0500 Subject: [PATCH] mgr/cephadm: allow activation of OSDs that have previously started When this code was introduced way back in ea987a0e56db106f7c76d11f86b3e602257f365e, for some reason I was focused only on freshly created OSDs. The get_osd_uuid_map() helper is used by deploy_osd_daemons_for_existing_osds() which is called not only by OSD creation but also by 'ceph cephadm osd activate', which is meant to instantiate daemons for existing OSD devices (e.g., devices that were reattached to a new server, or whose /var/lib/ceph/$fsid/osd.$id directory was lost for some other reason. However, if we ignore OSDs with up_from > 0, then we can't recreate a daemon instance for such existing OSDs--arguably the most important ones, since they may hold real data. Fixes: https://tracker.ceph.com/issues/53491 Signed-off-by: Sage Weil --- src/pybind/mgr/cephadm/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index b8cd31931ab..047bad8d12e 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -2125,7 +2125,7 @@ Then run the following: osd_id = o.get('osd') if osd_id is None: raise OrchestratorError("Could not retrieve osd_id from osd_map") - if not only_up or (o['up_from'] > 0): + if not only_up: r[str(osd_id)] = o.get('uuid', '') return r -- 2.39.5