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

Related-Bug: #1881593
Co-Authored-By: Takashi Kajinami <tkajinam@redhat.com>
Change-Id: Iddca7d8942bc52127525847f129eac8ea03934a1
(cherry picked from commit 73a1d56922)
changes/59/782759/7
Kamil Sambor 2 months ago
committed by Takashi Kajinami
parent
commit
490f7e56d2
3 changed files with 57 additions and 1 deletions
  1. +30
    -1
      manifests/controller.pp
  2. +6
    -0
      releasenotes/notes/ovn_chassis_mac_map-8ea1fa442ca20522.yaml
  3. +21
    -0
      spec/classes/ovn_controller_spec.rb

+ 30
- 1
manifests/controller.pp View File

@ -66,6 +66,20 @@
# (optional) List of the transport zones to which the chassis belongs to.
# Defaults to empty list
#
# [*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,
@ -81,6 +95,7 @@ class ovn::controller(
$ovn_remote_probe_interval = 60000,
$ovn_openflow_probe_interval = 60,
$ovn_transport_zones = [],
$ovn_chassis_mac_map = [],
) {
include ovn::params
@ -125,6 +140,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), ',') }
@ -162,7 +191,7 @@ class ovn::controller(
$datapath_config = {}
}
create_resources('vs_config', merge($config_items, $bridge_items, $tz_items, $hw_offload, $datapath_config))
create_resources('vs_config', merge($config_items, $chassis_mac_map, $bridge_items, $tz_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

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

@ -15,6 +15,8 @@ describe 'ovn::controller' do
:ovn_remote_probe_interval => 30000,
:ovn_openflow_probe_interval => 8,
:ovn_transport_zones => ['tz1'],
:ovn_chassis_mac_map => ['physnet1:aa:bb:cc:dd:ee:ff',
'physnet2:bb:aa:cc:dd:ee:ff']
}
end
@ -78,6 +80,9 @@ describe 'ovn::controller' do
:value => params[:ovn_transport_zones],
)
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
@ -95,6 +100,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