]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: add new config option
authorGuillaume Abrioux <gabrioux@ibm.com>
Tue, 8 Aug 2023 15:04:17 +0000 (15:04 +0000)
committerGuillaume Abrioux <gabrioux@ibm.com>
Tue, 5 Sep 2023 13:23:25 +0000 (15:23 +0200)
This adds a new config option 'inventory_list_all' so one can make
the command `ceph orch device ls` report lvm devices too as they are
valid devices that can be used to be prepared as OSDs.

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit e98ec820cf3acd1711d09e63ec5df8787a369cef)

src/pybind/mgr/cephadm/module.py
src/pybind/mgr/cephadm/serve.py

index d35466c11dc2b8011440b394e121b8af79895c8c..3fdbb64f9c316a636802c89d52bfb8c501e876db 100644 (file)
@@ -156,6 +156,13 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
             default=False,
             desc='Use libstoragemgmt during device scans',
         ),
+        Option(
+            'inventory_list_all',
+            type='bool',
+            default=False,
+            desc='Whether ceph-volume inventory should report '
+            'more devices (mostly mappers (LVs / mpaths), partitions...)',
+        ),
         Option(
             'daemon_cache_timeout',
             type='secs',
@@ -487,6 +494,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
             self.apply_spec_fails: List[Tuple[str, str]] = []
             self.max_osd_draining_count = 10
             self.device_enhanced_scan = False
+            self.inventory_list_all = False
             self.cgroups_split = True
             self.log_refresh_metadata = False
             self.default_cephadm_command_timeout = 0
index b29fb5e4586f8e5c63830ec09f141bf53d3a3954..c4de9cf39a80c40265c0851d1218fb934317e4a2 100644 (file)
@@ -334,11 +334,14 @@ class CephadmServe:
 
     def _refresh_host_devices(self, host: str) -> Optional[str]:
         with_lsm = self.mgr.device_enhanced_scan
+        list_all = self.mgr.inventory_list_all
         inventory_args = ['--', 'inventory',
                           '--format=json-pretty',
                           '--filter-for-batch']
         if with_lsm:
             inventory_args.insert(-1, "--with-lsm")
+        if list_all:
+            inventory_args.insert(-1, "--list-all")
 
         try:
             try: