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:
@@ -97,6 +97,8 @@ VirtualDisk = collections.namedtuple(
|
|||||||
|
|
||||||
NO_FOREIGN_DRIVES = ["STOR058", "STOR018"]
|
NO_FOREIGN_DRIVES = ["STOR058", "STOR018"]
|
||||||
|
|
||||||
|
_STARTING_LBA_AUTO_CALCULATE = '0xFFFFFFFFFFFFFFFF'
|
||||||
|
|
||||||
|
|
||||||
class RAIDAttribute(object):
|
class RAIDAttribute(object):
|
||||||
"""Generic RAID attribute class"""
|
"""Generic RAID attribute class"""
|
||||||
@@ -672,6 +674,15 @@ class RAIDManagement(object):
|
|||||||
virtual_disk_prop_names.append('SpanLength')
|
virtual_disk_prop_names.append('SpanLength')
|
||||||
virtual_disk_prop_values.append(str(span_length))
|
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:
|
if error_msgs:
|
||||||
msg = ('The following errors were encountered while parsing '
|
msg = ('The following errors were encountered while parsing '
|
||||||
'the provided parameters: %r') % ','.join(error_msgs)
|
'the provided parameters: %r') % ','.join(error_msgs)
|
||||||
|
@@ -648,8 +648,11 @@ class ClientRAIDManagementTestCase(base.BaseTest):
|
|||||||
'Name': 'DCIM:RAIDService'}
|
'Name': 'DCIM:RAIDService'}
|
||||||
expected_properties = {'Target': 'controller',
|
expected_properties = {'Target': 'controller',
|
||||||
'PDArray': ['disk1', 'disk2'],
|
'PDArray': ['disk1', 'disk2'],
|
||||||
'VDPropNameArray': ['Size', 'RAIDLevel'],
|
'VDPropNameArray': [
|
||||||
'VDPropValueArray': ['42', '4']}
|
'Size', 'RAIDLevel', 'StartingLBA'],
|
||||||
|
'VDPropValueArray': [
|
||||||
|
'42', '4',
|
||||||
|
raid._STARTING_LBA_AUTO_CALCULATE]}
|
||||||
mock_invoke.return_value = lxml.etree.fromstring(
|
mock_invoke.return_value = lxml.etree.fromstring(
|
||||||
test_utils.RAIDInvocations[uris.DCIM_RAIDService][
|
test_utils.RAIDInvocations[uris.DCIM_RAIDService][
|
||||||
'CreateVirtualDisk']['ok'])
|
'CreateVirtualDisk']['ok'])
|
||||||
@@ -676,11 +679,12 @@ class ClientRAIDManagementTestCase(base.BaseTest):
|
|||||||
'Name': 'DCIM:RAIDService'}
|
'Name': 'DCIM:RAIDService'}
|
||||||
expected_properties = {'Target': 'controller',
|
expected_properties = {'Target': 'controller',
|
||||||
'PDArray': ['disk1', 'disk2'],
|
'PDArray': ['disk1', 'disk2'],
|
||||||
'VDPropNameArray': ['Size', 'RAIDLevel',
|
'VDPropNameArray': [
|
||||||
'VirtualDiskName',
|
'Size', 'RAIDLevel', 'VirtualDiskName',
|
||||||
'SpanDepth', 'SpanLength'],
|
'SpanDepth', 'SpanLength', 'StartingLBA'],
|
||||||
'VDPropValueArray': ['42', '4', 'name', '3',
|
'VDPropValueArray': [
|
||||||
'2']}
|
'42', '4', 'name', '3', '2',
|
||||||
|
raid._STARTING_LBA_AUTO_CALCULATE]}
|
||||||
mock_invoke.return_value = lxml.etree.fromstring(
|
mock_invoke.return_value = lxml.etree.fromstring(
|
||||||
test_utils.RAIDInvocations[uris.DCIM_RAIDService][
|
test_utils.RAIDInvocations[uris.DCIM_RAIDService][
|
||||||
'CreateVirtualDisk']['ok'])
|
'CreateVirtualDisk']['ok'])
|
||||||
|
Reference in New Issue
Block a user