From: Adam King Date: Fri, 23 Jul 2021 14:01:54 +0000 (-0400) Subject: mgr/cephadm: Don't allow stopping full mgr, mon or osd services X-Git-Tag: v16.2.6~54^2~33 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4df6c4a7b583b452fa2a9f7b319a6ea53742687b;p=ceph.git mgr/cephadm: Don't allow stopping full mgr, mon or osd services I can't think of any case where we would want to allow this Fixes: https://tracker.ceph.com/issues/51298 Signed-off-by: Adam King (cherry picked from commit 6402c587d006f8e179f01ec2007828bb5fbf5489) --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index ac3307a6f588..54c65f361ee6 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1845,6 +1845,8 @@ Then run the following: if not dds: raise OrchestratorError(f'No daemons exist under service name "{service_name}".' + ' View currently running services using "ceph orch ls"') + if action == 'stop' and service_name.split('.')[0].lower() in ['mgr', 'mon', 'osd']: + return [f'Stopping entire {service_name} service is prohibited.'] self.log.info('%s service %s' % (action.capitalize(), service_name)) return [ self._schedule_daemon_action(dd.name(), action)