]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: exclude zram and cdrom from device list
authorPaul Cuzner <pcuzner@redhat.com>
Fri, 22 Oct 2021 02:29:30 +0000 (15:29 +1300)
committerSebastian Wagner <sewagner@redhat.com>
Wed, 17 Nov 2021 10:25:57 +0000 (11:25 +0100)
When compiling eligible block devices, we need to
exclude zram* and cdrom (srX) devices.

Fixes: https://tracker.ceph.com/issues/52905
Signed-off-by: Paul Cuzner <pcuzner@redhat.com>
(cherry picked from commit 3e7d474e1ae6eb8029a6a7d6c3f6322c4908911e)

src/cephadm/cephadm

index 1dfcf33d18379ef9a0e7015ba119f2136204a05c..9ea76322db5e56e7aba4b2d09091719b3615a2d4 100755 (executable)
@@ -6564,6 +6564,7 @@ class HostFacts():
     _disk_vendor_workarounds = {
         '0x1af4': 'Virtio Block Device'
     }
+    _excluded_block_devices = ('sr', 'zram', 'dm-')
 
     def __init__(self, ctx: CephadmContext):
         self.ctx: CephadmContext = ctx
@@ -6603,7 +6604,7 @@ class HostFacts():
         # type: () -> List[str]
         """Determine the list of block devices by looking at /sys/block"""
         return [dev for dev in os.listdir('/sys/block')
-                if not dev.startswith('dm')]
+                if not dev.startswith(HostFacts._excluded_block_devices)]
 
     def _get_devs_by_type(self, rota='0'):
         # type: (str) -> List[str]