From 51b67c44167209217ae1eb6b1af702212391bbb2 Mon Sep 17 00:00:00 2001 From: Nisha Agarwal Date: Thu, 28 Feb 2019 04:07:28 -0800 Subject: [PATCH] Update the log message for ilo drivers This patch updates the log message for ``ilo`` drivers and extends the warning to Gen9 as well. The proliantutils fix which added active NIC inspection for Gen9 has been reverted back in I02c27d820b27bd532f23ab7ef276b39f868f5205 story: #2004950 task: #29366 Change-Id: Ifbffb782c10b952bfb3498b882f07d313d410356 --- doc/source/admin/drivers/ilo.rst | 12 ++++++------ ironic/drivers/modules/ilo/inspect.py | 16 +++++++++------- .../unit/drivers/modules/ilo/test_inspect.py | 16 ++++++++-------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/doc/source/admin/drivers/ilo.rst b/doc/source/admin/drivers/ilo.rst index 175192c392..1c9580918f 100644 --- a/doc/source/admin/drivers/ilo.rst +++ b/doc/source/admin/drivers/ilo.rst @@ -826,12 +826,12 @@ Inspection can also discover the following extra capabilities for iLO driver: `iLO4 `_ and `iLO5 `_ management engine. - * The proliantutils returns only active NICs for Gen9 and Gen10 ProLiant - HPE servers from release 2.8.0. The user would need to delete the ironic - ports corresponding to inactive NICs for Gen8 servers as proliantutils - returns all the discovered (active and otherwise) NICs for Gen8 servers - and ironic ports are created for all of them. Inspection logs a warning - if the node under inspection is Gen8. + * The proliantutils returns only active NICs for Gen10 ProLiant HPE servers. + The user would need to delete the ironic ports corresponding to inactive NICs + for Gen8 and Gen9 servers as proliantutils returns all the discovered + (active and otherwise) NICs for Gen8 and Gen9 servers and ironic ports + are created for all of them. Inspection logs a warning if the node under + inspection is Gen8 or Gen9. The operator can specify these capabilities in nova flavor for node to be selected for scheduling:: diff --git a/ironic/drivers/modules/ilo/inspect.py b/ironic/drivers/modules/ilo/inspect.py index 2a350f6169..e783c1f943 100644 --- a/ironic/drivers/modules/ilo/inspect.py +++ b/ironic/drivers/modules/ilo/inspect.py @@ -245,15 +245,17 @@ class IloInspect(base.InspectInterface): # RIBCL(Gen8) protocol cannot determine if a NIC # is physically connected with cable or not when the server - # is not provisioned. However it is possible to determine - # the same using RIS(Gen9) and Redfish(Gen10) protocols. - # Hence proliantutils return ALL MACs for Gen8 while returns - # only active MACs for Gen9 and Gen10. A warning is been added + # is not provisioned. RIS(Gen9) can detect the same for few NIC + # adapters but not for all. However it is possible to determine + # the same using Redfish(Gen10) protocol. Hence proliantutils + # returns ALL MACs for Gen8 and Gen9 while it returns + # only active MACs for Gen10. A warning is being added # for the user so that he knows that he needs to remove the - # ironic ports created for inactive ports for Gen8. - if model is not None and 'Gen8' in model: + # ironic ports created for inactive ports for Gen8 and Gen9. + servers = ['Gen8', 'Gen9'] + if model is not None and any(serv in model for serv in servers): LOG.warning('iLO cannot determine if the NICs are physically ' - 'connected or not for ProLiant Gen8 servers. ' + 'connected or not for ProLiant Gen8 and Gen9 servers. ' 'Hence returns all the MACs present on the server. ' 'Please remove the ironic ports created for inactive ' 'NICs manually for the node %(node)', diff --git a/ironic/tests/unit/drivers/modules/ilo/test_inspect.py b/ironic/tests/unit/drivers/modules/ilo/test_inspect.py index bc2b92e61c..3dde5ca59d 100644 --- a/ironic/tests/unit/drivers/modules/ilo/test_inspect.py +++ b/ironic/tests/unit/drivers/modules/ilo/test_inspect.py @@ -183,17 +183,17 @@ class IloInspectTestCase(test_common.BaseIloTest): autospec=True) @mock.patch.object(ilo_common, 'get_ilo_object', spec_set=True, autospec=True) - def test_inspect_ok_gen9(self, get_ilo_object_mock, - power_mock, - get_essential_mock, - create_port_mock, - get_capabilities_mock, - log_mock): + def test_inspect_ok_gen10(self, get_ilo_object_mock, + power_mock, + get_essential_mock, + create_port_mock, + get_capabilities_mock, + log_mock): ilo_object_mock = get_ilo_object_mock.return_value properties = {'memory_mb': '512', 'local_gb': 10, 'cpus': '1', 'cpu_arch': 'x86_64'} macs = {'NIC.LOM.1.1': 'aa:aa:aa:aa:aa:aa'} - capabilities = {'server_model': 'Gen9'} + capabilities = {'server_model': 'Gen10'} result = {'properties': properties, 'macs': macs} get_essential_mock.return_value = result get_capabilities_mock.return_value = capabilities @@ -202,7 +202,7 @@ class IloInspectTestCase(test_common.BaseIloTest): shared=False) as task: expected_properties = {'memory_mb': '512', 'local_gb': 10, 'cpus': '1', 'cpu_arch': 'x86_64', - 'capabilities': 'server_model:Gen9'} + 'capabilities': 'server_model:Gen10'} task.driver.inspect.inspect_hardware(task) self.assertEqual(expected_properties, task.node.properties) power_mock.assert_called_once_with(mock.ANY, task)