mdev: Add support for max_instances
... which was added during this cycle. Depends-on: https://review.opendev.org/c/openstack/nova/+/899625 Change-Id: I85d6e8369359e82eda94029ad2c17067f22124ed
This commit is contained in:
parent
5eacb81147
commit
f483df8d99
@ -18,10 +18,15 @@
|
||||
# device type.
|
||||
# Defaults to $facts['os_service_default']
|
||||
#
|
||||
# [*max_instances*]
|
||||
# (Optional) Number of mediated devices that type can create.
|
||||
# Defaults to $facts['os_service_default']
|
||||
#
|
||||
define nova::compute::mdev_type (
|
||||
$mdev_type = $name,
|
||||
$device_addresses = $facts['os_service_default'],
|
||||
$mdev_class = $facts['os_service_default'],
|
||||
$max_instances = $facts['os_service_default'],
|
||||
) {
|
||||
|
||||
if empty($device_addresses) {
|
||||
@ -35,6 +40,7 @@ define nova::compute::mdev_type (
|
||||
}
|
||||
|
||||
nova_config {
|
||||
"mdev_${mdev_type}/mdev_class": value => $mdev_class;
|
||||
"mdev_${mdev_type}/mdev_class": value => $mdev_class;
|
||||
"mdev_${mdev_type}/max_instances": value => $max_instances;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Now the ``nova::compute::mdev_type`` defined resource type supports
|
||||
the new ``max_instances`` parameter.
|
@ -21,7 +21,8 @@ describe 'nova::compute::mdev' do
|
||||
'mdev_class' => 'CUSTOM_MDEV1'
|
||||
},
|
||||
'nvidia-37' => {
|
||||
'mdev_class' => 'VGPU'
|
||||
'mdev_class' => 'VGPU',
|
||||
'max_instances' => 10
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -31,10 +32,13 @@ describe 'nova::compute::mdev' do
|
||||
is_expected.to contain_nova_config('devices/enabled_mdev_types').with_value('nvidia-35,nvidia-36,nvidia-37')
|
||||
is_expected.to contain_nova_config('mdev_nvidia-35/device_addresses').with_value('0000:84:00.0,0000:85:00.0')
|
||||
is_expected.to contain_nova_config('mdev_nvidia-35/mdev_class').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('mdev_nvidia-35/max_instances').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('mdev_nvidia-36/device_addresses').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('mdev_nvidia-36/mdev_class').with_value('CUSTOM_MDEV1')
|
||||
is_expected.to contain_nova_config('mdev_nvidia-36/max_instances').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('mdev_nvidia-37/device_addresses').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('mdev_nvidia-37/mdev_class').with_value('VGPU')
|
||||
is_expected.to contain_nova_config('mdev_nvidia-37/max_instances').with_value(10)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user