Redfish: Skip non-RAID controllers for RAID
Avoid processing non-RAID controllers as they cannot be used for RAID operations to save some time and requests and avoid possible errors later if non-RAID disks are picked up for configuration. Related to: I369bdbb17064baf34f90e864d0ece600529de509 Change-Id: I728f03dc829fb76cad9804c8f8df20810307ce2c
This commit is contained in:
parent
1e2fa5c326
commit
c779be9f7d
@ -591,6 +591,11 @@ def _filter_logical_disks(logical_disks, include_root_volume,
|
||||
def _get_storage_controller(node, system, physical_disks):
|
||||
collection = system.storage
|
||||
for storage in collection.get_members():
|
||||
# Using first controller as expecting only one
|
||||
controller = (storage.storage_controllers[0]
|
||||
if storage.storage_controllers else None)
|
||||
if controller and controller.raid_types == []:
|
||||
continue
|
||||
for drive in storage.drives:
|
||||
if drive.identity in physical_disks:
|
||||
return storage
|
||||
|
@ -886,3 +886,21 @@ class RedfishRAIDTestCase(db_base.DbTestCase):
|
||||
|
||||
self.assertNotIn(nonraid_storage.drives[0], disks)
|
||||
self.assertNotIn(nonraid_storage.drives[0], disk_to_controller)
|
||||
|
||||
def test__get_storage_controller(self, mock_get_system):
|
||||
nonraid_controller = mock.Mock()
|
||||
nonraid_controller.raid_types = []
|
||||
nonraid_storage = mock.MagicMock()
|
||||
nonraid_storage.storage_controllers = [nonraid_controller]
|
||||
nonraid_storage.drives = mock.Mock()
|
||||
|
||||
mock_get_system.return_value.storage.get_members.return_value = [
|
||||
nonraid_storage, self.mock_storage]
|
||||
|
||||
with task_manager.acquire(self.context, self.node.uuid,
|
||||
shared=True) as task:
|
||||
storage = redfish_raid._get_storage_controller(
|
||||
task.node, mock_get_system.return_value, ['32ADF365C6C1B7BD'])
|
||||
|
||||
self.assertEqual(storage, self.mock_storage)
|
||||
nonraid_storage.drives.assert_not_called()
|
||||
|
@ -0,0 +1,7 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
In Redfish RAID clean and deploy steps skip non-RAID storage controllers
|
||||
for RAID operations. In Redfish systems that do not implement
|
||||
``SupportedRAIDTypes`` they are still processed and could result in
|
||||
unexpected errors.
|
Loading…
x
Reference in New Issue
Block a user