]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: stop removal of daemons from offline hosts
authorAdam King <adking@redhat.com>
Mon, 19 Jul 2021 16:07:39 +0000 (12:07 -0400)
committerSebastian Wagner <sewagner@redhat.com>
Tue, 10 Aug 2021 14:32:17 +0000 (16:32 +0200)
This check was only looking for the status of the
host and not looking at the offline_hosts set so
it wasn't actually stopping daemons from being removed
from offline hosts

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

src/pybind/mgr/cephadm/serve.py

index 420b560fc1321af7dbd16152f582ee9dc338d9e4..b36d24c991d8bcee06efcf6085ae739af0767188 100644 (file)
@@ -692,7 +692,7 @@ class CephadmServe:
         try:
             all_slots, slots_to_add, daemons_to_remove = ha.place()
             daemons_to_remove = [d for d in daemons_to_remove if (d.hostname and self.mgr.inventory._inventory[d.hostname].get(
-                'status', '').lower() not in ['maintenance', 'offline'])]
+                'status', '').lower() not in ['maintenance', 'offline'] and d.hostname not in self.mgr.offline_hosts)]
             self.log.debug('Add %s, remove %s' % (slots_to_add, daemons_to_remove))
         except OrchestratorError as e:
             self.log.error('Failed to apply %s spec %s: %s' % (