Set external_ids:ovn-chassis-mac-mappings
For distributed vlan in ovn we need to add support of creating mac addresses per compute and seting them in external_ids:ovn-chassis-mac-mappings. Conflicts: manifests/controller.pp spec/classes/ovn_controller_spec.rb Backport note to Victoria: Resolved conflicts caused by the enable_ovn_match_northd parameter[1] which is not backported to Victoria. [1]392ad7946e
Backport note to Ussuri: Resolved conflicts caused by the ovn_transport_zones parameter[2] which is not backported to Ussuri. [2]dba349dad0
Related-Bug: #1881593 Co-Authored-By: Takashi Kajinami <tkajinam@redhat.com> Change-Id: Iddca7d8942bc52127525847f129eac8ea03934a1 (cherry picked from commit73a1d56922
) (cherry picked from commit490f7e56d2
) (cherry picked from commit74d2389c2a
)
This commit is contained in:
parent
192ac4e67e
commit
9bbc14b4f2
|
@ -62,6 +62,20 @@
|
||||||
# If the value is nonzero, then it will be forced to a value of at least 5s.
|
# If the value is nonzero, then it will be forced to a value of at least 5s.
|
||||||
# Defaults to 60
|
# Defaults to 60
|
||||||
#
|
#
|
||||||
|
# [*ovn_chassis_mac_map*]
|
||||||
|
# (optional) A list or a hash of key-value pairs that map a chassis specific mac to
|
||||||
|
# a physical network name. An example value mapping two chassis macs to
|
||||||
|
# two physical network names would be:
|
||||||
|
# physnet1:aa:bb:cc:dd:ee:ff,physnet2:a1:b2:c3:d4:e5:f6 or
|
||||||
|
# {
|
||||||
|
# physnet1 => aa:bb:cc:dd:ee:ff,
|
||||||
|
# physnet2 => a1:b2:c3:d4:e5:f6
|
||||||
|
# }
|
||||||
|
# These are the macs that ovn-controller will replace a router port
|
||||||
|
# mac with, if packet is going from a distributed router port on
|
||||||
|
# vlan type logical switch.
|
||||||
|
# Defaults to empty list
|
||||||
|
#
|
||||||
class ovn::controller(
|
class ovn::controller(
|
||||||
$ovn_remote,
|
$ovn_remote,
|
||||||
$ovn_encap_ip,
|
$ovn_encap_ip,
|
||||||
|
@ -76,6 +90,7 @@ class ovn::controller(
|
||||||
$enable_dpdk = false,
|
$enable_dpdk = false,
|
||||||
$ovn_remote_probe_interval = 60000,
|
$ovn_remote_probe_interval = 60000,
|
||||||
$ovn_openflow_probe_interval = 60,
|
$ovn_openflow_probe_interval = 60,
|
||||||
|
$ovn_chassis_mac_map = [],
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::ovn::params
|
include ::ovn::params
|
||||||
|
@ -120,6 +135,20 @@ class ovn::controller(
|
||||||
'external_ids:ovn-openflow-probe-interval' => { 'value' => "${ovn_openflow_probe_interval}" },
|
'external_ids:ovn-openflow-probe-interval' => { 'value' => "${ovn_openflow_probe_interval}" },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !empty($ovn_chassis_mac_map) {
|
||||||
|
if $ovn_chassis_mac_map =~ Hash {
|
||||||
|
$chassis_mac_map = {
|
||||||
|
'external_ids:ovn-chassis-mac-mappings' => { 'value' => join(join_keys_to_values($ovn_chassis_mac_map, ':'), ',') }
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$chassis_mac_map = {
|
||||||
|
'external_ids:ovn-chassis-mac-mappings' => { 'value' => join(any2array($ovn_chassis_mac_map), ',') }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$chassis_mac_map = {}
|
||||||
|
}
|
||||||
|
|
||||||
if !empty($ovn_bridge_mappings) {
|
if !empty($ovn_bridge_mappings) {
|
||||||
$bridge_items = {
|
$bridge_items = {
|
||||||
'external_ids:ovn-bridge-mappings' => { 'value' => join(any2array($ovn_bridge_mappings), ',') }
|
'external_ids:ovn-bridge-mappings' => { 'value' => join(any2array($ovn_bridge_mappings), ',') }
|
||||||
|
@ -149,7 +178,7 @@ class ovn::controller(
|
||||||
$datapath_config = {}
|
$datapath_config = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
create_resources('vs_config', merge($config_items, $bridge_items, $hw_offload, $datapath_config))
|
create_resources('vs_config', merge($config_items, $chassis_mac_map, $bridge_items, $hw_offload, $datapath_config))
|
||||||
Service['openvswitch'] -> Vs_config<||> -> Service['controller']
|
Service['openvswitch'] -> Vs_config<||> -> Service['controller']
|
||||||
|
|
||||||
if !empty($ovn_bridge_mappings) {
|
if !empty($ovn_bridge_mappings) {
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The new ``ovn::controller::ovn_chassis_mac_map`` parameter has been added.
|
||||||
|
For distributed vlan in ovn we need to set mac addresses per compute in
|
||||||
|
external_ids:ovn-chassis-mac-mappings
|
|
@ -14,6 +14,8 @@ describe 'ovn::controller' do
|
||||||
:mac_table_size => 20000,
|
:mac_table_size => 20000,
|
||||||
:ovn_remote_probe_interval => 30000,
|
:ovn_remote_probe_interval => 30000,
|
||||||
:ovn_openflow_probe_interval => 8,
|
:ovn_openflow_probe_interval => 8,
|
||||||
|
:ovn_chassis_mac_map => ['physnet1:aa:bb:cc:dd:ee:ff',
|
||||||
|
'physnet2:bb:aa:cc:dd:ee:ff']
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -72,6 +74,10 @@ describe 'ovn::controller' do
|
||||||
is_expected.to contain_vs_config('external_ids:ovn-openflow-probe-interval').with(
|
is_expected.to contain_vs_config('external_ids:ovn-openflow-probe-interval').with(
|
||||||
:value => params[:ovn_openflow_probe_interval],
|
:value => params[:ovn_openflow_probe_interval],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
is_expected.to contain_vs_config('external_ids:ovn-chassis-mac-mappings').with(
|
||||||
|
:value => 'physnet1:aa:bb:cc:dd:ee:ff,physnet2:bb:aa:cc:dd:ee:ff',
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'configures bridge mappings' do
|
it 'configures bridge mappings' do
|
||||||
|
@ -89,6 +95,22 @@ describe 'ovn::controller' do
|
||||||
:require => 'Service[openvswitch]'
|
:require => 'Service[openvswitch]'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when ovn_chassis_mac_map is a hash' do
|
||||||
|
before :each do
|
||||||
|
params.merge!({
|
||||||
|
:ovn_chassis_mac_map => {
|
||||||
|
'physnet1' => 'aa:bb:cc:dd:ee:ff',
|
||||||
|
'physnet2' => 'bb:aa:cc:dd:ee:ff' }
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'configures ovsdb' do
|
||||||
|
is_expected.to contain_vs_config('external_ids:ovn-chassis-mac-mappings').with(
|
||||||
|
:value => 'physnet1:aa:bb:cc:dd:ee:ff,physnet2:bb:aa:cc:dd:ee:ff',
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
on_supported_os({
|
on_supported_os({
|
||||||
|
|
Loading…
Reference in New Issue