mirror of
https://github.com/ceph/ceph
synced 2024-12-29 15:03:33 +00:00
Merge pull request #42400 from adk3798/offline-daemon-removal
mgr/cephadm: don't remove daemons from offline hosts Reviewed-by: Daniel Pivonka <dpivonka@redhat.com>
This commit is contained in:
commit
84425c8de6
@ -1390,6 +1390,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
|
||||
if (
|
||||
self.cache.host_had_daemon_refresh(h.hostname)
|
||||
and h.status.lower() not in ['maintenance', 'offline']
|
||||
and h.hostname not in self.offline_hosts
|
||||
and '_no_schedule' not in h.labels
|
||||
)
|
||||
]
|
||||
|
@ -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' % (
|
||||
|
@ -1108,7 +1108,7 @@ spec:
|
||||
assert len(cephadm_module.cache.get_daemons_by_type('mgr')) == 3
|
||||
|
||||
# put one host in offline state and one host in maintenance state
|
||||
cephadm_module.inventory._inventory['test2']['status'] = 'offline'
|
||||
cephadm_module.offline_hosts = {'test2'}
|
||||
cephadm_module.inventory._inventory['test3']['status'] = 'maintenance'
|
||||
cephadm_module.inventory.save()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user