Merge "iDRAC RAID10 creation with greater than 16 drives"
This commit is contained in:
commit
08e70c4528
@ -497,8 +497,14 @@ def _calculate_volume_props(logical_disk, physical_disks, free_space_mb):
|
|||||||
|
|
||||||
disks_per_span = len(selected_disks) / spans_count
|
disks_per_span = len(selected_disks) / spans_count
|
||||||
|
|
||||||
logical_disk['span_depth'] = spans_count
|
# Best practice is to not pass span_length and span_depth when creating a
|
||||||
logical_disk['span_length'] = disks_per_span
|
# RAID10. The iDRAC will dynamically calculate these values using maximum
|
||||||
|
# values obtained from the RAID controller.
|
||||||
|
logical_disk['span_depth'] = None
|
||||||
|
logical_disk['span_length'] = None
|
||||||
|
if logical_disk['raid_level'] != '1+0':
|
||||||
|
logical_disk['span_depth'] = spans_count
|
||||||
|
logical_disk['span_length'] = disks_per_span
|
||||||
|
|
||||||
max_volume_size_mb = _max_volume_size_mb(
|
max_volume_size_mb = _max_volume_size_mb(
|
||||||
logical_disk['raid_level'], selected_disks, free_space_mb,
|
logical_disk['raid_level'], selected_disks, free_space_mb,
|
||||||
|
@ -661,6 +661,57 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest):
|
|||||||
mock_client = mock.Mock()
|
mock_client = mock.Mock()
|
||||||
mock_get_drac_client.return_value = mock_client
|
mock_get_drac_client.return_value = mock_client
|
||||||
|
|
||||||
|
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 = {
|
self.root_logical_disk = {
|
||||||
'size_gb': 100,
|
'size_gb': 100,
|
||||||
'raid_level': '1+0',
|
'raid_level': '1+0',
|
||||||
@ -687,7 +738,7 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest):
|
|||||||
'Disk.Bay.1: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.2:Enclosure.Internal.0-1:RAID.Integrated.1-1',
|
||||||
'Disk.Bay.3: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
|
# Commits to the controller
|
||||||
mock_commit_config.assert_called_once_with(
|
mock_commit_config.assert_called_once_with(
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Fixes an issue where RAID 10 creation fails with greater than 16 drives
|
||||||
|
when using the ``idrac`` hardware type. See bug `2002771
|
||||||
|
<https://storyboard.openstack.org/#!/story/2002771>`_ for details.
|
Loading…
Reference in New Issue
Block a user