summaryrefslogtreecommitdiff
path: root/ironic/tests/unit/drivers/modules/drac
diff options
context:
space:
mode:
authorChristopher Dearborn <Christopher.Dearborn@dell.com>2018-06-29 10:06:08 -0400
committerChristopher Dearborn <Christopher.Dearborn@dell.com>2018-07-02 10:23:04 -0400
commitc5fbf0702b81bebb43a143a89e120f5846821b1d (patch)
tree9c35450e1981db123bcf98a073ebe57a8aa5c0ab /ironic/tests/unit/drivers/modules/drac
parent1171226dba72583ef518580482ae8ed2781fc997 (diff)
downloadironic-c5fbf0702b81bebb43a143a89e120f5846821b1d.tar.gz
iDRAC RAID10 creation with greater than 16 drives
This patch enables creation of large RAID10's with greater than 16 drives when using the iDRAC hardware type. Best practice is to not pass span length and span depth when creating a RAID10. In this case, the iDRAC will calculate these values using information queried from the RAID controller. See this white paper on intelligent mirroring for more information: https://www.dell.com/support/article/us/en/04/sln111362/ intelligent-mirroring-and-enhanced-raid-10-aka-raid-10e-?lang=en Change-Id: If1fb29f8a078fdb0cb0338c86e32158093cad22e Task: # 22634 Story: #2002771
Diffstat (limited to 'ironic/tests/unit/drivers/modules/drac')
-rw-r--r--ironic/tests/unit/drivers/modules/drac/test_raid.py53
1 files changed, 52 insertions, 1 deletions
diff --git a/ironic/tests/unit/drivers/modules/drac/test_raid.py b/ironic/tests/unit/drivers/modules/drac/test_raid.py
index a713cccd6..b86ab5f7d 100644
--- a/ironic/tests/unit/drivers/modules/drac/test_raid.py
+++ b/ironic/tests/unit/drivers/modules/drac/test_raid.py
@@ -663,6 +663,57 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest):
self.root_logical_disk = {
'size_gb': 100,
+ 'raid_level': '5+0',
+ 'is_root_volume': True
+ }
+ self.logical_disks = [self.root_logical_disk]
+ self.target_raid_configuration = {'logical_disks': self.logical_disks}
+ self.node.target_raid_config = self.target_raid_configuration
+ self.node.save()
+
+ physical_disks = self._generate_physical_disks()
+ mock_list_physical_disks.return_value = physical_disks
+
+ mock_commit_config.return_value = '42'
+
+ with task_manager.acquire(self.context, self.node.uuid,
+ shared=False) as task:
+ task.driver.raid.create_configuration(
+ task, create_root_volume=True, create_nonroot_volumes=True)
+
+ mock_client.create_virtual_disk.assert_called_once_with(
+ 'RAID.Integrated.1-1',
+ ['Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1',
+ 'Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1',
+ 'Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1',
+ 'Disk.Bay.3:Enclosure.Internal.0-1:RAID.Integrated.1-1',
+ 'Disk.Bay.4:Enclosure.Internal.0-1:RAID.Integrated.1-1',
+ 'Disk.Bay.5:Enclosure.Internal.0-1:RAID.Integrated.1-1'],
+ '5+0', 102400, None, 3, 2)
+
+ # Commits to the controller
+ mock_commit_config.assert_called_once_with(
+ mock.ANY, raid_controller='RAID.Integrated.1-1', reboot=True)
+
+ self.node.refresh()
+ self.assertEqual(['42'],
+ self.node.driver_internal_info['raid_config_job_ids'])
+
+ @mock.patch.object(drac_common, 'get_drac_client', spec_set=True,
+ autospec=True)
+ @mock.patch.object(drac_raid, 'list_physical_disks', autospec=True)
+ @mock.patch.object(drac_job, 'validate_job_queue', spec_set=True,
+ autospec=True)
+ @mock.patch.object(drac_raid, 'commit_config', spec_set=True,
+ autospec=True)
+ def test_create_configuration_with_nested_raid_10(
+ self, mock_commit_config, mock_validate_job_queue,
+ mock_list_physical_disks, mock_get_drac_client):
+ mock_client = mock.Mock()
+ mock_get_drac_client.return_value = mock_client
+
+ self.root_logical_disk = {
+ 'size_gb': 100,
'raid_level': '1+0',
'is_root_volume': True
}
@@ -687,7 +738,7 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest):
'Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1',
'Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1',
'Disk.Bay.3:Enclosure.Internal.0-1:RAID.Integrated.1-1'],
- '1+0', 102400, None, 2, 2)
+ '1+0', 102400, None, None, None)
# Commits to the controller
mock_commit_config.assert_called_once_with(