Browse Source

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 commit 73a1d56922)
(cherry picked from commit 490f7e56d2)
(cherry picked from commit 74d2389c2a)
changes/65/782765/4
Kamil Sambor 2 months ago
committed by Takashi Kajinami
parent
commit
9bbc14b4f2
3 changed files with 58 additions and 1 deletions
  1. +30
    -1
      manifests/controller.pp
  2. +6
    -0
      releasenotes/notes/ovn_chassis_mac_map-8ea1fa442ca20522.yaml
  3. +22
    -0
      spec/classes/ovn_controller_spec.rb

+ 30
- 1
manifests/controller.pp View File

@ -62,6 +62,20 @@
# If the value is nonzero, then it will be forced to a value of at least 5s.
# 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(
$ovn_remote,
$ovn_encap_ip,
@ -76,6 +90,7 @@ class ovn::controller(
$enable_dpdk = false,
$ovn_remote_probe_interval = 60000,
$ovn_openflow_probe_interval = 60,
$ovn_chassis_mac_map = [],
) {
include ::ovn::params
@ -120,6 +135,20 @@ class ovn::controller(
'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) {
$bridge_items = {
'external_ids:ovn-bridge-mappings' => { 'value' => join(any2array($ovn_bridge_mappings), ',') }
@ -149,7 +178,7 @@ class ovn::controller(
$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']
if !empty($ovn_bridge_mappings) {


+ 6
- 0
releasenotes/notes/ovn_chassis_mac_map-8ea1fa442ca20522.yaml View File

@ -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

+ 22
- 0
spec/classes/ovn_controller_spec.rb View File

@ -14,6 +14,8 @@ describe 'ovn::controller' do
:mac_table_size => 20000,
:ovn_remote_probe_interval => 30000,
:ovn_openflow_probe_interval => 8,
:ovn_chassis_mac_map => ['physnet1:aa:bb:cc:dd:ee:ff',
'physnet2:bb:aa:cc:dd:ee:ff']
}
end
@ -72,6 +74,10 @@ describe 'ovn::controller' do
is_expected.to contain_vs_config('external_ids:ovn-openflow-probe-interval').with(
: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
it 'configures bridge mappings' do
@ -89,6 +95,22 @@ describe 'ovn::controller' do
:require => 'Service[openvswitch]'
)
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
on_supported_os({


Loading…
Cancel
Save