Merge "Expose devices/enabled_vgpu_types config option"
This commit is contained in:
commit
e26801f2e6
|
@ -216,6 +216,7 @@ class nova::compute (
|
||||||
$cpu_shared_set_real = pick(join(any2array($cpu_shared_set), ','), $::os_service_default)
|
$cpu_shared_set_real = pick(join(any2array($cpu_shared_set), ','), $::os_service_default)
|
||||||
|
|
||||||
include ::nova::pci
|
include ::nova::pci
|
||||||
|
include ::nova::compute::vgpu
|
||||||
|
|
||||||
if $keymgr_api_class {
|
if $keymgr_api_class {
|
||||||
warning('The keymgr_api_class parameter is deprecated, use keymgr_backend')
|
warning('The keymgr_api_class parameter is deprecated, use keymgr_backend')
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
# Class nova::compute::vgpu
|
||||||
|
#
|
||||||
|
# Configures nova compute vgpu options
|
||||||
|
#
|
||||||
|
# === Parameters:
|
||||||
|
#
|
||||||
|
# [*enabled_vgpu_types*]
|
||||||
|
# (optional) Specify which specific GPU type(s) the instances can get
|
||||||
|
# Defaults to $::os_service_default
|
||||||
|
# Example: 'nvidia-35' or ['nvidia-35', 'nvidia-36']
|
||||||
|
|
||||||
|
class nova::compute::vgpu(
|
||||||
|
$enabled_vgpu_types = $::os_service_default
|
||||||
|
) {
|
||||||
|
include ::nova::deps
|
||||||
|
|
||||||
|
nova_config {
|
||||||
|
'devices/enabled_vgpu_types': value => join(any2array($enabled_vgpu_types), ',');
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Exposes the devices/enabled_vgpu_types config option for vgpu support.
|
||||||
|
More information in the `nova vgpu documentation <https://docs.openstack.org/nova/latest/admin/virtual-gpu.html>`_.
|
|
@ -0,0 +1,51 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe 'nova::compute::vgpu' do
|
||||||
|
|
||||||
|
shared_examples_for 'nova-compute-vgpu' do
|
||||||
|
context 'with default parameters' do
|
||||||
|
it 'clears vgpu devices' do
|
||||||
|
is_expected.to contain_nova_config('devices/enabled_vgpu_types').with(:value => '<SERVICE DEFAULT>')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with vgpu device' do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:enabled_vgpu_types => "nvidia-35",
|
||||||
|
}
|
||||||
|
end
|
||||||
|
it 'configures nova vgpu device entries' do
|
||||||
|
is_expected.to contain_nova_config('devices/enabled_vgpu_types').with(
|
||||||
|
'value' => 'nvidia-35'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with multiple vgpu devices' do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:enabled_vgpu_types => ["nvidia-35","nvidia-36"]
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'configures nova vgpu device entries' do
|
||||||
|
is_expected.to contain_nova_config('devices/enabled_vgpu_types').with(
|
||||||
|
'value' => "nvidia-35,nvidia-36"
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
on_supported_os({
|
||||||
|
:supported_os => OSDefaults.get_supported_os
|
||||||
|
}).each do |os,facts|
|
||||||
|
context "on #{os}" do
|
||||||
|
let (:facts) do
|
||||||
|
facts.merge!(OSDefaults.get_facts())
|
||||||
|
end
|
||||||
|
|
||||||
|
it_configures 'nova-compute-vgpu'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue