]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: allow removable devices but exclude USB 54706/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:29:29 +0000 (23:29 +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 f20f8ddb7107e6ef02128b613459b73de01af2ba..8b501fb9eeeb6b85fa1755f4ebd01cd2b46a7705 100644 (file)
@@ -593,7 +593,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 2dfa84df0fed13353b8c8c2be203c77107faaf81..cb564300ba72546634e0e0db8ae8df35a25ca4a8 100644 (file)
@@ -913,6 +913,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