Use explicit order for ironic enabled interfaces
Ironic uses the order of enabled interfaces to attempt each interface in turn, so sorting the list will result in an incorrect order in some cases, which will cause deployment failures on some hardware. This change sets an explicit order for each interface. Change-Id: If2740767521453c7adfca56d942db97af13bfaf2 Closes-Bug: #1931161
This commit is contained in:
parent
c4261c4420
commit
05500120e0
@ -53,19 +53,19 @@ class TestProcessDriversAndHardwareTypes(base.TestCase):
|
||||
self.assertEqual({
|
||||
'IronicEnabledNetworkInterfaces': ['flat'],
|
||||
'IronicDefaultNetworkInterface': 'flat',
|
||||
'IronicEnabledHardwareTypes': ['idrac', 'ilo', 'ipmi', 'redfish'],
|
||||
'IronicEnabledBootInterfaces': ['ilo-pxe', 'ipxe', 'pxe'],
|
||||
'IronicEnabledBiosInterfaces': ['ilo', 'no-bios', 'redfish'],
|
||||
'IronicEnabledDeployInterfaces': ['ansible', 'direct', 'iscsi'],
|
||||
'IronicEnabledInspectInterfaces': ['idrac', 'ilo', 'inspector',
|
||||
'no-inspect', 'redfish'],
|
||||
'IronicEnabledManagementInterfaces': ['fake', 'idrac', 'ilo',
|
||||
'ipmitool', 'noop',
|
||||
'redfish'],
|
||||
'IronicEnabledPowerInterfaces': ['fake', 'idrac', 'ilo',
|
||||
'ipmitool', 'redfish'],
|
||||
'IronicEnabledRaidInterfaces': ['idrac', 'no-raid'],
|
||||
'IronicEnabledVendorInterfaces': ['idrac', 'ipmitool', 'no-vendor']
|
||||
'IronicEnabledHardwareTypes': ['ipmi', 'redfish', 'ilo', 'idrac'],
|
||||
'IronicEnabledBootInterfaces': ['ipxe', 'pxe', 'ilo-pxe'],
|
||||
'IronicEnabledBiosInterfaces': ['no-bios', 'ilo', 'redfish'],
|
||||
'IronicEnabledDeployInterfaces': ['direct', 'iscsi', 'ansible'],
|
||||
'IronicEnabledInspectInterfaces': ['inspector', 'no-inspect',
|
||||
'redfish', 'idrac', 'ilo'],
|
||||
'IronicEnabledManagementInterfaces': ['ipmitool', 'redfish',
|
||||
'idrac', 'ilo', 'fake',
|
||||
'noop'],
|
||||
'IronicEnabledPowerInterfaces': ['ipmitool', 'redfish',
|
||||
'idrac', 'ilo', 'fake'],
|
||||
'IronicEnabledRaidInterfaces': ['no-raid', 'idrac'],
|
||||
'IronicEnabledVendorInterfaces': ['no-vendor', 'ipmitool', 'idrac']
|
||||
}, env)
|
||||
|
||||
def test_one_hardware_type_with_discovery(self):
|
||||
@ -78,17 +78,17 @@ class TestProcessDriversAndHardwareTypes(base.TestCase):
|
||||
'IronicEnabledNetworkInterfaces': ['flat'],
|
||||
'IronicDefaultNetworkInterface': 'flat',
|
||||
# ipmi added because it's the default discovery driver
|
||||
'IronicEnabledHardwareTypes': ['ipmi', 'redfish'],
|
||||
'IronicEnabledHardwareTypes': ['redfish', 'ipmi'],
|
||||
'IronicEnabledBootInterfaces': ['ipxe', 'pxe'],
|
||||
'IronicEnabledBiosInterfaces': ['no-bios', 'redfish'],
|
||||
'IronicEnabledDeployInterfaces': ['ansible', 'direct', 'iscsi'],
|
||||
'IronicEnabledDeployInterfaces': ['direct', 'iscsi', 'ansible'],
|
||||
'IronicEnabledInspectInterfaces': ['inspector', 'no-inspect',
|
||||
'redfish'],
|
||||
'IronicEnabledManagementInterfaces': ['fake', 'ipmitool',
|
||||
'noop', 'redfish'],
|
||||
'IronicEnabledPowerInterfaces': ['fake', 'ipmitool', 'redfish'],
|
||||
'IronicEnabledManagementInterfaces': ['ipmitool', 'redfish',
|
||||
'fake', 'noop'],
|
||||
'IronicEnabledPowerInterfaces': ['ipmitool', 'redfish', 'fake'],
|
||||
'IronicEnabledRaidInterfaces': ['no-raid'],
|
||||
'IronicEnabledVendorInterfaces': ['ipmitool', 'no-vendor'],
|
||||
'IronicEnabledVendorInterfaces': ['no-vendor', 'ipmitool'],
|
||||
'IronicInspectorDiscoveryDefaultDriver': 'ipmi',
|
||||
'IronicInspectorEnableNodeDiscovery': True
|
||||
}, env)
|
||||
@ -105,28 +105,27 @@ class TestProcessDriversAndHardwareTypes(base.TestCase):
|
||||
self.assertEqual({
|
||||
'IronicEnabledNetworkInterfaces': ['flat'],
|
||||
'IronicDefaultNetworkInterface': 'flat',
|
||||
'IronicEnabledHardwareTypes': ['fake-hardware', 'idrac', 'ilo',
|
||||
'ipmi', 'irmc', 'redfish', 'snmp',
|
||||
'staging-ovirt', 'xclarity'],
|
||||
'IronicEnabledBootInterfaces': ['fake', 'ilo-pxe', 'ipxe',
|
||||
'irmc-pxe', 'pxe'],
|
||||
'IronicEnabledBiosInterfaces': ['ilo', 'irmc',
|
||||
'no-bios', 'redfish'],
|
||||
'IronicEnabledDeployInterfaces': ['ansible', 'direct', 'fake',
|
||||
'iscsi'],
|
||||
'IronicEnabledInspectInterfaces': ['idrac', 'ilo', 'inspector',
|
||||
'irmc', 'no-inspect',
|
||||
'redfish'],
|
||||
'IronicEnabledManagementInterfaces': ['fake', 'idrac',
|
||||
'ilo', 'ipmitool', 'irmc',
|
||||
'noop', 'redfish',
|
||||
'staging-ovirt', 'xclarity'],
|
||||
'IronicEnabledPowerInterfaces': ['fake', 'idrac',
|
||||
'ilo', 'ipmitool', 'irmc',
|
||||
'redfish', 'snmp',
|
||||
'staging-ovirt', 'xclarity'],
|
||||
'IronicEnabledRaidInterfaces': ['idrac', 'no-raid'],
|
||||
'IronicEnabledVendorInterfaces': ['idrac', 'ipmitool', 'no-vendor']
|
||||
'IronicEnabledHardwareTypes': ['ipmi', 'redfish', 'ilo', 'idrac',
|
||||
'staging-ovirt', 'snmp', 'irmc',
|
||||
'xclarity', 'fake-hardware'],
|
||||
'IronicEnabledBootInterfaces': ['ipxe', 'pxe', 'ilo-pxe',
|
||||
'irmc-pxe', 'fake'],
|
||||
'IronicEnabledBiosInterfaces': ['no-bios', 'ilo', 'irmc',
|
||||
'redfish'],
|
||||
'IronicEnabledDeployInterfaces': ['direct', 'iscsi', 'ansible',
|
||||
'fake'],
|
||||
'IronicEnabledInspectInterfaces': ['inspector', 'no-inspect',
|
||||
'redfish', 'idrac', 'ilo',
|
||||
'irmc'],
|
||||
'IronicEnabledManagementInterfaces': ['ipmitool', 'redfish',
|
||||
'idrac', 'ilo', 'irmc',
|
||||
'staging-ovirt', 'xclarity',
|
||||
'fake', 'noop'],
|
||||
'IronicEnabledPowerInterfaces': ['ipmitool', 'redfish', 'idrac',
|
||||
'ilo', 'irmc', 'staging-ovirt',
|
||||
'xclarity', 'fake', 'snmp'],
|
||||
'IronicEnabledRaidInterfaces': ['no-raid', 'idrac'],
|
||||
'IronicEnabledVendorInterfaces': ['no-vendor', 'ipmitool', 'idrac']
|
||||
}, env)
|
||||
|
||||
|
||||
|
@ -135,10 +135,10 @@ def _get_unknown_instack_tags(env, src):
|
||||
def _process_drivers_and_hardware_types(conf, env):
|
||||
"""Populate the environment with ironic driver information."""
|
||||
# Ensure correct rendering of the list and uniqueness of the items
|
||||
enabled_hardware_types = set(conf.enabled_hardware_types)
|
||||
enabled_hardware_types = list(conf.enabled_hardware_types)
|
||||
if conf.enable_node_discovery:
|
||||
if conf.discovery_default_driver not in enabled_hardware_types:
|
||||
enabled_hardware_types.add(conf.discovery_default_driver)
|
||||
enabled_hardware_types.append(conf.discovery_default_driver)
|
||||
env['IronicInspectorEnableNodeDiscovery'] = True
|
||||
env['IronicInspectorDiscoveryDefaultDriver'] = (
|
||||
conf.discovery_default_driver)
|
||||
@ -150,61 +150,62 @@ def _process_drivers_and_hardware_types(conf, env):
|
||||
|
||||
# In most cases power and management interfaces are called the same, so we
|
||||
# use one variable for them.
|
||||
mgmt_interfaces = {'fake', 'ipmitool'}
|
||||
mgmt_interfaces = ['ipmitool']
|
||||
# TODO(dtantsur): can we somehow avoid hardcoding hardware types here?
|
||||
for hw_type in ('redfish', 'idrac', 'ilo', 'irmc', 'staging-ovirt',
|
||||
'xclarity'):
|
||||
if hw_type in enabled_hardware_types:
|
||||
mgmt_interfaces.add(hw_type)
|
||||
mgmt_interfaces.append(hw_type)
|
||||
mgmt_interfaces.append('fake')
|
||||
|
||||
bios_interfaces = {'no-bios'}
|
||||
bios_interfaces = ['no-bios']
|
||||
for hw_type in ['ilo', 'irmc', 'redfish']:
|
||||
if hw_type in enabled_hardware_types:
|
||||
bios_interfaces.add(hw_type)
|
||||
bios_interfaces.append(hw_type)
|
||||
|
||||
# Two hardware types use non-default boot interfaces.
|
||||
boot_interfaces = {'ipxe', 'pxe'}
|
||||
boot_interfaces = ['ipxe', 'pxe']
|
||||
for hw_type in ('ilo', 'irmc'):
|
||||
if hw_type in enabled_hardware_types:
|
||||
boot_interfaces.add('%s-pxe' % hw_type)
|
||||
boot_interfaces.append('%s-pxe' % hw_type)
|
||||
|
||||
inspect_interfaces = {'inspector', 'no-inspect'}
|
||||
inspect_interfaces = ['inspector', 'no-inspect']
|
||||
for hw_type in ('redfish', 'idrac', 'ilo', 'irmc'):
|
||||
if hw_type in enabled_hardware_types:
|
||||
inspect_interfaces.add(hw_type)
|
||||
inspect_interfaces.append(hw_type)
|
||||
|
||||
raid_interfaces = {'no-raid'}
|
||||
raid_interfaces = ['no-raid']
|
||||
if 'idrac' in enabled_hardware_types:
|
||||
raid_interfaces.add('idrac')
|
||||
raid_interfaces.append('idrac')
|
||||
|
||||
vendor_interfaces = {'no-vendor'}
|
||||
vendor_interfaces = ['no-vendor']
|
||||
for (hw_type, iface) in [('ipmi', 'ipmitool'),
|
||||
('idrac', 'idrac')]:
|
||||
if hw_type in enabled_hardware_types:
|
||||
vendor_interfaces.add(iface)
|
||||
vendor_interfaces.append(iface)
|
||||
|
||||
power_interfaces = mgmt_interfaces.copy()
|
||||
# The snmp hardware type uses noop management and snmp power; noop
|
||||
# management is also used by ipmi and staging hardware types.
|
||||
mgmt_interfaces.add('noop')
|
||||
mgmt_interfaces.append('noop')
|
||||
if 'snmp' in enabled_hardware_types:
|
||||
power_interfaces.add('snmp')
|
||||
power_interfaces.append('snmp')
|
||||
|
||||
deploy_interfaces = {'iscsi', 'direct', 'ansible'}
|
||||
deploy_interfaces = ['direct', 'iscsi', 'ansible']
|
||||
if 'fake-hardware' in enabled_hardware_types:
|
||||
deploy_interfaces.add('fake')
|
||||
boot_interfaces.add('fake')
|
||||
deploy_interfaces.append('fake')
|
||||
boot_interfaces.append('fake')
|
||||
|
||||
env['IronicEnabledHardwareTypes'] = sorted(enabled_hardware_types)
|
||||
env['IronicEnabledHardwareTypes'] = enabled_hardware_types
|
||||
|
||||
env['IronicEnabledBiosInterfaces'] = sorted(bios_interfaces)
|
||||
env['IronicEnabledBootInterfaces'] = sorted(boot_interfaces)
|
||||
env['IronicEnabledInspectInterfaces'] = sorted(inspect_interfaces)
|
||||
env['IronicEnabledManagementInterfaces'] = sorted(mgmt_interfaces)
|
||||
env['IronicEnabledPowerInterfaces'] = sorted(power_interfaces)
|
||||
env['IronicEnabledRaidInterfaces'] = sorted(raid_interfaces)
|
||||
env['IronicEnabledVendorInterfaces'] = sorted(vendor_interfaces)
|
||||
env['IronicEnabledDeployInterfaces'] = sorted(deploy_interfaces)
|
||||
env['IronicEnabledBiosInterfaces'] = bios_interfaces
|
||||
env['IronicEnabledBootInterfaces'] = boot_interfaces
|
||||
env['IronicEnabledInspectInterfaces'] = inspect_interfaces
|
||||
env['IronicEnabledManagementInterfaces'] = mgmt_interfaces
|
||||
env['IronicEnabledPowerInterfaces'] = power_interfaces
|
||||
env['IronicEnabledRaidInterfaces'] = raid_interfaces
|
||||
env['IronicEnabledVendorInterfaces'] = vendor_interfaces
|
||||
env['IronicEnabledDeployInterfaces'] = deploy_interfaces
|
||||
|
||||
|
||||
def _process_ipa_args(conf, env):
|
||||
|
Loading…
Reference in New Issue
Block a user