Merge "Add the new capabilities to the iLO InspectInterface"

This commit is contained in:
Jenkins 2017-08-21 14:05:18 +00:00 committed by Gerrit Code Review
commit cd81528a4e
4 changed files with 103 additions and 9 deletions

View File

@ -1054,6 +1054,7 @@ The following iLO drivers support hardware inspection:
* ``pxe_ilo`` * ``pxe_ilo``
* ``iscsi_ilo`` * ``iscsi_ilo``
* ``agent_ilo`` * ``agent_ilo``
* ``ilo`` hardware type
.. note:: .. note::
@ -1113,6 +1114,38 @@ Inspection can also discover the following extra capabilities for iLO drivers:
* ``nic_capacity``: the max speed of the embedded NIC adapter. * ``nic_capacity``: the max speed of the embedded NIC adapter.
* ``sriov_enabled``: true, if server has the SRIOV supporting NIC.
* ``has_rotational``: true, if server has HDD disk.
* ``has_ssd``: true, if server has SSD disk.
* ``has_nvme_ssd``: true, if server has NVME SSD disk.
* ``cpu_vt``: true, if server supports cpu virtualization.
* ``hardware_supports_raid``: true, if RAID can be configured on the server using
RAID controller.
* ``nvdimm_n``: true, if server has NVDIMM_N type of persistent memory.
* ``persistent_memory``: true, if server has persistent memory.
* ``logical_nvdimm_n``: true, if server has logical NVDIMM_N configured.
* ``rotational_drive_<speed>_rpm``: The capabilities
``rotational_drive_4800_rpm``, ``rotational_drive_5400_rpm``,
``rotational_drive_7200_rpm``, ``rotational_drive_10000_rpm`` and
``rotational_drive_15000_rpm`` are set to true if the server has HDD
drives with speed of 4800, 5400, 7200, 10000 and 15000 rpm respectively.
* ``logical_raid_level_<raid_level>``: The capabilities
``logical_raid_level_0``, ``logical_raid_level_1``, ``logical_raid_level_2``,
``logical_raid_level_5``, ``logical_raid_level_6``, ``logical_raid_level_10``,
``logical_raid_level_50`` and ``logical_raid_level_60`` are set to true if any
of the raid levels among 0, 1, 2, 5, 6, 10, 50 and 60 are configured on
the system.
.. note:: .. note::
* The capability ``nic_capacity`` can only be discovered if ipmitool * The capability ``nic_capacity`` can only be discovered if ipmitool
@ -1130,6 +1163,8 @@ for scheduling::
nova flavor-key my-baremetal-flavor set capabilities:ilo_firmware_version="<in> 2.10" nova flavor-key my-baremetal-flavor set capabilities:ilo_firmware_version="<in> 2.10"
nova flavor-key my-baremetal-flavor set capabilities:has_ssd="true"
See :ref:`capabilities-discovery` for more details and examples. See :ref:`capabilities-discovery` for more details and examples.
Swiftless deploy for intermediate images Swiftless deploy for intermediate images

View File

@ -31,9 +31,21 @@ LOG = logging.getLogger(__name__)
METRICS = metrics_utils.get_metrics_logger(__name__) METRICS = metrics_utils.get_metrics_logger(__name__)
CAPABILITIES_KEYS = {'BootMode', 'secure_boot', 'rom_firmware_version', CAPABILITIES_KEYS = {'secure_boot', 'rom_firmware_version',
'ilo_firmware_version', 'server_model', 'max_raid_level', 'ilo_firmware_version', 'server_model',
'pci_gpu_devices', 'sr_iov_devices', 'nic_capacity'} 'pci_gpu_devices', 'sriov_enabled', 'nic_capacity',
'has_ssd', 'has_rotational',
'rotational_drive_4800_rpm',
'rotational_drive_5400_rpm',
'rotational_drive_7200_rpm',
'rotational_drive_10000_rpm',
'rotational_drive_15000_rpm',
'logical_raid_level_0', 'logical_raid_level_1',
'logical_raid_level_2', 'logical_raid_level_10',
'logical_raid_level_5', 'logical_raid_level_6',
'logical_raid_level_50', 'logical_raid_level_60',
'cpu_vt', 'hardware_supports_raid', 'has_nvme_ssd',
'nvdimm_n', 'logical_nvdimm_n', 'persistent_memory'}
def _create_ports_if_not_exist(task, macs): def _create_ports_if_not_exist(task, macs):

View File

