diff --git a/manifests/agents/ml2/ovs.pp b/manifests/agents/ml2/ovs.pp index 87a17f0da..c82e9d2c8 100644 --- a/manifests/agents/ml2/ovs.pp +++ b/manifests/agents/ml2/ovs.pp @@ -193,6 +193,11 @@ # (optional) List of : # Defaults to empty list # +# [*resource_provider_default_hypervisor*] +# (optional) The default hypervisor name used to locate the parent of +# the resource provider. +# Defaults to $::os_service_default +# # [*explicitly_egress_direct*] # (optional) When set to True, the accepted egress unicast traffic will not # use action NORMAL. The accepted egress packets will be taken care of in the @@ -258,6 +263,7 @@ class neutron::agents::ml2::ovs ( $igmp_snooping_enable = $::os_service_default, $resource_provider_bandwidths = [], $resource_provider_hypervisors = [], + $resource_provider_default_hypervisor = $::os_service_default, $explicitly_egress_direct = $::os_service_default, $network_log_rate_limit = $::os_service_default, $network_log_burst_limit = $::os_service_default, @@ -367,8 +373,9 @@ class neutron::agents::ml2::ovs ( } neutron_agent_ovs { - 'ovs/resource_provider_bandwidths': value => $resource_provider_bandwidths_real; - 'ovs/resource_provider_hypervisors': value => $resource_provider_hypervisors_real; + 'ovs/resource_provider_bandwidths': value => $resource_provider_bandwidths_real; + 'ovs/resource_provider_hypervisors': value => $resource_provider_hypervisors_real; + 'ovs/resource_provider_default_hypervisor': value => $resource_provider_default_hypervisor; } neutron_agent_ovs { diff --git a/manifests/agents/ml2/sriov.pp b/manifests/agents/ml2/sriov.pp index 29f19faba..837e55165 100644 --- a/manifests/agents/ml2/sriov.pp +++ b/manifests/agents/ml2/sriov.pp @@ -77,18 +77,24 @@ # (optional) List of : # Defaults to empty list # +# [*resource_provider_default_hypervisor*] +# (optional) The default hypervisor name used to locate the parent of +# the resource provider. +# Defaults to $::os_service_default +# class neutron::agents::ml2::sriov ( - $package_ensure = 'present', - $enabled = true, - $manage_service = true, - $physical_device_mappings = $::os_service_default, - $polling_interval = 2, - $exclude_devices = $::os_service_default, - $extensions = $::os_service_default, - $purge_config = false, - $number_of_vfs = $::os_service_default, - $resource_provider_bandwidths = [], - $resource_provider_hypervisors = [], + $package_ensure = 'present', + $enabled = true, + $manage_service = true, + $physical_device_mappings = $::os_service_default, + $polling_interval = 2, + $exclude_devices = $::os_service_default, + $extensions = $::os_service_default, + $purge_config = false, + $number_of_vfs = $::os_service_default, + $resource_provider_bandwidths = [], + $resource_provider_hypervisors = [], + $resource_provider_default_hypervisor = $::os_service_default, ) { include ::neutron::deps @@ -146,8 +152,9 @@ class neutron::agents::ml2::sriov ( } neutron_sriov_agent_config { - 'sriov_nic/resource_provider_bandwidths': value => $resource_provider_bandwidths_real; - 'sriov_nic/resource_provider_hypervisors': value => $resource_provider_hypervisors_real; + 'sriov_nic/resource_provider_bandwidths': value => $resource_provider_bandwidths_real; + 'sriov_nic/resource_provider_hypervisors': value => $resource_provider_hypervisors_real; + 'sriov_nic/resource_provider_default_hypervisor': value => $resource_provider_default_hypervisor; } } diff --git a/releasenotes/notes/resource_provider_default_hypervisor-0d27eb32e2cde997.yaml b/releasenotes/notes/resource_provider_default_hypervisor-0d27eb32e2cde997.yaml new file mode 100644 index 000000000..0e7c572c9 --- /dev/null +++ b/releasenotes/notes/resource_provider_default_hypervisor-0d27eb32e2cde997.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + Now the ``neutron::agents::ml2::ovs`` class and + the ``neutron::agents::ml2::sriov`` class supports + the resource_provider_default_hypervisor parameter to set the corresponding + parameter in ovs-agent and sriov-agent. diff --git a/spec/classes/neutron_agents_ml2_ovs_spec.rb b/spec/classes/neutron_agents_ml2_ovs_spec.rb index 40d8c3bf7..b8c57d5e2 100644 --- a/spec/classes/neutron_agents_ml2_ovs_spec.rb +++ b/spec/classes/neutron_agents_ml2_ovs_spec.rb @@ -70,6 +70,8 @@ describe 'neutron::agents::ml2::ovs' do with_value('') should contain_neutron_agent_ovs('ovs/resource_provider_hypervisors').\ with_value('') + should contain_neutron_agent_ovs('ovs/resource_provider_default_hypervisor').\ + with_value('') should contain_neutron_agent_ovs('agent/explicitly_egress_direct').with_value(['']) should contain_neutron_agent_ovs('network_log/rate_limit').with_value('') should contain_neutron_agent_ovs('network_log/burst_limit').with_value('') @@ -350,8 +352,9 @@ describe 'neutron::agents::ml2::ovs' do context 'when parameters for resource providers are set' do before :each do params.merge!( - :resource_provider_bandwidths => ['provider-a', 'provider-b'], - :resource_provider_hypervisors => ['provider-a:compute-a', 'provider-b:compute-b'], + :resource_provider_bandwidths => ['provider-a', 'provider-b'], + :resource_provider_hypervisors => ['provider-a:compute-a', 'provider-b:compute-b'], + :resource_provider_default_hypervisor => 'compute-c', ) end @@ -360,6 +363,8 @@ describe 'neutron::agents::ml2::ovs' do with_value('provider-a,provider-b') should contain_neutron_agent_ovs('ovs/resource_provider_hypervisors').\ with_value('provider-a:compute-a,provider-b:compute-b') + should contain_neutron_agent_ovs('ovs/resource_provider_default_hypervisor').\ + with_value('compute-c') end end diff --git a/spec/classes/neutron_agents_ml2_sriov_spec.rb b/spec/classes/neutron_agents_ml2_sriov_spec.rb index 02d85dc8d..9463204e0 100644 --- a/spec/classes/neutron_agents_ml2_sriov_spec.rb +++ b/spec/classes/neutron_agents_ml2_sriov_spec.rb @@ -66,9 +66,13 @@ describe 'neutron::agents::ml2::sriov' do should contain_service('neutron-sriov-nic-agent-service').that_notifies('Anchor[neutron::service::end]') end - it 'does not configure resource_provider_bandwidths by default' do + it 'does not configure resource provider parameters by default' do should contain_neutron_sriov_agent_config('sriov_nic/resource_provider_bandwidths').\ with_value('') + should contain_neutron_sriov_agent_config('sriov_nic/resource_provider_hypervisors').\ + with_value('') + should contain_neutron_sriov_agent_config('sriov_nic/resource_provider_default_hypervisor').\ + with_value('') end context 'when number_of_vfs is empty' do @@ -138,8 +142,9 @@ describe 'neutron::agents::ml2::sriov' do context 'when parameters for resource providers are set' do before :each do params.merge!( - :resource_provider_bandwidths => ['provider-a', 'provider-b'], - :resource_provider_hypervisors => ['provider-a:compute-a', 'provider-b:compute-b'], + :resource_provider_bandwidths => ['provider-a', 'provider-b'], + :resource_provider_hypervisors => ['provider-a:compute-a', 'provider-b:compute-b'], + :resource_provider_default_hypervisor => 'compute-c' ) end @@ -148,6 +153,8 @@ describe 'neutron::agents::ml2::sriov' do with_value('provider-a,provider-b') should contain_neutron_sriov_agent_config('sriov_nic/resource_provider_hypervisors').\ with_value('provider-a:compute-a,provider-b:compute-b') + should contain_neutron_sriov_agent_config('sriov_nic/resource_provider_default_hypervisor').\ + with_value('compute-c') end end end