From: Sage Weil Date: Tue, 5 Nov 2019 14:39:16 +0000 (-0600) Subject: mgr/ssh: add 'osd rm' X-Git-Tag: v15.1.0~1020^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F31385%2Fhead;p=ceph.git mgr/ssh: add 'osd rm' Signed-off-by: Sage Weil --- 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)