From: Kim Minjong Date: Fri, 3 Feb 2023 04:57:05 +0000 (+0900) Subject: ceph-volume: allow removable devices but exclude USB X-Git-Tag: testing/wip-pdonnell-testing-20240430.123648-reef-debug~309^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2062135537447abb355df1267fb74607f224f9d1;p=ceph-ci.git ceph-volume: allow removable devices but exclude USB Changed the logic to exclude USB devices to pass hot swap devices that were passed through before the bug. Fixes: https://tracker.ceph.com/issues/57907 Fixes: https://tracker.ceph.com/issues/58189 Fixes: https://tracker.ceph.com/issues/58306 Fixes: https://tracker.ceph.com/issues/58591 Signed-off-by: Kim Minjong (cherry picked from commit bd5e1a83495e31e457827f564c56fba23f4da8c9) --- diff --git a/src/ceph-volume/ceph_volume/util/device.py b/src/ceph-volume/ceph_volume/util/device.py index d01d395339d..bb806292f2c 100644 --- a/src/ceph-volume/ceph_volume/util/device.py +++ b/src/ceph-volume/ceph_volume/util/device.py @@ -594,7 +594,7 @@ class Device(object): def _check_generic_reject_reasons(self): reasons = [ - ('removable', '1', 'removable'), + ('id_bus', 'usb', 'id_bus'), ('ro', '1', 'read-only'), ] rejected = [reason for (k, v, reason) in reasons if diff --git a/src/ceph-volume/ceph_volume/util/disk.py b/src/ceph-volume/ceph_volume/util/disk.py index fa900e5da0f..dc1d9b1b792 100644 --- a/src/ceph-volume/ceph_volume/util/disk.py +++ b/src/ceph-volume/ceph_volume/util/disk.py @@ -916,6 +916,10 @@ def get_devices(_sys_block_path='/sys/block', device=''): metadata['path'] = diskname metadata['type'] = block[2] + # some facts from udevadm + p = udevadm_property(sysdir) + metadata['id_bus'] = p.get('ID_BUS', '') + device_facts[diskname] = metadata return device_facts