summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/orchestrator
diff options
context:
space:
mode:
authorAdam King <47704447+adk3798@users.noreply.github.com>2024-10-17 18:12:16 +0200
committerGitHub <noreply@github.com>2024-10-17 18:12:16 +0200
commit2966f225ee943a98cb5a4d7a6c429d728747c864 (patch)
treef0e9205c997e08614ec7eb42bec671ab4f18b472 /src/pybind/mgr/orchestrator
parentMerge pull request #60347 from avanthakkar/rm-smb-dump-everything (diff)
parentorch: disk replacement enhancement (diff)
downloadceph-2966f225ee943a98cb5a4d7a6c429d728747c864.tar.xz
ceph-2966f225ee943a98cb5a4d7a6c429d728747c864.zip
Merge pull request #60223 from guits/replace-osd-enhancement
orch: disk replacement enhancement Reviewed-by: Adam King <adking@redhat.com>
Diffstat (limited to 'src/pybind/mgr/orchestrator')
-rw-r--r--src/pybind/mgr/orchestrator/_interface.py15
-rw-r--r--src/pybind/mgr/orchestrator/module.py20
2 files changed, 33 insertions, 2 deletions
diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py
index acf3b0076d0..d5c351fda7e 100644
--- a/src/pybind/mgr/orchestrator/_interface.py
+++ b/src/pybind/mgr/orchestrator/_interface.py
@@ -520,6 +520,15 @@ class Orchestrator(object):
"""
raise NotImplementedError()
+ def replace_device(self,
+ hostname: str,
+ device: str,
+ clear: bool = False,
+ yes_i_really_mean_it: bool = False) -> OrchResult:
+ """Perform all required operations in order to replace a device.
+ """
+ raise NotImplementedError()
+
def get_inventory(self, host_filter: Optional['InventoryFilter'] = None, refresh: bool = False) -> OrchResult[List['InventoryHost']]:
"""
Returns something that was created by `ceph-volume inventory`.
@@ -704,12 +713,18 @@ class Orchestrator(object):
def remove_osds(self, osd_ids: List[str],
replace: bool = False,
+ replace_block: bool = False,
+ replace_db: bool = False,
+ replace_wal: bool = False,
force: bool = False,
zap: bool = False,
no_destroy: bool = False) -> OrchResult[str]:
"""
:param osd_ids: list of OSD IDs
:param replace: marks the OSD as being destroyed. See :ref:`orchestrator-osd-replace`
+ :param replace_block: marks the corresponding block device as being replaced.
+ :param replace_db: marks the corresponding db device as being replaced.
+ :param replace_wal: marks the corresponding wal device as being replaced.
:param force: Forces the OSD removal process without waiting for the data to be drained first.
:param zap: Zap/Erase all devices associated with the OSDs (DESTROYS DATA)
:param no_destroy: Do not destroy associated VGs/LVs with the OSD.
diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py
index 65460f73ee1..dbfa10fb720 100644
--- a/src/pybind/mgr/orchestrator/module.py
+++ b/src/pybind/mgr/orchestrator/module.py
@@ -818,6 +818,21 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule,
return HandleCommandResult(stdout=completion.result_str())
return HandleCommandResult(stdout=completion.result_str().split('.')[0])
+ @_cli_read_command('orch device replace')
+ def _replace_device(self,
+ hostname: str,
+ device: str,
+ clear: bool = False,
+ yes_i_really_mean_it: bool = False) -> HandleCommandResult:
+ """Perform all required operations in order to replace a device.
+ """
+ completion = self.replace_device(hostname=hostname,
+ device=device,
+ clear=clear,
+ yes_i_really_mean_it=yes_i_really_mean_it)
+ raise_if_exception(completion)
+ return HandleCommandResult(stdout=completion.result_str())
+
@_cli_read_command('orch device ls')
def _list_devices(self,
hostname: Optional[List[str]] = None,
@@ -1415,8 +1430,9 @@ Usage:
zap: bool = False,
no_destroy: bool = False) -> HandleCommandResult:
"""Remove OSD daemons"""
- completion = self.remove_osds(osd_id, replace=replace, force=force,
- zap=zap, no_destroy=no_destroy)
+ completion = self.remove_osds(osd_id,
+ replace=replace,
+ force=force, zap=zap, no_destroy=no_destroy)
raise_if_exception(completion)
return HandleCommandResult(stdout=completion.result_str())