From: Adam King Date: Wed, 23 Sep 2020 16:52:37 +0000 (-0400) Subject: mgr/cephadm: get rbd-mirror daemon-id when checking for strays X-Git-Tag: v16.1.0~957^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F37397%2Fhead;p=ceph.git mgr/cephadm: get rbd-mirror daemon-id when checking for strays Currently, list_servers() gets the rbd-mirror service-id instead of the daemon-id so the daemon is marked as stray. This PR uses that service-id to find the daemon-id and uses that to check if the daemon is stray. Fixes: https://tracker.ceph.com/issues/47639 Signed-off-by: Adam King --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index a36a2206500..2681fbfac5a 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -467,6 +467,14 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, missing_names = [] for s in daemons: name = '%s.%s' % (s.get('type'), s.get('id')) + if s.get('type') == 'rbd-mirror': + defaults = defaultdict(lambda: None, {'id': None}) + metadata = self.get_metadata("rbd-mirror", s.get('id'), default=defaults) + if metadata['id']: + name = '%s.%s' % (s.get('type'), metadata['id']) + else: + self.log.debug( + "Failed to find daemon id for rbd-mirror service %s" % (s.get('id'))) if host not in self.inventory: missing_names.append(name) host_num_daemons += 1