Add volume name to Redfish RAID volumes
Change-Id: I12fccda8fee73430fee03a91134fd559ebf40cc9
This commit is contained in:
parent
6c9de5324b
commit
bfaf64b46f
@ -625,8 +625,10 @@ def _construct_volume_payload(
|
||||
if physical_disks:
|
||||
payload['Drives'] = [{"@odata.id": _drive_path(storage, d)} for d in
|
||||
physical_disks]
|
||||
if disk_name:
|
||||
payload['Name'] = disk_name
|
||||
LOG.debug('Payload for RAID logical disk creation on node %(node_uuid)s: '
|
||||
'%(payload)r', {'node': node.uuid, 'payload': payload})
|
||||
'%(payload)r', {'node_uuid': node.uuid, 'payload': payload})
|
||||
return payload
|
||||
|
||||
|
||||
|
@ -48,7 +48,7 @@ def _mock_drive(identity, block_size_bytes=None, capacity_bytes=None,
|
||||
|
||||
|
||||
def _mock_volume(identity, volume_type=None, raid_type=None,
|
||||
capacity_bytes=units.Gi):
|
||||
capacity_bytes=units.Gi, volume_name=None):
|
||||
volume = mock.MagicMock(
|
||||
_path='/redfish/v1/Systems/1/Storage/1/Volumes/' + identity,
|
||||
identity=identity,
|
||||
@ -56,7 +56,10 @@ def _mock_volume(identity, volume_type=None, raid_type=None,
|
||||
raid_type=raid_type,
|
||||
capacity_bytes=capacity_bytes
|
||||
)
|
||||
volume.name = 'Volume ' + identity
|
||||
if volume_name:
|
||||
volume.name = volume_name
|
||||
else:
|
||||
volume.name = 'Volume ' + identity
|
||||
# Mocking Immediate that does not return anything
|
||||
volume.delete.return_value = None
|
||||
return volume
|
||||
@ -287,13 +290,14 @@ class RedfishRAIDTestCase(db_base.DbTestCase):
|
||||
{
|
||||
'size_gb': 100,
|
||||
'raid_level': '5',
|
||||
'is_root_volume': True
|
||||
'is_root_volume': True,
|
||||
'volume_name': 'test-volume'
|
||||
}
|
||||
]
|
||||
}
|
||||
created_volumes = [_mock_volume(
|
||||
'1', raid_type=sushy.RAIDType.RAID5,
|
||||
capacity_bytes=100 * units.Gi)]
|
||||
created_volumes = [_mock_volume('1', raid_type=sushy.RAIDType.RAID5,
|
||||
capacity_bytes=100 * units.Gi,
|
||||
volume_name='test-volume')]
|
||||
volumes = mock.MagicMock()
|
||||
# Called after volumes created
|
||||
volumes.get_members.return_value = created_volumes
|
||||
@ -337,7 +341,7 @@ class RedfishRAIDTestCase(db_base.DbTestCase):
|
||||
self.assertEqual(
|
||||
[{'controller': 'RAID controller 1',
|
||||
'id': '1',
|
||||
'name': 'Volume 1',
|
||||
'name': 'test-volume',
|
||||
'raid_level': '5',
|
||||
'size_gb': 100}],
|
||||
task.node.raid_config['logical_disks'])
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Uses the volume_name provided in the target_raid_config field of a node to
|
||||
set the storage volume name when configuring RAID with the redfish driver
|
||||
(instead of discarding the volume_name given in target_raid_config)
|
Loading…
Reference in New Issue
Block a user