Merge "Fix volume_name issue in Redfish RAID"
This commit is contained in:
commit
209714010b
@ -1105,7 +1105,7 @@ class RedfishRAID(base.RAIDInterface):
|
||||
physical_disks=logical_disk['physical_disks'],
|
||||
raid_level=logical_disk['raid_level'],
|
||||
size_bytes=logical_disk['size_bytes'],
|
||||
disk_name=logical_disk.get('name'),
|
||||
disk_name=logical_disk.get('volume_name'),
|
||||
span_length=logical_disk.get('span_length'),
|
||||
span_depth=logical_disk.get('span_depth'),
|
||||
error_handler=self.volume_create_error_handler)
|
||||
|
@ -326,7 +326,8 @@ class RedfishRAIDTestCase(db_base.DbTestCase):
|
||||
{'@odata.id': pre + self.drive_id1},
|
||||
{'@odata.id': pre + self.drive_id2},
|
||||
{'@odata.id': pre + self.drive_id3}
|
||||
]
|
||||
],
|
||||
'Name': 'test-volume'
|
||||
}
|
||||
self.mock_storage.volumes.create.assert_called_once_with(
|
||||
expected_payload, apply_time=sushy.APPLY_TIME_IMMEDIATE)
|
||||
@ -700,10 +701,10 @@ class RedfishRAIDTestCase(db_base.DbTestCase):
|
||||
created_volumes = [
|
||||
_mock_volume(
|
||||
'1', raid_type=sushy.RAIDType.RAID10,
|
||||
capacity_bytes=50 * units.Gi),
|
||||
capacity_bytes=50 * units.Gi, volume_name='root_volume'),
|
||||
_mock_volume(
|
||||
'2', raid_type=sushy.RAIDType.RAID5,
|
||||
capacity_bytes=100 * units.Gi)]
|
||||
capacity_bytes=100 * units.Gi, volume_name='data_volume')]
|
||||
# Called after volumes created
|
||||
self.mock_storage.volumes.get_members.return_value = created_volumes
|
||||
mock_get_system.return_value.storage.get_members.return_value = [
|
||||
@ -724,7 +725,8 @@ class RedfishRAIDTestCase(db_base.DbTestCase):
|
||||
{'@odata.id': pre + self.drive_id2},
|
||||
{'@odata.id': pre + self.drive_id3},
|
||||
{'@odata.id': pre + self.drive_id4}
|
||||
]
|
||||
],
|
||||
'Name': 'root_volume'
|
||||
}
|
||||
expected_payload2 = {
|
||||
'Encrypted': False,
|
||||
@ -735,7 +737,8 @@ class RedfishRAIDTestCase(db_base.DbTestCase):
|
||||
{'@odata.id': pre + self.drive_id2},
|
||||
{'@odata.id': pre + self.drive_id3},
|
||||
{'@odata.id': pre + self.drive_id4}
|
||||
]
|
||||
],
|
||||
'Name': 'data_volume'
|
||||
}
|
||||
self.assertEqual(
|
||||
self.mock_storage.volumes.create.call_count, 2)
|
||||
@ -749,12 +752,12 @@ class RedfishRAIDTestCase(db_base.DbTestCase):
|
||||
self.assertEqual(
|
||||
[{'controller': 'RAID controller 1',
|
||||
'id': '1',
|
||||
'name': 'Volume 1',
|
||||
'name': 'root_volume',
|
||||
'raid_level': '1+0',
|
||||
'size_gb': 50},
|
||||
{'controller': 'RAID controller 1',
|
||||
'id': '2',
|
||||
'name': 'Volume 2',
|
||||
'name': 'data_volume',
|
||||
'raid_level': '5',
|
||||
'size_gb': 100}],
|
||||
task.node.raid_config['logical_disks'])
|
||||
|
@ -0,0 +1,7 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Use the 'volume_name' field from the logical_disk in the
|
||||
target_raid_config field of a node, instead of just 'name' (which
|
||||
is incorrect as per the Ironic API expectation), to create the
|
||||
RAID volume using the Redfish driver
|
Loading…
x
Reference in New Issue
Block a user