]> 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:23:25 +0000 (15:23 +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 d7550be7266f31d43d10dfe0b8446b0bb3ed58ee..5d9e2329a2588b9cbff8174452328de32d22aecc 100644 (file)
@@ -486,7 +486,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 544848a9a391003241f6b9a32fb84ea25559f7f8..4238001ce3ac64efed05eaba49ce287555457ef7 100644 (file)
@@ -842,11 +842,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: