Merge "Fix virtual disks sharing same physical disks" into stable/train

This commit is contained in:
Zuul 2021-09-28 12:52:20 +00:00 committed by Gerrit Code Review
commit 7e0af61bb2
2 changed files with 22 additions and 7 deletions

View File

@ -97,6 +97,8 @@ VirtualDisk = collections.namedtuple(
NO_FOREIGN_DRIVES = ["STOR058", "STOR018"]
_STARTING_LBA_AUTO_CALCULATE = '0xFFFFFFFFFFFFFFFF'
class RAIDAttribute(object):
"""Generic RAID attribute class"""
@ -672,6 +674,15 @@ class RAIDManagement(object):
virtual_disk_prop_names.append('SpanLength')
virtual_disk_prop_values.append(str(span_length))
# Necessary when creating more than 1 VD on same physical disks.
# To keep things simple, passing this all the time as no harm to pass
# this when creating only 1 VD taking all physical disk space.
# Passed value '0xFFFFFFFFFFFFFFFF' instructs iDRAC to calculate the
# value programmatically on its side. For single or first VD that would
# be 0.
virtual_disk_prop_names.append('StartingLBA')
virtual_disk_prop_values.append(_STARTING_LBA_AUTO_CALCULATE)
if error_msgs:
msg = ('The following errors were encountered while parsing '
'the provided parameters: %r') % ','.join(error_msgs)

View File

@ -647,8 +647,11 @@ class ClientRAIDManagementTestCase(base.BaseTest):
'Name': 'DCIM:RAIDService'}
expected_properties = {'Target': 'controller',
'PDArray': ['disk1', 'disk2'],
'VDPropNameArray': ['Size', 'RAIDLevel'],
'VDPropValueArray': ['42', '4']}
'VDPropNameArray': [
'Size', 'RAIDLevel', 'StartingLBA'],
'VDPropValueArray': [
'42', '4',
raid._STARTING_LBA_AUTO_CALCULATE]}
mock_invoke.return_value = lxml.etree.fromstring(
test_utils.RAIDInvocations[uris.DCIM_RAIDService][
'CreateVirtualDisk']['ok'])
@ -675,11 +678,12 @@ class ClientRAIDManagementTestCase(base.BaseTest):
'Name': 'DCIM:RAIDService'}
expected_properties = {'Target': 'controller',
'PDArray': ['disk1', 'disk2'],
'VDPropNameArray': ['Size', 'RAIDLevel',
'VirtualDiskName',
'SpanDepth', 'SpanLength'],
'VDPropValueArray': ['42', '4', 'name', '3',
'2']}
'VDPropNameArray': [
'Size', 'RAIDLevel', 'VirtualDiskName',
'SpanDepth', 'SpanLength', 'StartingLBA'],
'VDPropValueArray': [
'42', '4', 'name', '3', '2',
raid._STARTING_LBA_AUTO_CALCULATE]}
mock_invoke.return_value = lxml.etree.fromstring(
test_utils.RAIDInvocations[uris.DCIM_RAIDService][
'CreateVirtualDisk']['ok'])