]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: Don't allow stopping full mgr, mon or osd services
authorAdam King <adking@redhat.com>
Fri, 23 Jul 2021 14:01:54 +0000 (10:01 -0400)
committerSebastian Wagner <sewagner@redhat.com>
Tue, 10 Aug 2021 14:32:14 +0000 (16:32 +0200)
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 <adking@redhat.com>
(cherry picked from commit 6402c587d006f8e179f01ec2007828bb5fbf5489)

src/pybind/mgr/cephadm/module.py

index ac3307a6f5882bddea58a3635e22c508f6cc5f8f..54c65f361ee6649fe441038e3e387b804fe71618 100644 (file)
@@ -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)