From 9d7d3157c56509eb87a0a80c00bbcb7877611c84 Mon Sep 17 00:00:00 2001 From: Kim Minjong Date: Fri, 3 Feb 2023 13:57:05 +0900 Subject: [PATCH] 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) --- src/ceph-volume/ceph_volume/util/device.py | 2 +- src/ceph-volume/ceph_volume/util/disk.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ceph-volume/ceph_volume/util/device.py b/src/ceph-volume/ceph_volume/util/device.py index 14fe573622e69..c5250d4355f0c 100644 --- a/src/ceph-volume/ceph_volume/util/device.py +++ b/src/ceph-volume/ceph_volume/util/device.py @@ -582,7 +582,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 418bfe16188eb..0ca52d2231f91 100644 --- a/src/ceph-volume/ceph_volume/util/disk.py +++ b/src/ceph-volume/ceph_volume/util/disk.py @@ -892,6 +892,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 -- 2.39.5