Fix the way SRIOV is checked on compute nodes

supported_pci_vendor_devs can't be used as SRIOV indicator as it's a cluster
wide variable and it's possible that some compute nodes uses SRIOV and others
don't. nic_whitelist_to_mappings function is a better option as it relies on
a network scheme of a current node

Change-Id: Idd4f9b5e1bf142713b4d849e4406778ad411b3ac
Closes-bug: #1561018
This commit is contained in:
Sergey Kolekonov 2016-03-23 18:25:35 +03:00 committed by Vladimir Eremin
parent 62756e42ab
commit ed36c837e0
2 changed files with 13 additions and 12 deletions

View File

@ -5,12 +5,11 @@ class osnailyfacter::openstack_network::agents::sriov {
$use_neutron = hiera('use_neutron', false)
$network_scheme = hiera_hash('network_scheme', {})
$neutron_config = hiera_hash('neutron_config')
$pci_vendor_devs = pick($neutron_config['supported_pci_vendor_devs'], false)
if $use_neutron and $pci_vendor_devs {
prepare_network_config($network_scheme)
$pci_passthrough_whitelist = get_nic_passthrough_whitelist('sriov')
prepare_network_config($network_scheme)
$pci_passthrough_whitelist = get_nic_passthrough_whitelist('sriov')
if $use_neutron and $pci_passthrough_whitelist {
$physical_device_mappings = nic_whitelist_to_mappings($pci_passthrough_whitelist)
class { '::neutron::agents::ml2::sriov':

View File

@ -11,10 +11,8 @@ describe manifest do
end
end
enable_sriov = Noop.hiera_structure 'quantum_settings/supported_pci_vendor_devs', false
shared_examples 'catalog' do
if Noop.hiera('use_neutron') and enable_sriov
if Noop.hiera('use_neutron')
let(:network_scheme) do
Noop.hiera_hash('network_scheme', {})
@ -30,11 +28,15 @@ describe manifest do
end
context 'with Neutron SRIOV agent' do
it { should contain_class('neutron::agents::ml2::sriov').with(
'manage_service' => true,
'enabled' => true,
'physical_device_mappings' => Noop.puppet_function('nic_whitelist_to_mappings', pci_passthrough)
)}
it 'configures SRIOV agent' do
if pci_passthrough
should contain_class('neutron::agents::ml2::sriov').with(
'manage_service' => true,
'enabled' => true,
'physical_device_mappings' => Noop.puppet_function('nic_whitelist_to_mappings', pci_passthrough)
)
end
end
end
end