]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: get rbd-mirror daemon-id when checking for strays
authorAdam King <adking@redhat.com>
Wed, 23 Sep 2020 16:52:37 +0000 (12:52 -0400)
committerSebastian Wagner <sebastian.wagner@suse.com>
Wed, 18 Nov 2020 10:51:52 +0000 (11:51 +0100)
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 <adking@redhat.com>
(cherry picked from commit 83d878f3d94a31c03ce94788236bd584c878a89c)

src/pybind/mgr/cephadm/module.py

index f54384313811334c3b539aab3a2e0a539f319b43..3b2266626808336343aa4303a4f5efaeb63dfc81 100644 (file)
@@ -468,6 +468,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