diff --git a/manifests/agents/n1kv_vem.pp b/manifests/agents/n1kv_vem.pp index cad0eaaa5..b62df0b9a 100644 --- a/manifests/agents/n1kv_vem.pp +++ b/manifests/agents/n1kv_vem.pp @@ -91,6 +91,14 @@ # (optional) Whether to start/stop the service # Defaults to true # +# [*portdb*] +# (optional) PortDB (ovs|vem) +# Defaults to ovs +# +# [*fastpath_flood*] +# (optional) Handle broadcast floods and unknown pkts in fastpath(KLM) +# Defaults to disable +# class neutron::agents::n1kv_vem ( $n1kv_vsm_ip = '127.0.0.1', $n1kv_vsm_domain_id = 1000, @@ -103,10 +111,13 @@ class neutron::agents::n1kv_vem ( $n1kv_version = 'present', $package_ensure = 'present', $enable = true, - $manage_service = true + $manage_service = true, + $portdb = 'ovs', + $fastpath_flood = 'disable' ) { include ::neutron::params + require vswitch::ovs Exec { path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ] } @@ -134,11 +145,6 @@ class neutron::agents::n1kv_vem ( name => $::neutron::params::libnl_package } - package { 'openvswitch': - ensure => $package_ensure, - name => $::neutron::params::ovs_package - } - file { '/etc/n1kv': ensure => directory, @@ -229,7 +235,7 @@ class neutron::agents::n1kv_vem ( } Package['libnl'] -> Package['nexus1000v'] - Package['openvswitch'] -> Package['nexus1000v'] + Service['openvswitch'] ~> Package['nexus1000v'] File['/etc/n1kv/n1kv.conf'] -> Package['nexus1000v'] Package['nexus1000v'] ~> Service['nexus1000v'] } diff --git a/spec/classes/neutron_agents_n1kv_vem_spec.rb b/spec/classes/neutron_agents_n1kv_vem_spec.rb index 9b7a4b1b5..4eeee17e6 100644 --- a/spec/classes/neutron_agents_n1kv_vem_spec.rb +++ b/spec/classes/neutron_agents_n1kv_vem_spec.rb @@ -17,7 +17,7 @@ describe 'neutron::agents::n1kv_vem' do it 'install n1kv-vem' do should contain_package('libnl').with_before('Package[nexus1000v]') - should contain_package('openvswitch').with_before('Package[nexus1000v]') + should contain_service('openvswitch').with_notify('Package[nexus1000v]') should contain_package('nexus1000v').with_notify('Service[nexus1000v]') should contain_service('nexus1000v').with_ensure('running') end @@ -66,7 +66,9 @@ describe 'neutron::agents::n1kv_vem' do { :n1kv_vsm_ip => '9.0.0.1', :n1kv_vsm_domain_id => 900, - :host_mgmt_intf => 'eth9' + :host_mgmt_intf => 'eth9', + :portdb => 'ovs', + :fastpath_flood => 'disable' } end it do @@ -76,12 +78,16 @@ describe 'neutron::agents::n1kv_vem' do .with_content(/^switch-domain 900/) should contain_file('/etc/n1kv/n1kv.conf') \ .with_content(/^host-mgmt-intf eth9/) + should contain_file('/etc/n1kv/n1kv.conf') \ + .with_content(/^portdb ovs/) should contain_file('/etc/n1kv/n1kv.conf') \ .without_content(/^phys/) should contain_file('/etc/n1kv/n1kv.conf') \ .without_content(/^virt/) should contain_file('/etc/n1kv/n1kv.conf') \ .with_content(/^node-type compute/) + should contain_file('/etc/n1kv/n1kv.conf') \ + .with_content(/^fastpath-flood disable/) end end @@ -99,6 +105,34 @@ describe 'neutron::agents::n1kv_vem' do end end + context 'verify portdb' do + let :params do + { + :portdb => 'vem', + } + end + it do + should contain_file('/etc/n1kv/n1kv.conf') \ + .with_content(/^portdb vem/) + should contain_file('/etc/n1kv/n1kv.conf') \ + .without_content(/^portdb ovs/) + end + end + + context 'verify fastpath_flood' do + let :params do + { + :fastpath_flood => 'enable', + } + end + it do + should contain_file('/etc/n1kv/n1kv.conf') \ + .with_content(/^fastpath-flood enable/) + should contain_file('/etc/n1kv/n1kv.conf') \ + .without_content(/^fastpath-flood disable/) + end + end + context 'verify n1kv.conf with uplinks' do let :params do { diff --git a/templates/n1kv.conf.erb b/templates/n1kv.conf.erb index 8edb3e2d3..dd9409432 100644 --- a/templates/n1kv.conf.erb +++ b/templates/n1kv.conf.erb @@ -81,6 +81,15 @@ virt <%= port%> profile <%= params['profile']%> mode static address <%= params[' # uvem-ovs-brname n1kvdvs uvem-ovs-brname br-int +# TAG: portdb +# Description: PortDB (ovs|vem) +# Optional: YES. +# Default: ovs +# restart_on_modify: Yes +# Format: +# portdb vem +portdb <%= @portdb %> + # TAG: node-type # Description: Type of Node: 'compute' (or) 'neutron' # Optional: YES. @@ -150,3 +159,11 @@ node-type <%= @node_type %> # restart_on_modify: Yes # Format: dp-thread-socket-rrnglen <0..16384> # Note: 0 - disables memory map I/O + +# TAG: fastpath-flood +# Description: Enable flood of broadcast and unknown pkts in KLM +# Optional: YES +# Default: disable +# restart_on_modify: Yes +# Format: fastpath-flood +fastpath-flood <%= @fastpath_flood %>