diff --git a/ironic/drivers/modules/redfish/raid.py b/ironic/drivers/modules/redfish/raid.py index d856eabe45..4c29771372 100644 --- a/ironic/drivers/modules/redfish/raid.py +++ b/ironic/drivers/modules/redfish/raid.py @@ -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 diff --git a/ironic/tests/unit/drivers/modules/redfish/test_raid.py b/ironic/tests/unit/drivers/modules/redfish/test_raid.py index 87a0575887..7c6ab4ba10 100644 --- a/ironic/tests/unit/drivers/modules/redfish/test_raid.py +++ b/ironic/tests/unit/drivers/modules/redfish/test_raid.py @@ -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() diff --git a/releasenotes/notes/skip-nonraid-controllers-f4a79e2c9e8080ce.yaml b/releasenotes/notes/skip-nonraid-controllers-f4a79e2c9e8080ce.yaml new file mode 100644 index 0000000000..2b3ed415d6 --- /dev/null +++ b/releasenotes/notes/skip-nonraid-controllers-f4a79e2c9e8080ce.yaml @@ -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.