Expose devices/enabled_vgpu_types config option
This exposes the devices/enabled_vgpu_types config option which is required for vgpu support. bp tripleo-vgpu Change-Id: I418b5ed3ee43f8621c2997980d17fa20861d009d
This commit is contained in:
parent
ab23e15292
commit
7b6c0424a3
@ -208,6 +208,7 @@ class nova::compute (
|
||||
$vcpu_pin_set_real = pick(join(any2array($vcpu_pin_set), ','), $::os_service_default)
|
||||
|
||||
include ::nova::pci
|
||||
include ::nova::compute::vgpu
|
||||
|
||||
if $keymgr_api_class {
|
||||
warning('The keymgr_api_class parameter is deprecated, use keymgr_backend')
|
||||
|
20
manifests/compute/vgpu.pp
Normal file
20
manifests/compute/vgpu.pp
Normal file
@ -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), ',');
|
||||
}
|
||||
}
|
5
releasenotes/notes/vgpu_devices-4441729018e59ee1.yaml
Normal file
5
releasenotes/notes/vgpu_devices-4441729018e59ee1.yaml
Normal file
@ -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>`_.
|
51
spec/classes/nova_compute_vgpu_spec.rb
Normal file
51
spec/classes/nova_compute_vgpu_spec.rb
Normal file
@ -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
Block a user