diff --git a/driver-requirements.txt b/driver-requirements.txt index 8cc99d6b42..beb5421862 100644 --- a/driver-requirements.txt +++ b/driver-requirements.txt @@ -4,7 +4,7 @@ # python projects they should package as optional dependencies for Ironic. # These are available on pypi -proliantutils>=2.9.0 +proliantutils>=2.9.1 pysnmp>=4.3.0,<5.0.0 python-scciclient>=0.8.0 python-dracclient>=3.0.0,<4.0.0 diff --git a/ironic/drivers/modules/ilo/management.py b/ironic/drivers/modules/ilo/management.py index aa03648729..b8cf400d07 100644 --- a/ironic/drivers/modules/ilo/management.py +++ b/ironic/drivers/modules/ilo/management.py @@ -599,6 +599,7 @@ class IloManagement(base.ManagementInterface): """ # Getting target info node = task.node + macs = [port['address'] for port in task.ports] boot_volume = node.driver_internal_info.get('boot_from_volume') volume = volume_target.VolumeTarget.get_by_uuid(task.context, boot_volume) @@ -620,7 +621,7 @@ class IloManagement(base.ManagementInterface): auth_method = 'CHAP' if username else None ilo_object.set_iscsi_info( iqn, lun, host, port, auth_method=auth_method, - username=username, password=password) + username=username, password=password, macs=macs) except ilo_error.IloCommandNotSupportedInBiosError as ilo_exception: operation = (_("Setting of target IQN %(target_iqn)s for node " "%(node)s") @@ -644,7 +645,8 @@ class IloManagement(base.ManagementInterface): """ ilo_object = ilo_common.get_ilo_object(task.node) try: - ilo_object.unset_iscsi_info() + macs = [port['address'] for port in task.ports] + ilo_object.unset_iscsi_info(macs=macs) except ilo_error.IloCommandNotSupportedInBiosError as ilo_exception: operation = (_("Unsetting of iSCSI target for node %(node)s") % {'node': task.node.uuid}) diff --git a/ironic/tests/unit/drivers/modules/ilo/test_management.py b/ironic/tests/unit/drivers/modules/ilo/test_management.py index 9dbd12e1ae..13623bfa54 100644 --- a/ironic/tests/unit/drivers/modules/ilo/test_management.py +++ b/ironic/tests/unit/drivers/modules/ilo/test_management.py @@ -41,6 +41,16 @@ INFO_DICT = db_utils.get_test_ilo_info() class IloManagementTestCase(test_common.BaseIloTest): + def setUp(self): + super(IloManagementTestCase, self).setUp() + port_1 = obj_utils.create_test_port( + self.context, node_id=self.node.id, + address='11:22:33:44:55:66', uuid=uuidutils.generate_uuid()) + port_2 = obj_utils.create_test_port( + self.context, node_id=self.node.id, + address='11:22:33:44:55:67', uuid=uuidutils.generate_uuid()) + self.ports = [port_1, port_2] + def test_get_properties(self): with task_manager.acquire(self.context, self.node.uuid, shared=False) as task: @@ -1009,7 +1019,8 @@ class IloManagementTestCase(test_common.BaseIloTest): ilo_object_mock.set_iscsi_info.assert_called_once_with( 'fake_iqn', 0, 'fake_host', '3260', auth_method='CHAP', username='fake_username', - password='fake_password') + password='fake_password', + macs=['11:22:33:44:55:66', '11:22:33:44:55:67']) @mock.patch.object(ilo_common, 'get_ilo_object', spec_set=True, autospec=True) @@ -1031,7 +1042,8 @@ class IloManagementTestCase(test_common.BaseIloTest): task.driver.management.set_iscsi_boot_target(task) ilo_object_mock.set_iscsi_info.assert_called_once_with( 'fake_iqn', 0, 'fake_host', '3260', auth_method=None, - password=None, username=None) + password=None, username=None, + macs=['11:22:33:44:55:66', '11:22:33:44:55:67']) @mock.patch.object(ilo_common, 'get_ilo_object', spec_set=True, autospec=True) @@ -1109,7 +1121,8 @@ class IloManagementTestCase(test_common.BaseIloTest): ilo_object_mock = get_ilo_object_mock.return_value task.driver.management.clear_iscsi_boot_target(task) - ilo_object_mock.unset_iscsi_info.assert_called_once() + ilo_object_mock.unset_iscsi_info.assert_called_once_with( + macs=['11:22:33:44:55:66', '11:22:33:44:55:67']) @mock.patch.object(ilo_common, 'get_ilo_object', spec_set=True, autospec=True) diff --git a/releasenotes/notes/ilo-fix-uefi-iscsi-boot-702ced18e28c5c61.yaml b/releasenotes/notes/ilo-fix-uefi-iscsi-boot-702ced18e28c5c61.yaml new file mode 100644 index 0000000000..2a2e8f821b --- /dev/null +++ b/releasenotes/notes/ilo-fix-uefi-iscsi-boot-702ced18e28c5c61.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - Fixes a bug in the iLO UEFI iSCSI Boot, where it fails if server has + multiple nic adapters, since Proliant Servers has a limitation of + creating only four iSCSI nic sources and existing implementation + would try to create for more and failed accordingly.