From 07a74f570592270a21c18ca3754a2968408f37e9 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 11 Feb 2020 10:41:03 -0600 Subject: [PATCH] mgr/orch: remove old remove_{osds,rgw,mds,nfs,...} methods Signed-off-by: Sage Weil --- doc/mgr/orchestrator_cli.rst | 6 --- doc/mgr/orchestrator_modules.rst | 6 +-- src/pybind/mgr/cephadm/module.py | 56 ---------------------- src/pybind/mgr/orchestrator.py | 31 ------------ src/pybind/mgr/orchestrator_cli/module.py | 57 ----------------------- 5 files changed, 1 insertion(+), 155 deletions(-) diff --git a/doc/mgr/orchestrator_cli.rst b/doc/mgr/orchestrator_cli.rst index 5d6d033331e..2f3d1880ba7 100644 --- a/doc/mgr/orchestrator_cli.rst +++ b/doc/mgr/orchestrator_cli.rst @@ -301,26 +301,20 @@ This is an overview of the current implementation status of the orchestrators. mgr update ⚪ ✔ mon update ✔ ✔ osd create ✔ ✔ - osd rm ⚪ ✔ daemon status ⚪ ✔ daemon {stop,start,...} ⚪ ✔ device {ident,fault}-(on,off} ⚪ ✔ device ls ✔ ✔ iscsi add ⚪ ⚪ - iscsi rm ⚪ ⚪ iscsi update ⚪ ⚪ mds add ✔ ✔ - mds rm ✔ ✔ mds update ✔ ✔ nfs add ✔ ⚪ - nfs rm ✔ ⚪ nfs update ✔ ⚪ ps ⚪ ✔ rbd-mirror add ⚪ ✔ - rbd-mirror rm ⚪ ✔ rbd-mirror update ⚪ ✔ rgw add ✔ ✔ - rgw rm ✔ ✔ rgw update ⚪ ✔ service ls ✔ ⚪ =================================== ====== ========= diff --git a/doc/mgr/orchestrator_modules.rst b/doc/mgr/orchestrator_modules.rst index 9d6859e8fd9..78a9362c3c7 100644 --- a/doc/mgr/orchestrator_modules.rst +++ b/doc/mgr/orchestrator_modules.rst @@ -248,7 +248,6 @@ OSD management -------------- .. automethod:: Orchestrator.create_osds -.. automethod:: Orchestrator.remove_osds .. py:currentmodule:: ceph.deployment.drive_group @@ -274,7 +273,7 @@ See :ref:`rados-replacing-an-osd` for the underlying process. Replacing OSDs is fundamentally a two-staged process, as users need to physically replace drives. The orchestrator therefor exposes this two-staged process. -Phase one is a call to :meth:`Orchestrator.remove_osds` with ``destroy=True`` in order to mark +Phase one is a call to :meth:`Orchestrator.remove_daemons` with ``destroy=True`` in order to mark the OSD as destroyed. @@ -290,16 +289,13 @@ Stateless Services ------------------ .. automethod:: Orchestrator.add_mds -.. automethod:: Orchestrator.remove_mds .. automethod:: Orchestrator.update_mds .. automethod:: Orchestrator.add_rgw -.. automethod:: Orchestrator.remove_rgw .. automethod:: Orchestrator.update_rgw .. autoclass:: NFSServiceSpec .. automethod:: Orchestrator.add_nfs -.. automethod:: Orchestrator.remove_nfs .. automethod:: Orchestrator.update_nfs Upgrades diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index b7540a632d8..b48f092072c 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1669,18 +1669,6 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): return "Created osd(s) on host '{}'".format(host) - @with_daemons('osd') - def remove_osds(self, osd_ids, daemons): - # type: (List[str], List[orchestrator.DaemonDescription]) -> AsyncCompletion - args = [(d.name(), d.nodename) for d in daemons if - d.daemon_id in osd_ids] - - found = list(zip(*args))[0] if args else [] - not_found = {osd_id for osd_id in osd_ids if 'osd.%s' % osd_id not in found} - if not_found: - raise OrchestratorError('Unable to find OSD: %s' % not_found) - return self._remove_daemon(args) - def _create_daemon(self, daemon_type, daemon_id, host, keyring=None, extra_args=None, extra_config=None, @@ -2052,21 +2040,6 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): }) return self._create_daemon('mds', mds_id, host, keyring=keyring) - def remove_mds(self, name): - self.log.debug("Attempting to remove volume: {}".format(name)) - - def _remove_mds(daemons): - args = [] - for d in daemons: - if d.daemon_id == name or d.daemon_id.startswith(name + '.'): - args.append( - ('%s.%s' % (d.daemon_type, d.daemon_id), d.nodename) - ) - if not args: - raise OrchestratorError('Unable to find mds.%s[-*] daemon(s)' % name) - return self._remove_daemon(args) - return self._get_daemons('mds').then(_remove_mds) - def add_rgw(self, spec): if not spec.placement.hosts or len(spec.placement.hosts) < spec.count: raise RuntimeError("must specify at least %d hosts" % spec.count) @@ -2100,20 +2073,6 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): }) return self._create_daemon('rgw', rgw_id, host, keyring=keyring) - def remove_rgw(self, name): - - def _remove_rgw(daemons): - args = [] - for d in daemons: - if d.daemon_id == name or d.daemon_id.startswith(name + '.'): - args.append(('%s.%s' % (d.daemon_type, d.daemon_id), - d.nodename)) - if args: - return self._remove_daemon(args) - raise RuntimeError('Unable to find rgw.%s[-*] daemon(s)' % name) - - return self._get_daemons('rgw').then(_remove_rgw) - def update_rgw(self, spec): spec = NodeAssignment(spec=spec, get_hosts_func=self._get_hosts, service_type='rgw').load() return self._update_service('rgw', self.add_rgw, spec) @@ -2139,21 +2098,6 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): return self._create_daemon('rbd-mirror', daemon_id, host, keyring=keyring) - def remove_rbd_mirror(self, name): - def _remove_rbd_mirror(daemons): - args = [] - for d in daemons: - if not name or d.daemon_id == name: - args.append( - ('%s.%s' % (d.daemon_type, d.daemon_id), - d.nodename) - ) - if not args and name: - raise RuntimeError('Unable to find rbd-mirror.%s daemon' % name) - return self._remove_daemon(args) - - return self._get_daemons('rbd-mirror').then(_remove_rbd_mirror) - def update_rbd_mirror(self, spec): spec = NodeAssignment(spec=spec, get_hosts_func=self._get_hosts, service_type='rbd-mirror').load() return self._update_service('rbd-mirror', self.add_rbd_mirror, spec) diff --git a/src/pybind/mgr/orchestrator.py b/src/pybind/mgr/orchestrator.py index a3e7f8f5c98..623a8891067 100644 --- a/src/pybind/mgr/orchestrator.py +++ b/src/pybind/mgr/orchestrator.py @@ -940,17 +940,6 @@ class Orchestrator(object): """ raise NotImplementedError() - def remove_osds(self, osd_ids): - # type: (List[str]) -> Completion - """ - :param osd_ids: list of OSD IDs - :param destroy: marks the OSD as being destroyed. See :ref:`orchestrator-osd-replace` - - Note that this can only remove OSDs that were successfully - created (i.e. got an OSD ID). - """ - raise NotImplementedError() - def blink_device_light(self, ident_fault, on, locations): # type: (str, bool, List[DeviceLightLoc]) -> Completion """ @@ -987,11 +976,6 @@ class Orchestrator(object): """Create a new MDS cluster""" raise NotImplementedError() - def remove_mds(self, name): - # type: (str) -> Completion - """Remove an MDS cluster""" - raise NotImplementedError() - def update_mds(self, spec): # type: (ServiceSpec) -> Completion """ @@ -1005,11 +989,6 @@ class Orchestrator(object): """Create rbd-mirror cluster""" raise NotImplementedError() - def remove_rbd_mirror(self, name): - # type: (str) -> Completion - """Remove rbd-mirror cluster""" - raise NotImplementedError() - def update_rbd_mirror(self, spec): # type: (ServiceSpec) -> Completion """ @@ -1023,11 +1002,6 @@ class Orchestrator(object): """Create a new MDS cluster""" raise NotImplementedError() - def remove_nfs(self, name): - # type: (str) -> Completion - """Remove a NFS cluster""" - raise NotImplementedError() - def update_nfs(self, spec): # type: (NFSServiceSpec) -> Completion """ @@ -1041,11 +1015,6 @@ class Orchestrator(object): """Create a new MDS zone""" raise NotImplementedError() - def remove_rgw(self, zone): - # type: (str) -> Completion - """Remove a RGW zone""" - raise NotImplementedError() - def update_rgw(self, spec): # type: (RGWSpec) -> Completion """ diff --git a/src/pybind/mgr/orchestrator_cli/module.py b/src/pybind/mgr/orchestrator_cli/module.py index 93542f2f799..19a1ad1f60f 100644 --- a/src/pybind/mgr/orchestrator_cli/module.py +++ b/src/pybind/mgr/orchestrator_cli/module.py @@ -387,21 +387,6 @@ Usage: orchestrator.raise_if_exception(completion) return HandleCommandResult(stdout=completion.result_str()) - @orchestrator._cli_write_command( - 'orch osd rm', - "name=svc_id,type=CephString,n=N", - 'Remove OSD services') - def _osd_rm(self, svc_id): - # type: (List[str]) -> HandleCommandResult - """ - Remove OSD's - :cmd : Arguments for remove the osd - """ - completion = self.remove_osds(svc_id) - self._orchestrator_wait([completion]) - orchestrator.raise_if_exception(completion) - return HandleCommandResult(stdout=completion.result_str()) - @orchestrator._cli_write_command( 'orch rbd-mirror add', "name=num,type=CephInt,req=false " @@ -431,16 +416,6 @@ Usage: orchestrator.raise_if_exception(completion) return HandleCommandResult(stdout=completion.result_str()) - @orchestrator._cli_write_command( - 'orch rbd-mirror rm', - "name=name,type=CephString,req=false", - 'Remove rbd-mirror service or rbd-mirror service instance') - def _rbd_mirror_rm(self, name=None): - completion = self.remove_rbd_mirror(name) - self._orchestrator_wait([completion]) - orchestrator.raise_if_exception(completion) - return HandleCommandResult(stdout=completion.result_str()) - @orchestrator._cli_write_command( 'orch mds add', "name=fs_name,type=CephString " @@ -476,16 +451,6 @@ Usage: orchestrator.raise_if_exception(completion) return HandleCommandResult(stdout=completion.result_str()) - @orchestrator._cli_write_command( - 'orch mds rm', - "name=name,type=CephString", - 'Remove an MDS service (mds id or fs_name)') - def _mds_rm(self, name): - completion = self.remove_mds(name) - self._orchestrator_wait([completion]) - orchestrator.raise_if_exception(completion) - return HandleCommandResult(stdout=completion.result_str()) - @orchestrator._cli_write_command( 'orch rgw add', 'name=realm_name,type=CephString ' @@ -534,18 +499,6 @@ Usage: orchestrator.raise_if_exception(completion) return HandleCommandResult(stdout=completion.result_str()) - @orchestrator._cli_write_command( - 'orch rgw rm', - 'name=realm_name,type=CephString ' - 'name=zone_name,type=CephString', - 'Remove an RGW service') - def _rgw_rm(self, realm_name, zone_name): - name = realm_name + '.' + zone_name - completion = self.remove_rgw(name) - self._orchestrator_wait([completion]) - orchestrator.raise_if_exception(completion) - return HandleCommandResult(stdout=completion.result_str()) - @orchestrator._cli_write_command( 'orch nfs add', "name=svc_arg,type=CephString " @@ -585,16 +538,6 @@ Usage: self._orchestrator_wait([completion]) return HandleCommandResult(stdout=completion.result_str()) - @orchestrator._cli_write_command( - 'orch nfs rm', - "name=svc_id,type=CephString", - 'Remove an NFS service') - def _nfs_rm(self, svc_id): - completion = self.remove_nfs(svc_id) - self._orchestrator_wait([completion]) - orchestrator.raise_if_exception(completion) - return HandleCommandResult(stdout=completion.result_str()) - @orchestrator._cli_write_command( 'orch service', "name=action,type=CephChoices,strings=start|stop|restart|redeploy|reconfig " -- 2.39.5