]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: allow removable devices but exclude USB 54705/head
authorKim Minjong <make.dirty.code@gmail.com>
Fri, 3 Feb 2023 04:57:05 +0000 (13:57 +0900)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Fri, 8 Dec 2023 16:28:17 +0000 (23:28 +0700)
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 <make.dirty.code@gmail.com>
(cherry picked from commit bd5e1a83495e31e457827f564c56fba23f4da8c9)

src/ceph-volume/ceph_volume/util/device.py
src/ceph-volume/ceph_volume/util/disk.py

index d01d395339d4a22715ee5b36a532ff8ea6ea9426..bb806292f2c48aab02cfbf9f770187cc17af97ba 100644 (file)
@@ -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
index fa900e5da0f3a351dd7bb3786c49aa7b22a3b927..dc1d9b1b7920572532419eea3337eb94b2bb8840 100644 (file)
@@ -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