From: Adam King Date: Wed, 14 Apr 2021 20:07:46 +0000 (-0400) Subject: mgr/cephadm: default status for daemons on maintenance hosts to stopped X-Git-Tag: v16.2.5~39^2~4^2^2~27 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a2ca2eacfac8b6cb25f5b358fb865897ade9d525;p=ceph.git mgr/cephadm: default status for daemons on maintenance hosts to stopped 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 (cherry picked from commit 56641742a75bc753b473209b63fcefabcde7615b) --- diff --git a/src/pybind/mgr/cephadm/inventory.py b/src/pybind/mgr/cephadm/inventory.py index df9381a3dcdf9..89fe71584a637 100644 --- a/src/pybind/mgr/cephadm/inventory.py +++ b/src/pybind/mgr/cephadm/inventory.py @@ -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