Extend root device hints for different types of WWN

This patch is extending the root device hints to also look at
ID_WWN_WITH_EXTENSION and ID_WWN_VENDOR_EXTENSION from udev.

Prior to this patch the IPA ramdisk only cared about ID_WWN but in some
systems in some platforms with a RAID controller, this ID can be same
even if they are different disks (see bug 1516641).

Closes-Bug: #1516641
Change-Id: Ic3e9a1111dfcc99702190c173562a0dccf5f94c4
This commit is contained in:
Lucas Alvares Gomes
2015-11-16 14:50:55 +00:00
parent 59630d4f7b
commit da9c3b0adc
2 changed files with 22 additions and 5 deletions
ironic_python_agent

@ -102,7 +102,9 @@ def list_all_block_devices(block_type='disk'):
# ID_SERIAL_SHORT here to keep compatibility with the
# bash deploy ramdisk
extra = {key: udev.get('ID_%s' % udev_key) for key, udev_key in
[('wwn', 'WWN'), ('serial', 'SERIAL_SHORT')]}
[('wwn', 'WWN'), ('serial', 'SERIAL_SHORT'),
('wwn_with_extension', 'WWN_WITH_EXTENSION'),
('wwn_vendor_extension', 'WWN_VENDOR_EXTENSION')]}
devices.append(BlockDevice(name=name,
model=device['MODEL'],
@ -139,7 +141,8 @@ class BlockDevice(encoding.SerializableComparable):
'wwn', 'serial', 'vendor')
def __init__(self, name, model, size, rotational, wwn=None, serial=None,
vendor=None):
vendor=None, wwn_with_extension=None,
wwn_vendor_extension=None):
self.name = name
self.model = model
self.size = size
@ -147,6 +150,8 @@ class BlockDevice(encoding.SerializableComparable):
self.wwn = wwn
self.serial = serial
self.vendor = vendor
self.wwn_with_extension = wwn_with_extension
self.wwn_vendor_extension = wwn_vendor_extension
class NetworkInterface(encoding.SerializableComparable):
@ -445,7 +450,8 @@ class GenericHardwareManager(HardwareManager):
return True
def check_device_attrs(device):
for key in ('model', 'wwn', 'serial', 'vendor'):
for key in ('model', 'wwn', 'serial', 'vendor',
'wwn_with_extension', 'wwn_vendor_extension'):
if key not in root_device_hints:
continue