]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: support type=lvm in get_devices()
authorGuillaume Abrioux <gabrioux@ibm.com>
Tue, 8 Aug 2023 12:08:14 +0000 (12:08 +0000)
committerGuillaume Abrioux <gabrioux@ibm.com>
Tue, 5 Sep 2023 13:22:57 +0000 (15:22 +0200)
LV devices are valid devices, they shouldn't be filtered in
`disk.get_devices()`

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

src/ceph-volume/ceph_volume/util/device.py
src/ceph-volume/ceph_volume/util/disk.py

index 0a3799ff1b4c0ce001e5226fa0048417c9b92c30..bb8b623a506a45248df27544e09e71487ab3d0ee 100644 (file)
@@ -490,7 +490,7 @@ class Device(object):
 
     @property
     def is_acceptable_device(self):
-        return self.is_device or self.is_partition
+        return self.is_device or self.is_partition or self.is_lv
 
     @property
     def is_encrypted(self):
index a69b0077eb238ca0df3488eed7da2ba24d5ccdee..5714ed70b7fe4ee6a99e60c8b28be12804cbc535 100644 (file)
@@ -845,11 +845,13 @@ def get_devices(_sys_block_path='/sys/block', device=''):
 
     block_devs = get_block_devs_sysfs(_sys_block_path)
 
-    block_types = ['disk', 'mpath']
+    block_types = ['disk', 'mpath', 'lvm']
     if allow_loop_devices():
         block_types.append('loop')
 
     for block in block_devs:
+        if block[2] == 'lvm':
+            block[1] = lvm.get_lv_path_from_mapper(block[1])
         devname = os.path.basename(block[0])
         diskname = block[1]
         if block[2] not in block_types: