Added an parameter for neutron::agents::ml2::ovs to enable ovs-dpdk

puppet-vswitch will provide ovs and ovs with dpdk options.
ovs with dpdk has to be enabled only on compute nodes. Added
and option to configure via templates to enable dpdk.

Implements: blueprint tripleo-ovs-dpdk

Change-Id: I6cfd13d4979731696b09da52b2618fa33042403d
This commit is contained in:
Saravanan KR 2016-07-13 20:15:26 +05:30
parent e3665a8082
commit 9c867807c6
3 changed files with 50 additions and 2 deletions

View File

@ -136,6 +136,10 @@
# in the ovs config.
# Defaults to false.
#
# [*enable_dpdk*]
# (optional) Enable or not DPDK with OVS
# Defaults to false.
#
# === Deprecated Parameters
#
# [*prevent_arp_spoofing*]
@ -172,6 +176,7 @@ class neutron::agents::ml2::ovs (
$of_interface = $::os_service_default,
$ovsdb_interface = $::os_service_default,
$purge_config = false,
$enable_dpdk = false,
# DEPRECATED PARAMETERS
$prevent_arp_spoofing = $::os_service_default,
$enable_tunneling = false,
@ -179,8 +184,25 @@ class neutron::agents::ml2::ovs (
include ::neutron::deps
include ::neutron::params
if $enable_dpdk and ! $manage_vswitch {
fail('Enabling DPDK without manage vswitch does not have any effect')
}
if $enable_dpdk and is_service_default($datapath_type) {
fail('Datapath type for ovs agent must be set when DPDK is enabled')
}
if $enable_dpdk and is_service_default($vhostuser_socket_dir) {
fail('vhost user socket directory for ovs agent must be set when DPDK is enabled')
}
if $manage_vswitch {
require ::vswitch::ovs
if $enable_dpdk {
require ::vswitch::dpdk
} else {
require ::vswitch::ovs
}
}
if $enable_tunneling {

View File

@ -0,0 +1,3 @@
---
features:
- Support configuration when DPDK is enabled with OVS.

View File

@ -1,7 +1,6 @@
require 'spec_helper'
describe 'neutron::agents::ml2::ovs' do
let :pre_condition do
"class { 'neutron': rabbit_password => 'passw0rd' }"
end
@ -19,6 +18,7 @@ describe 'neutron::agents::ml2::ovs' do
:firewall_driver => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver',
:manage_vswitch => true,
:purge_config => false,
:enable_dpdk => false,
}
end
@ -299,6 +299,14 @@ describe 'neutron::agents::ml2::ovs' do
end
end
end
context 'when enabling dpdk with manage vswitch disabled' do
before :each do
params.merge!(:enable_dpdk => true, :manage_vswitch => false)
end
it_raises 'a Puppet::Error',/Enabling DPDK without manage vswitch does not have any effect/
end
end
context 'on Debian platforms' do
@ -340,5 +348,20 @@ describe 'neutron::agents::ml2::ovs' do
is_expected.to contain_package('neutron-ovs-agent').that_requires('Anchor[neutron::install::begin]')
is_expected.to contain_package('neutron-ovs-agent').that_notifies('Anchor[neutron::install::end]')
end
context 'when enabling dpdk with manage vswitch is default' do
let :pre_condition do
"class { 'vswitch::dpdk': core_list => '1,2', memory_channels => '1' }"
end
before :each do
params.merge!(:enable_dpdk => true,
:datapath_type => 'netdev',
:vhostuser_socket_dir => '/var/run/openvswitch')
end
it 'should require vswitch::dpdk' do
is_expected.to contain_class('vswitch::dpdk')
end
end
end
end