From: Sage Weil Date: Mon, 9 Mar 2020 18:21:20 +0000 (-0500) Subject: mgr/cephadm: safety check to prevent removing all mon|mgr daemons X-Git-Tag: v15.1.1~37^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9b96921857b886a5ce87fd5dc7a9c8576294cf52;p=ceph.git mgr/cephadm: safety check to prevent removing all mon|mgr daemons Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 7b464d262604..74dd2f32d63b 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -2204,6 +2204,11 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): r = False + # sanity check + if daemon_type in ['mon', 'mgr'] and len(hosts) < 1: + self.log.debug('cannot scale mon|mgr below 1 (hosts=%s)' % hosts) + return False + # add any? did_config = False hosts_with_daemons = {d.hostname for d in daemons}