]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: default status for daemons on maintenance hosts to stopped
authorAdam King <adking@redhat.com>
Wed, 14 Apr 2021 20:07:46 +0000 (16:07 -0400)
committerSage Weil <sage@newdream.net>
Tue, 4 May 2021 16:19:18 +0000 (11:19 -0500)
we do not refresh the daemons on maintenance hosts so our info
on them is always outdated. Therefore, the best option is to
assume maintenance mode is working correctly and the daemons
are stopped

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 56641742a75bc753b473209b63fcefabcde7615b)

src/pybind/mgr/cephadm/inventory.py

index df9381a3dcdf9c675665e823c003b478e7026e26..89fe71584a6377197139ffb94c92a1fcbdf5fddf 100644 (file)
@@ -530,6 +530,11 @@ class HostCache():
             if host in self.mgr.offline_hosts:
                 dd.status = orchestrator.DaemonDescriptionStatus.error
                 dd.status_desc = 'host is offline'
+            elif self.mgr.inventory._inventory[host].get("status", "").lower() == "maintenance":
+                # We do not refresh daemons on hosts in maintenance mode, so stored daemon statuses
+                # could be wrong. We must assume maintenance is working and daemons are stopped
+                dd.status = orchestrator.DaemonDescriptionStatus.stopped
+                dd.status_desc = 'stopped'
             dd.events = self.mgr.events.get_for_daemon(dd.name())
             return dd