Browse Source

Add support for the resource_provider_default_hypervisor parameter

Conflicts:
    manifests/agents/ml2/ovs.pp

Related-Bug: #1926693
Depends-on: https://review.opendev.org/796836
Change-Id: I35c0a76cade37ccbaf7920b30ac162fe0f49e173
(cherry picked from commit 38d85c0e78)
(cherry picked from commit 768c15c4ec)
(cherry picked from commit 15a3ccaefc)
(cherry picked from commit 863a7d2253)
changes/14/817414/2
Takashi Kajinami 11 months ago
parent
commit
db82fc60d8
  1. 11
      manifests/agents/ml2/ovs.pp
  2. 33
      manifests/agents/ml2/sriov.pp
  3. 7
      releasenotes/notes/resource_provider_default_hypervisor-0d27eb32e2cde997.yaml
  4. 9
      spec/classes/neutron_agents_ml2_ovs_spec.rb
  5. 13
      spec/classes/neutron_agents_ml2_sriov_spec.rb

11
manifests/agents/ml2/ovs.pp

@ -193,6 +193,11 @@
# (optional) List of <bridge>:<hypervisor>
# 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 {

33
manifests/agents/ml2/sriov.pp

@ -77,18 +77,24 @@
# (optional) List of <bridge>:<hypervisor>
# 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;
}
}

7
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.

9
spec/classes/neutron_agents_ml2_ovs_spec.rb

@ -70,6 +70,8 @@ describe 'neutron::agents::ml2::ovs' do
with_value('<SERVICE DEFAULT>')
should contain_neutron_agent_ovs('ovs/resource_provider_hypervisors').\
with_value('<SERVICE DEFAULT>')
should contain_neutron_agent_ovs('ovs/resource_provider_default_hypervisor').\
with_value('<SERVICE DEFAULT>')
should contain_neutron_agent_ovs('agent/explicitly_egress_direct').with_value(['<SERVICE DEFAULT>'])
should contain_neutron_agent_ovs('network_log/rate_limit').with_value('<SERVICE DEFAULT>')
should contain_neutron_agent_ovs('network_log/burst_limit').with_value('<SERVICE DEFAULT>')
@ -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

13
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('<SERVICE DEFAULT>')
should contain_neutron_sriov_agent_config('sriov_nic/resource_provider_hypervisors').\
with_value('<SERVICE DEFAULT>')
should contain_neutron_sriov_agent_config('sriov_nic/resource_provider_default_hypervisor').\
with_value('<SERVICE DEFAULT>')
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

Loading…
Cancel
Save