From 80f72fa7f384d6dc4e486d5eb74f99be4235ef17 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 5 Nov 2019 08:39:16 -0600 Subject: [PATCH] mgr/ssh: add 'osd rm' Signed-off-by: Sage Weil --- doc/mgr/orchestrator_cli.rst | 2 +- src/pybind/mgr/ssh/module.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/mgr/orchestrator_cli.rst b/doc/mgr/orchestrator_cli.rst index 9309366bc81e..80cf9d3d2d15 100644 --- a/doc/mgr/orchestrator_cli.rst +++ b/doc/mgr/orchestrator_cli.rst @@ -301,7 +301,7 @@ This is an overview of the current implementation status of the orchestrators. mon update ⚪ ✔ ⚪ ✔ osd create ✔ ✔ ⚪ ✔ osd device {ident,fault}-{on,off} ⚪ ⚪ ⚪ ⚪ - osd rm ✔ ⚪ ⚪ ⚪ + osd rm ✔ ⚪ ⚪ ✔ device {ident,fault}-(on,off} ⚪ ⚪ ⚪ ⚪ device ls ✔ ✔ ✔ ✔ service ls ⚪ ✔ ✔ ✔ diff --git a/src/pybind/mgr/ssh/module.py b/src/pybind/mgr/ssh/module.py index e276222afed5..336a9b75b042 100644 --- a/src/pybind/mgr/ssh/module.py +++ b/src/pybind/mgr/ssh/module.py @@ -741,6 +741,17 @@ class SSHOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): return SSHWriteCompletion(result) + def remove_osds(self, name): + daemons = self._get_services('osd', service_id=name) + results = [] + for d in daemons: + results.append(self._worker_pool.apply_async( + self._remove_daemon, + ('osd.%s' % d.service_instance, d.nodename))) + if not results: + raise OrchestratorError('Unable to find osd.%s' % name) + return SSHWriteCompletion(results) + def _create_daemon(self, daemon_type, daemon_id, host, keyring, extra_args=[]): conn = self._get_connection(host) -- 2.47.3