Merge "Revert "Remove parameter nova::compute::pci_passthrough"" into stable/victoria
This commit is contained in:
commit
b0c9f9c361
|
@ -290,6 +290,14 @@
|
||||||
# this should be set in the api.pp class instead.
|
# this should be set in the api.pp class instead.
|
||||||
# Defaults to undef
|
# Defaults to undef
|
||||||
#
|
#
|
||||||
|
# [*pci_passthrough*]
|
||||||
|
# DEPRECATED. Use nova::compute::pci::passthrough instead.
|
||||||
|
# (optional) Pci passthrough list of hash.
|
||||||
|
# Defaults to undef
|
||||||
|
# Example of format:
|
||||||
|
# [ { "vendor_id" => "1234","product_id" => "5678" },
|
||||||
|
# { "vendor_id" => "4321","product_id" => "8765", "physical_network" => "default" } ]
|
||||||
|
#
|
||||||
class nova::compute (
|
class nova::compute (
|
||||||
$enabled = true,
|
$enabled = true,
|
||||||
$manage_service = true,
|
$manage_service = true,
|
||||||
|
@ -347,6 +355,7 @@ class nova::compute (
|
||||||
$install_bridge_utils = undef,
|
$install_bridge_utils = undef,
|
||||||
$vcpu_pin_set = undef,
|
$vcpu_pin_set = undef,
|
||||||
$allow_resize_to_same_host = undef,
|
$allow_resize_to_same_host = undef,
|
||||||
|
$pci_passthrough = undef,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include nova::deps
|
include nova::deps
|
||||||
|
@ -361,6 +370,12 @@ class nova::compute (
|
||||||
$max_concurrent_builds)
|
$max_concurrent_builds)
|
||||||
|
|
||||||
include nova::pci
|
include nova::pci
|
||||||
|
if $pci_passthrough {
|
||||||
|
# Note: also remove the pick from nova::compute::pci
|
||||||
|
warning('The pci_passthrough parameter is deprecated and will be removed in X. Please use nova::compute::pci::passthrough instead.')
|
||||||
|
}
|
||||||
|
include nova::compute::pci
|
||||||
|
|
||||||
include nova::compute::vgpu
|
include nova::compute::vgpu
|
||||||
|
|
||||||
if $neutron_enabled {
|
if $neutron_enabled {
|
||||||
|
|
|
@ -85,6 +85,11 @@ describe 'nova::compute' do
|
||||||
is_expected.to contain_package('genisoimage').that_requires('Anchor[nova::install::begin]')
|
is_expected.to contain_package('genisoimage').that_requires('Anchor[nova::install::begin]')
|
||||||
is_expected.to contain_package('genisoimage').that_comes_before('Anchor[nova::install::end]')
|
is_expected.to contain_package('genisoimage').that_comes_before('Anchor[nova::install::end]')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'configures nova pci_passthrough_whitelist' do
|
||||||
|
is_expected.to contain_class('nova::compute::pci')
|
||||||
|
is_expected.to contain_nova_config('pci/passthrough_whitelist').with(:value => '<SERVICE DEFAULT>')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with overridden parameters' do
|
context 'with overridden parameters' do
|
||||||
|
@ -211,6 +216,56 @@ describe 'nova::compute' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with pci params array' do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:pci_passthrough => [
|
||||||
|
{
|
||||||
|
"vendor_id" => "8086",
|
||||||
|
"product_id" => "0126"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"vendor_id" => "9096",
|
||||||
|
"product_id" => "1520",
|
||||||
|
"physical_network" => "physnet1"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'configures nova pci_passthrough_whitelist entries' do
|
||||||
|
is_expected.to contain_class('nova::compute::pci')
|
||||||
|
is_expected.to contain_nova_config('pci/passthrough_whitelist').with(
|
||||||
|
'value' => ['{"vendor_id":"8086","product_id":"0126"}','{"vendor_id":"9096","product_id":"1520","physical_network":"physnet1"}']
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with pci params JSON encoded string (deprecated)' do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:pci_passthrough => "[{\"vendor_id\":\"8086\",\"product_id\":\"0126\"},{\"vendor_id\":\"9096\",\"product_id\":\"1520\",\"physical_network\":\"physnet1\"}]",
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'configures nova pci_passthrough_whitelist entries' do
|
||||||
|
is_expected.to contain_class('nova::compute::pci')
|
||||||
|
is_expected.to contain_nova_config('pci/passthrough_whitelist').with(
|
||||||
|
'value' => ['{"vendor_id":"8086","product_id":"0126"}','{"vendor_id":"9096","product_id":"1520","physical_network":"physnet1"}']
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when vcpu_pin_set and pci params are empty' do
|
||||||
|
let :params do
|
||||||
|
{ :pci_passthrough => ""}
|
||||||
|
end
|
||||||
|
it 'clears pci_passthrough configuration' do
|
||||||
|
is_expected.to contain_class('nova::compute::pci')
|
||||||
|
is_expected.to contain_nova_config('pci/passthrough_whitelist').with(:value => '<SERVICE DEFAULT>')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context 'with reserved_huge_pages array' do
|
context 'with reserved_huge_pages array' do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue