Skip to content

Commit e3d88ab

Browse files
Dulanjalieimcsk8
authored andcommitted
Adding portdb and fastpath_flood to n1kv.conf
Also need to remove installing explicit installation of openvswitch and call vswitch::ovs instead. Adding testcases to neutron_agents_n1kv_vem_spec.rb and fixing an error in neutron_plugins_ml2_spec.rb Change-Id: I2b4ada801610d7081ac3e2469bcacd6ea5ec8e7d Closes-Bug: 1421449 (cherry picked from commit ba0eb6f2f6db6b4a9d455a3ea54150ccc8020be7) Conflicts: manifests/agents/n1kv_vem.pp Change-Id: I133cc7a184be8508470e46381f19c6f209620fe1
1 parent 1e5e1b9 commit e3d88ab

3 files changed

Lines changed: 66 additions & 9 deletions

File tree

manifests/agents/n1kv_vem.pp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@
9191
# (optional) Whether to start/stop the service
9292
# Defaults to true
9393
#
94+
# [*portdb*]
95+
# (optional) PortDB (ovs|vem)
96+
# Defaults to ovs
97+
#
98+
# [*fastpath_flood*]
99+
# (optional) Handle broadcast floods and unknown pkts in fastpath(KLM)
100+
# Defaults to disable
101+
#
94102
class neutron::agents::n1kv_vem (
95103
$n1kv_vsm_ip = '127.0.0.1',
96104
$n1kv_vsm_domain_id = 1000,
@@ -103,10 +111,13 @@
103111
$n1kv_version = 'present',
104112
$package_ensure = 'present',
105113
$enable = true,
106-
$manage_service = true
114+
$manage_service = true,
115+
$portdb = 'ovs',
116+
$fastpath_flood = 'disable'
107117
) {
108118

109119
include neutron::params
120+
require vswitch::ovs
110121

111122
Exec { path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ] }
112123

@@ -134,11 +145,6 @@
134145
name => $::neutron::params::libnl_package
135146
}
136147

137-
package { 'openvswitch':
138-
ensure => $package_ensure,
139-
name => $::neutron::params::ovs_package
140-
}
141-
142148
file {
143149
'/etc/n1kv':
144150
ensure => directory,
@@ -229,7 +235,7 @@
229235
}
230236

231237
Package['libnl'] -> Package['nexus1000v']
232-
Package['openvswitch'] -> Package['nexus1000v']
238+
Service['openvswitch'] ~> Package['nexus1000v']
233239
File['/etc/n1kv/n1kv.conf'] -> Package['nexus1000v']
234240
Package['nexus1000v'] ~> Service['nexus1000v']
235241
}

spec/classes/neutron_agents_n1kv_vem_spec.rb

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
it 'install n1kv-vem' do
1919
should contain_package('libnl').with_before('Package[nexus1000v]')
20-
should contain_package('openvswitch').with_before('Package[nexus1000v]')
20+
should contain_service('openvswitch').with_notify('Package[nexus1000v]')
2121
should contain_package('nexus1000v').with_notify('Service[nexus1000v]')
2222
should contain_service('nexus1000v').with_ensure('running')
2323
end
@@ -66,7 +66,9 @@
6666
{
6767
:n1kv_vsm_ip => '9.0.0.1',
6868
:n1kv_vsm_domain_id => 900,
69-
:host_mgmt_intf => 'eth9'
69+
:host_mgmt_intf => 'eth9',
70+
:portdb => 'ovs',
71+
:fastpath_flood => 'disable'
7072
}
7173
end
7274
it do
@@ -76,12 +78,16 @@
7678
.with_content(/^switch-domain 900/)
7779
should contain_file('/etc/n1kv/n1kv.conf') \
7880
.with_content(/^host-mgmt-intf eth9/)
81+
should contain_file('/etc/n1kv/n1kv.conf') \
82+
.with_content(/^portdb ovs/)
7983
should contain_file('/etc/n1kv/n1kv.conf') \
8084
.without_content(/^phys/)
8185
should contain_file('/etc/n1kv/n1kv.conf') \
8286
.without_content(/^virt/)
8387
should contain_file('/etc/n1kv/n1kv.conf') \
8488
.with_content(/^node-type compute/)
89+
should contain_file('/etc/n1kv/n1kv.conf') \
90+
.with_content(/^fastpath-flood disable/)
8591
end
8692
end
8793

@@ -99,6 +105,34 @@
99105
end
100106
end
101107

108+
context 'verify portdb' do
109+
let :params do
110+
{
111+
:portdb => 'vem',
112+
}
113+
end
114+
it do
115+
should contain_file('/etc/n1kv/n1kv.conf') \
116+
.with_content(/^portdb vem/)
117+
should contain_file('/etc/n1kv/n1kv.conf') \
118+
.without_content(/^portdb ovs/)
119+
end
120+
end
121+
122+
context 'verify fastpath_flood' do
123+
let :params do
124+
{
125+
:fastpath_flood => 'enable',
126+
}
127+
end
128+
it do
129+
should contain_file('/etc/n1kv/n1kv.conf') \
130+
.with_content(/^fastpath-flood enable/)
131+
should contain_file('/etc/n1kv/n1kv.conf') \
132+
.without_content(/^fastpath-flood disable/)
133+
end
134+
end
135+
102136
context 'verify n1kv.conf with uplinks' do
103137
let :params do
104138
{

templates/n1kv.conf.erb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,15 @@ virt <%= port%> profile <%= params['profile']%> mode static address <%= params['
8181
# uvem-ovs-brname n1kvdvs
8282
uvem-ovs-brname br-int
8383

84+
# TAG: portdb
85+
# Description: PortDB (ovs|vem)
86+
# Optional: YES.
87+
# Default: ovs
88+
# restart_on_modify: Yes
89+
# Format:
90+
# portdb vem
91+
portdb <%= @portdb %>
92+
8493
# TAG: node-type
8594
# Description: Type of Node: 'compute' (or) 'neutron'
8695
# Optional: YES.
@@ -150,3 +159,11 @@ node-type <%= @node_type %>
150159
# restart_on_modify: Yes
151160
# Format: dp-thread-socket-rrnglen <0..16384>
152161
# Note: 0 - disables memory map I/O
162+
163+
# TAG: fastpath-flood
164+
# Description: Enable flood of broadcast and unknown pkts in KLM
165+
# Optional: YES
166+
# Default: disable
167+
# restart_on_modify: Yes
168+
# Format: fastpath-flood <enable|disable>
169+
fastpath-flood <%= @fastpath_flood %>

0 commit comments

Comments
 (0)