Skip to content

Commit 8392e7d

Browse files
authored
Merge pull request ceph#52429 from guits/fix-raw-list
ceph-volume: fix raw list for lvm devices
2 parents cb485d6 + e5e4296 commit 8392e7d

File tree

1 file changed

+14
-11
lines changed
  • src/ceph-volume/ceph_volume/devices/raw

1 file changed

+14
-11
lines changed

src/ceph-volume/ceph_volume/devices/raw/list.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,21 @@ def generate(self, devs=None):
8888
# parent isn't bluestore, then the child could be a valid bluestore OSD. If we fail to
8989
# determine whether a parent is bluestore, we should err on the side of not reporting
9090
# the child so as not to give a false negative.
91-
for info_device in info_devices:
92-
if 'PKNAME' in info_device and info_device['PKNAME'] != "":
93-
parent = info_device['PKNAME']
94-
try:
95-
if disk.has_bluestore_label(parent):
96-
logger.warning(('ignoring child device {} whose parent {} is a BlueStore OSD.'.format(dev, parent),
97-
'device is likely a phantom Atari partition. device info: {}'.format(info_device)))
98-
continue
99-
except OSError as e:
100-
logger.error(('ignoring child device {} to avoid reporting invalid BlueStore data from phantom Atari partitions.'.format(dev),
101-
'failed to determine if parent device {} is BlueStore. err: {}'.format(parent, e)))
91+
info_device = [info for info in info_devices if info['NAME'] == dev][0]
92+
if info_device['TYPE'] == 'lvm':
93+
# lvm devices are not raw devices
94+
continue
95+
if 'PKNAME' in info_device and info_device['PKNAME'] != "":
96+
parent = info_device['PKNAME']
97+
try:
98+
if disk.has_bluestore_label(parent):
99+
logger.warning(('ignoring child device {} whose parent {} is a BlueStore OSD.'.format(dev, parent),
100+
'device is likely a phantom Atari partition. device info: {}'.format(info_device)))
102101
continue
102+
except OSError as e:
103+
logger.error(('ignoring child device {} to avoid reporting invalid BlueStore data from phantom Atari partitions.'.format(dev),
104+
'failed to determine if parent device {} is BlueStore. err: {}'.format(parent, e)))
105+
continue
103106

104107
bs_info = _get_bluestore_info(dev)
105108
if bs_info is None:

0 commit comments

Comments
 (0)