Add support for resource provider bandwidth in Neutron config
Neutron introduced bandwidth aware scheduling some time ago. In [1]
new config options to set up available bandwidth in ovs agent was
introduced.
In [2] similar config options for SR-IOV agent was also added.
This patch adds support for both of them in neutron puppet module.
Related Tripleo-heat-templates patch is [3]
[1] https://review.opendev.org/#/c/577223/
[2] https://review.opendev.org/#/c/581364/
[3] https://review.opendev.org/#/c/714464/
Conflicts:
manifests/agents/ml2/ovs.pp
Change-Id: Iba2b73adcf68407994a0651351babcb6cd9ddff3
(cherry picked from commit 9c8dce5255
)
This commit is contained in:
parent
d1099ba102
commit
0a45ec7302
|
@ -185,48 +185,53 @@
|
|||
# mechanism driver for Neutron.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*resource_provider_bandwidths*]
|
||||
# (optional) List of <bridge>:<egress_bw>:<ingress_bw>
|
||||
# Defaults to empty list
|
||||
#
|
||||
# DEPRECATED
|
||||
#
|
||||
# [*of_interface*]
|
||||
# (optional) This option is deprecated an has no effect
|
||||
#
|
||||
class neutron::agents::ml2::ovs (
|
||||
$package_ensure = 'present',
|
||||
$enabled = true,
|
||||
$manage_service = true,
|
||||
$extensions = $::os_service_default,
|
||||
$bridge_uplinks = [],
|
||||
$bridge_mappings = [],
|
||||
$ovsdb_timeout = $::os_service_default,
|
||||
$of_connect_timeout = $::os_service_default,
|
||||
$of_request_timeout = $::os_service_default,
|
||||
$of_inactivity_probe = $::os_service_default,
|
||||
$integration_bridge = 'br-int',
|
||||
$tunnel_types = [],
|
||||
$local_ip = false,
|
||||
$tunnel_bridge = 'br-tun',
|
||||
$vxlan_udp_port = 4789,
|
||||
$polling_interval = $::os_service_default,
|
||||
$l2_population = $::os_service_default,
|
||||
$arp_responder = $::os_service_default,
|
||||
$firewall_driver = 'iptables_hybrid',
|
||||
$enable_distributed_routing = $::os_service_default,
|
||||
$drop_flows_on_start = false,
|
||||
$manage_vswitch = true,
|
||||
$int_peer_patch_port = $::os_service_default,
|
||||
$tun_peer_patch_port = $::os_service_default,
|
||||
$datapath_type = $::os_service_default,
|
||||
$vhostuser_socket_dir = $::os_service_default,
|
||||
$ovsdb_interface = $::os_service_default,
|
||||
$purge_config = false,
|
||||
$enable_dpdk = false,
|
||||
$enable_security_group = $::os_service_default,
|
||||
$permitted_ethertypes = $::os_service_default,
|
||||
$minimize_polling = $::os_service_default,
|
||||
$tunnel_csum = $::os_service_default,
|
||||
$igmp_snooping_enable = $::os_service_default,
|
||||
$package_ensure = 'present',
|
||||
$enabled = true,
|
||||
$manage_service = true,
|
||||
$extensions = $::os_service_default,
|
||||
$bridge_uplinks = [],
|
||||
$bridge_mappings = [],
|
||||
$ovsdb_timeout = $::os_service_default,
|
||||
$of_connect_timeout = $::os_service_default,
|
||||
$of_request_timeout = $::os_service_default,
|
||||
$of_inactivity_probe = $::os_service_default,
|
||||
$integration_bridge = 'br-int',
|
||||
$tunnel_types = [],
|
||||
$local_ip = false,
|
||||
$tunnel_bridge = 'br-tun',
|
||||
$vxlan_udp_port = 4789,
|
||||
$polling_interval = $::os_service_default,
|
||||
$l2_population = $::os_service_default,
|
||||
$arp_responder = $::os_service_default,
|
||||
$firewall_driver = 'iptables_hybrid',
|
||||
$enable_distributed_routing = $::os_service_default,
|
||||
$drop_flows_on_start = false,
|
||||
$manage_vswitch = true,
|
||||
$int_peer_patch_port = $::os_service_default,
|
||||
$tun_peer_patch_port = $::os_service_default,
|
||||
$datapath_type = $::os_service_default,
|
||||
$vhostuser_socket_dir = $::os_service_default,
|
||||
$ovsdb_interface = $::os_service_default,
|
||||
$purge_config = false,
|
||||
$enable_dpdk = false,
|
||||
$enable_security_group = $::os_service_default,
|
||||
$permitted_ethertypes = $::os_service_default,
|
||||
$minimize_polling = $::os_service_default,
|
||||
$tunnel_csum = $::os_service_default,
|
||||
$igmp_snooping_enable = $::os_service_default,
|
||||
$resource_provider_bandwidths = [],
|
||||
# DEPRECATED
|
||||
$of_interface = undef,
|
||||
$of_interface = undef,
|
||||
) {
|
||||
|
||||
include ::neutron::deps
|
||||
|
@ -317,6 +322,13 @@ class neutron::agents::ml2::ovs (
|
|||
}
|
||||
}
|
||||
|
||||
if ($resource_provider_bandwidths != []) {
|
||||
$res_prov_bw_map_str = join(any2array($resource_provider_bandwidths), ',')
|
||||
neutron_agent_ovs {
|
||||
'ovs/resource_provider_bandwidths': value => $res_prov_bw_map_str;
|
||||
}
|
||||
}
|
||||
|
||||
neutron_agent_ovs {
|
||||
'agent/polling_interval': value => $polling_interval;
|
||||
'agent/l2_population': value => $l2_population;
|
||||
|
|
|
@ -69,16 +69,21 @@
|
|||
# it as "eth1:4,eth2:10"
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*resource_provider_bandwidths*]
|
||||
# (optional) List of <network_device>:<egress_bw>:<ingress_bw>
|
||||
# Defaults to empty list
|
||||
#
|
||||
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,
|
||||
$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 = [],
|
||||
) {
|
||||
|
||||
include ::neutron::deps
|
||||
|
@ -123,4 +128,11 @@ class neutron::agents::ml2::sriov (
|
|||
tag => 'neutron-service',
|
||||
}
|
||||
|
||||
if ($resource_provider_bandwidths != []) {
|
||||
$res_prov_bw_map_str = join(any2array($resource_provider_bandwidths), ',')
|
||||
neutron_sriov_agent_config {
|
||||
'sriov_nic/resource_provider_bandwidths': value => $res_prov_bw_map_str;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,8 +23,18 @@
|
|||
# (required) Supported PCI vendor devices, defined by vendor_id:product_id according
|
||||
# to the PCI ID Repository. Default enables support for Intel and Mellanox SR-IOV capable NICs
|
||||
#
|
||||
# [*ovs_vnic_type_blacklist*]
|
||||
# (optional) list of VNIC types for which support in Neutron is
|
||||
# administratively prohibited by the OVS mechanism driver
|
||||
#
|
||||
# [*sriov_vnic_type_blacklist*]
|
||||
# (optional) list of VNIC types for which support in Neutron is
|
||||
# administratively prohibited by the SR-IOV mechanism driver
|
||||
#
|
||||
define neutron::plugins::ml2::mech_driver (
|
||||
$supported_pci_vendor_devs,
|
||||
$ovs_vnic_type_blacklist = [],
|
||||
$sriov_vnic_type_blacklist = [],
|
||||
){
|
||||
|
||||
include ::neutron::deps
|
||||
|
@ -51,4 +61,16 @@ define neutron::plugins::ml2::mech_driver (
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($ovs_vnic_type_blacklist != []) {
|
||||
neutron_plugin_ml2 {
|
||||
'ovs_driver/vnic_type_blacklist': value => join(any2array($ovs_vnic_type_blacklist), ',');
|
||||
}
|
||||
}
|
||||
|
||||
if ($sriov_vnic_type_blacklist != []) {
|
||||
neutron_plugin_ml2 {
|
||||
'sriov_driver/vnic_type_blacklist': value => join(any2array($sriov_vnic_type_blacklist), ',');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
Add support for resource provider bandwidth.
|
|
@ -66,6 +66,7 @@ describe 'neutron::agents::ml2::ovs' do
|
|||
should contain_neutron_agent_ovs('ovs/tun_peer_patch_port').with_ensure('absent')
|
||||
should contain_neutron_agent_ovs('agent/tunnel_types').with_ensure('absent')
|
||||
should contain_neutron_agent_ovs('ovs/igmp_snooping_enable').with_value('<SERVICE DEFAULT>')
|
||||
should_not contain_neutron_agent_ovs('ovs/resource_provider_bandwidths')
|
||||
end
|
||||
|
||||
it 'installs neutron ovs agent package' do
|
||||
|
@ -338,6 +339,16 @@ describe 'neutron::agents::ml2::ovs' do
|
|||
|
||||
it { should raise_error(Puppet::Error, /Enabling DPDK without manage vswitch does not have any effect/) }
|
||||
end
|
||||
|
||||
context 'when resource_provider_bandwidths is set' do
|
||||
before :each do
|
||||
params.merge!(:resource_provider_bandwidths => ['provider-a', 'provider-b'])
|
||||
end
|
||||
|
||||
it { should contain_neutron_agent_ovs('ovs/resource_provider_bandwidths').\
|
||||
with_value('provider-a,provider-b') }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
shared_examples 'neutron::agents::ml2::ovs on Debian' do
|
||||
|
|
|
@ -66,6 +66,10 @@ 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
|
||||
should_not contain_neutron_sriov_agent_config('sriov_nic/resource_provider_bandwidths')
|
||||
end
|
||||
|
||||
context 'when number_of_vfs is empty' do
|
||||
before :each do
|
||||
params.merge!(:number_of_vfs => "")
|
||||
|
@ -129,6 +133,17 @@ describe 'neutron::agents::ml2::sriov' do
|
|||
should contain_neutron_sriov_agent_config('agent/extensions').with_value(params[:extensions].join(','))
|
||||
end
|
||||
end
|
||||
|
||||
context 'when resource_provider_bandwidths is set' do
|
||||
before :each do
|
||||
params.merge!(:resource_provider_bandwidths => ['provider-a', 'provider-b'])
|
||||
end
|
||||
|
||||
it 'configures resource_provider_bandwidths' do
|
||||
should contain_neutron_sriov_agent_config('sriov_nic/resource_provider_bandwidths').\
|
||||
with_value('provider-a,provider-b')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
|
|
Loading…
Reference in New Issue