From: Sage Weil Date: Wed, 12 Feb 2020 20:56:44 +0000 (-0600) Subject: mgr/orch: add 'daemon add mgr' X-Git-Tag: v15.1.1~425^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b3816342a4e1bed6927ae4ce8c39f3b5ce69e8b9;p=ceph.git mgr/orch: add 'daemon add mgr' Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/orchestrator.py b/src/pybind/mgr/orchestrator.py index 2c21ed518b9b..268c475f9e3e 100644 --- a/src/pybind/mgr/orchestrator.py +++ b/src/pybind/mgr/orchestrator.py @@ -960,6 +960,11 @@ class Orchestrator(object): """ raise NotImplementedError() + def add_mgr(self, spec): + # type: (ServiceSpec) -> Completion + """Create a new mgr daemon""" + raise NotImplementedError() + def add_mds(self, spec): # type: (ServiceSpec) -> Completion """Create a new MDS cluster""" diff --git a/src/pybind/mgr/orchestrator_cli/module.py b/src/pybind/mgr/orchestrator_cli/module.py index 9e07c1090516..ff97221c483a 100644 --- a/src/pybind/mgr/orchestrator_cli/module.py +++ b/src/pybind/mgr/orchestrator_cli/module.py @@ -387,6 +387,19 @@ Usage: orchestrator.raise_if_exception(completion) return HandleCommandResult(stdout=completion.result_str()) + @orchestrator._cli_write_command( + 'orch daemon add mgr', + "name=num,type=CephInt,req=false " + "name=hosts,type=CephString,n=N,req=false", + 'Start rbd-mirror daemon(s)') + def _daemon_add_mgr(self, num=None, hosts=None): + spec = orchestrator.ServiceSpec( + placement=orchestrator.PlacementSpec(hosts=hosts, count=num)) + completion = self.add_mgr(spec) + self._orchestrator_wait([completion]) + orchestrator.raise_if_exception(completion) + return HandleCommandResult(stdout=completion.result_str()) + @orchestrator._cli_write_command( 'orch daemon add rbd-mirror', "name=num,type=CephInt,req=false "