From e3cb1b4a472e0c2743690af62768a96a1c2b8c00 Mon Sep 17 00:00:00 2001 From: Dmitrii Shcherbakov Date: Thu, 27 Jun 2024 17:17:37 +0300 Subject: [PATCH] Make the local chassis ID configurable ovn-controller can be configured with a system-id override file or -n option to use any suffix for OVSDB options. Currently ovn-bgp-agent just uses a constant "bgp" for this and there is no way to change it. https://github.com/ovn-org/ovn/commit/48db2a7a353a81aaa1795ef4b35b0fab1f0b0ccc Let's allow this suffix to be set via a config option instead. Change-Id: Ida30b46e16ddcdc2d82af980546876f72a845c1d --- .../drivers/ovn_bgp_mode_design.rst | 74 ++++++++++++++++++- ovn_bgp_agent/config.py | 7 ++ ovn_bgp_agent/constants.py | 1 - ovn_bgp_agent/drivers/openstack/utils/wire.py | 4 +- .../unit/drivers/openstack/utils/test_wire.py | 4 +- ovn_bgp_agent/utils/linux_net.py | 2 +- 6 files changed, 83 insertions(+), 9 deletions(-) diff --git a/doc/source/contributor/drivers/ovn_bgp_mode_design.rst b/doc/source/contributor/drivers/ovn_bgp_mode_design.rst index dcf8a73e..60c2f83e 100644 --- a/doc/source/contributor/drivers/ovn_bgp_mode_design.rst +++ b/doc/source/contributor/drivers/ovn_bgp_mode_design.rst @@ -69,12 +69,15 @@ The OVN routing architecture proposes the following mapping: (``br-osp``). - ``br-osp`` does not have any physical resources attached, just patch - ports connecting them to ``br-int`` and ``br-bgp``. + ports connecting them to ``br-int`` and ``br-bgp``. The name of this bridge can + be arbitrary so long as ovn-bridge-mappings for both OVN clusters (the primary and + the extra node-local one) are set accordingly. - ``br-bgp`` is the integration bridge managed by the extra OVN cluster deployed per node. This is where the virtual OVN resources are be created - (routers and switches). It creates mappings to ``br-osp`` and ``br-ex`` - (patch ports). + (routers and switches). OVN creates patch ports between ``br-osp`` and ``br-ex`` + based on ovn-bridge-mappings set for the extra OVN cluster. The name of this bridge + is configurable and can be changed by setting a relevant instance-specific OVSDB option. - ``br-ex`` keeps being the external bridge, where the physical NICs are attached (as in default environments without BGP). But instead of being @@ -236,6 +239,71 @@ range for the provider networks to expose/handle: external_nics=eth1,eth2 peer_ips=100.64.1.5,100.65.1.5 provider_networks_pool_prefixes=172.16.0.0/16 + # This will be used as a suffix for options relevant to the node-local OVN. + bgp_chassis_id = bgp + + +Multiple OVN Controllers +++++++++++++++++++++++++ + +This mode relies on running two ovn-controllers on the same host. However, a single +OVSDB is shared for both controllers. To achieve that, OVN supports having option +suffixes for options stored in OVSDB that look like this: ``