From 3e7d474e1ae6eb8029a6a7d6c3f6322c4908911e Mon Sep 17 00:00:00 2001 From: Paul Cuzner Date: Fri, 22 Oct 2021 15:29:30 +1300 Subject: [PATCH] cephadm: exclude zram and cdrom from device list 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 --- src/cephadm/cephadm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index e068e52498d..f05e33e3751 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -6743,6 +6743,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 @@ -6782,7 +6783,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]