Fix virtual disks sharing same physical disks

`StartingLBA` needs to be passed when creating virtual disks
sharing same physicial disks. Otherwise, only the first virtual
disk creation succeeds and iDRAC job has status "Completed
with Errors".

Change-Id: I985a714636fb2036cca038ffa281c1b1e01ffd52
This commit is contained in:
Aija Jauntēva 2021-09-20 10:12:44 -04:00
parent 9ebc4afc84
commit d26664e7f9
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

@ -648,8 +648,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'])
@ -676,11 +679,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'])