Fixed problem with UEFI iSCSI boot for nic adapters
This commit fixes problem with multiple nic adapter by passing macs as an parameter while [un]set iSCSI target. Change-Id: Id533a476ac376dea68955b2a0de070212285b9e8 Depends-on: Iea420d7a047c8ac849fa2eeab5c6892be2d7a6e1 Story: #2006349 Task: #36114
This commit is contained in:
parent
3c9f2a834e
commit
a1340c7e95
@ -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
|
||||
|
@ -535,6 +535,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)
|
||||
@ -556,7 +557,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")
|
||||
@ -580,7 +581,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})
|
||||
|
@ -40,6 +40,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:
|
||||
@ -743,7 +753,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)
|
||||
@ -765,7 +776,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)
|
||||
@ -843,7 +855,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)
|
||||
|
@ -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.
|
Loading…
Reference in New Issue
Block a user