@ -199,8 +199,8 @@ class IloInspectTestCase(db_base.DbTestCase):
properties = {'memory_mb': '512', 'local_gb': '10', properties = {'memory_mb': '512', 'local_gb': '10',
'cpus': '1', 'cpu_arch': 'x86_64'} 'cpus': '1', 'cpu_arch': 'x86_64'}
macs = {'Port 1': 'aa:aa:aa:aa:aa:aa', 'Port 2': 'bb:bb:bb:bb:bb:bb'} macs = {'Port 1': 'aa:aa:aa:aa:aa:aa', 'Port 2': 'bb:bb:bb:bb:bb:bb'}
capability_str = 'BootMode:uefi' capability_str = 'sriov_enabled:true'
capabilities = {'BootMode': 'uefi'} capabilities = {'sriov_enabled': 'true'}
result = {'properties': properties, 'macs': macs} result = {'properties': properties, 'macs': macs}
get_essential_mock.return_value = result get_essential_mock.return_value = result
get_capabilities_mock.return_value = capabilities get_capabilities_mock.return_value = capabilities
@ -240,15 +240,15 @@ class IloInspectTestCase(db_base.DbTestCase):
'somekey': 'somevalue'} 'somekey': 'somevalue'}
macs = {'Port 1': 'aa:aa:aa:aa:aa:aa', 'Port 2': 'bb:bb:bb:bb:bb:bb'} macs = {'Port 1': 'aa:aa:aa:aa:aa:aa', 'Port 2': 'bb:bb:bb:bb:bb:bb'}
result = {'properties': properties, 'macs': macs} result = {'properties': properties, 'macs': macs}
capabilities = {'BootMode': 'uefi'} capabilities = {'sriov_enabled': 'true'}
get_essential_mock.return_value = result get_essential_mock.return_value = result
get_capabilities_mock.return_value = capabilities get_capabilities_mock.return_value = capabilities
power_mock.return_value = states.POWER_ON power_mock.return_value = states.POWER_ON
with task_manager.acquire(self.context, self.node.uuid, with task_manager.acquire(self.context, self.node.uuid,
shared=False) as task: shared=False) as task:
task.node.properties = {'capabilities': 'foo:bar'} task.node.properties = {'capabilities': 'boot_mode:uefi'}
expected_capabilities = ('BootMode:uefi,' expected_capabilities = ('sriov_enabled:true,'
'foo:bar') 'boot_mode:uefi')
set1 = set(expected_capabilities.split(',')) set1 = set(expected_capabilities.split(','))
task.driver.inspect.inspect_hardware(task) task.driver.inspect.inspect_hardware(task)
end_capabilities = task.node.properties['capabilities'] end_capabilities = task.node.properties['capabilities']
@ -414,3 +414,22 @@ class TestInspectPrivateMethods(db_base.DbTestCase):
data = {'properties': properties, 'macs': macs} data = {'properties': properties, 'macs': macs}
self.assertRaises(exception.HardwareInspectionFailure, self.assertRaises(exception.HardwareInspectionFailure,
ilo_inspect._validate, self.node, data) ilo_inspect._validate, self.node, data)
def test___create_supported_capabilities_dict(self):
capabilities = {}
expected = {}
for key in ilo_inspect.CAPABILITIES_KEYS:
capabilities.update({key: 'true'})
expected.update({key: 'true'})
capabilities.update({'unknown_property': 'true'})
cap = ilo_inspect._create_supported_capabilities_dict(capabilities)
self.assertEqual(expected, cap)
def test___create_supported_capabilities_dict_excluded_capability(self):
capabilities = {}
expected = {}
for key in ilo_inspect.CAPABILITIES_KEYS - {'has_ssd'}:
capabilities.update({key: 'true'})
expected.update({key: 'true'})
cap = ilo_inspect._create_supported_capabilities_dict(capabilities)
self.assertEqual(expected, cap)

View File

@ -0,0 +1,28 @@
---
features:
- |
Adds support for the following Boolean capabilities keys to
``ilo`` inspect interface:
* ``sriov_enabled``
* ``has_ssd``
* ``has_rotational``
* ``rotational_drive_4800_rpm``
* ``rotational_drive_5400_rpm``
* ``rotational_drive_7200_rpm``
* ``rotational_drive_10000_rpm``
* ``rotational_drive_15000_rpm``
* ``logical_raid_level_0``
* ``logical_raid_level_1``
* ``logical_raid_level_2``
* ``logical_raid_level_10``
* ``logical_raid_level_5``
* ``logical_raid_level_6``
* ``logical_raid_level_50``
* ``logical_raid_level_60``
* ``cpu_vt``
* ``hardware_supports_raid``
* ``has_nvme_ssd``
* ``nvdimm_n``
* ``logical_nvdimm_n``
* ``persistent_memory``