From b3816342a4e1bed6927ae4ce8c39f3b5ce69e8b9 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 12 Feb 2020 14:56:44 -0600 Subject: [PATCH] mgr/orch: add 'daemon add mgr' Signed-off-by: Sage Weil --- src/pybind/mgr/orchestrator.py | 5 +++++ src/pybind/mgr/orchestrator_cli/module.py | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/pybind/mgr/orchestrator.py b/src/pybind/mgr/orchestrator.py index 2c21ed518b9b2..268c475f9e3e6 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 9e07c10905160..ff97221c483a2 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 " -- 2.39.5