305 Commits

Author SHA1 Message Date
Zuul
d23cdf87b2 Merge "Move methods out of LSP events" into stable/2024.1 2024-11-20 12:54:54 +00:00
Zuul
d9ea437d61 Merge "Move some LogicalSwitchChassisEvent methods out" into stable/2024.1 2024-11-20 12:34:15 +00:00
Zuul
82eb8cff57 Merge "Remove _get_router method from events" into stable/2024.1 2024-11-20 12:26:27 +00:00
Zuul
500b9fe651 Merge "Remove duplicated _get_network method" into stable/2024.1 2024-11-20 12:26:26 +00:00
Zuul
bafab4132b Merge "evpn: Remove Chassis events" into stable/2024.1 2024-11-20 12:05:19 +00:00
Zuul
61c6e0e0dc Merge "Remove _check_ip_associated method from Event" into stable/2024.1 2024-11-20 11:08:16 +00:00
Zuul
4331a19c24 Merge "NB: Consolidate common code of events to the superclass" into stable/2024.1 2024-11-20 11:08:13 +00:00
Zuul
400fb1178f Merge "Remove FakeLogicalSwitchChassisEvent class" into stable/2024.1 2024-11-20 10:42:45 +00:00
Michel Nederlof
c3d1beb4fc Fix live migrations and possibly also VIP failovers
When a live migration happens, another flow is happening,
so we need to take this into consideration.

Change-Id: Ib27bbc95a0853f32354f743dcec2bdb4bb797097
Closes-Bug: #2082085
(cherry picked from commit 59ad44aca5fac502010914c547f40e7b0f201c29)
2024-11-14 20:11:29 +00:00
Jakub Libosvar
ad8b3d0449 Move methods out of LSP events
The methods are moved to a function to ports utility module as the
methods were not reading or modifying the instance state.

Change-Id: Iae9d1d1f2f5d5bab38c290a5d6e8f5cf8136e108
Signed-off-by: Jakub Libosvar <libosvar@redhat.com>
(cherry picked from commit d142f397027ad602145f9173d3a219958a9f7512)
2024-11-14 14:17:03 -05:00
Jakub Libosvar
5405436046 Move some LogicalSwitchChassisEvent methods out
The methods that do not modify object state or don't read from the state
are moved out to utils module so they can be re-used elsewhere too.

Change-Id: I4169ae38552b96092f6eae43e082bd6313d730a4
Signed-off-by: Jakub Libosvar <libosvar@redhat.com>
(cherry picked from commit fed8d0376d90c2db980b71afa3558491da0bb3c7)
2024-11-14 14:17:02 -05:00
Jakub Libosvar
206daf9511 Remove _get_router method from events
The method was tied to an event instance but didn't actually
modify the state of the instance. It was replaced with a helper
function.

Change-Id: I25b6ba95f0fd2731737d014eae54d3d7e27a5513
Signed-off-by: Jakub Libosvar <libosvar@redhat.com>
(cherry picked from commit 7ce42598b4920f553625d0bfa2f11ebf5c34b736)
2024-11-14 14:17:01 -05:00
Jakub Libosvar
d5691838e8 Remove duplicated _get_network method
The method was tied to an instance of some events but didn't actually
modify state of the instance. It was replaced with a generic helper
function.

Change-Id: I0d24ead8e44cde1df62df77408801cbbc758c4a6
Signed-off-by: Jakub Libosvar <libosvar@redhat.com>
(cherry picked from commit acb53b40099b3a1c3d730ebbd898b0febe52070d)
2024-11-14 14:16:58 -05:00
Jakub Libosvar
dcbd6a9e99 evpn: Remove Chassis events
The code was a copy and paste from the bgp_watcher

Change-Id: I054a13303b39567b5136497c8c1f1f8d9b848490
(cherry picked from commit 41ea5a37a59fb9ece9050e86e1f143826aa68b52)
2024-11-14 14:15:08 -05:00
Jakub Libosvar
d0ae65f5c8 Remove _check_ip_associated method from Event
The method should be a helper function as it does not modify any state
of the Event instance.

Change-Id: Id744b40d3203fa864bbdf6c541ca7c311c16f9ce
Signed-off-by: Jakub Libosvar <libosvar@redhat.com>
(cherry picked from commit eaa906e2e534f03ae9219d99aaa7a3876a9279fa)
2024-11-14 14:15:08 -05:00
Jakub Libosvar
ff09a3ee1e NB: Consolidate common code of events to the superclass
Change-Id: I7b7d8cb8402695bdd41fb0f87f1cb2e4fff80b50
Signed-off-by: Jakub Libosvar <libosvar@redhat.com>
(cherry picked from commit 6e9ee5803ef02fb1a7301c91f90d170e6b3db04c)
2024-11-14 14:12:21 -05:00
Jakub Libosvar
327f6153e7 Remove FakeLogicalSwitchChassisEvent class
It is not used anywhere

Change-Id: Iaf2fabe5ba4908c44cef5d10a60fa78de1f4f7fa
Signed-off-by: Jakub Libosvar <libosvar@redhat.com>
(cherry picked from commit 8ce98073725d534099329870b0535e92d218793f)
2024-11-14 14:12:21 -05:00
Jakub Libosvar
20e268c496 Remove dead code from get_port_chassis function
The function returned a tuple but the second returned object was always
ignored. The patch also deletes redunant unittest.

TrivialFix

Change-Id: I85b3b9a58c8d07aa6bbce240d22cceccbb8a7588
(cherry picked from commit c5eaef9c55073f5ff12b348f4b0b375bcd83590e)
2024-11-14 18:56:06 +00:00
Eduardo Olivares
3b6bd96e17 Fix type for config option bgp_chassis_id
Type List was wrongly used. Type Str should be used instead.

Closes-Bug: #2088057
Change-Id: I26e04725ce419f87b8cde78567e88fe479cee1ae
(cherry picked from commit 4f8fe6adbfca242c5d4ef7d4d66b9240785f945e)
2024-11-13 14:28:55 +00:00
Eduardo Olivares
855df3a483 Refactor ovn_bgp_agent.privileged.ovs_vsctl
When ovs commands fail, we re-try after adding `-O OpenFlow13`, but that
is only valid for `ovs-ofctl`.
To fix this issue, this patch implements a small refactor of the module
in order to separete calls to ovs-ofctl and ovs-vsctl.

Related-Bug: #2080258
Change-Id: Ib8ee872d4bd587ade325bc4f6da3e9d8804c28c0
(cherry picked from commit 7e348daca0b2108795c42a0b0e2faff8bd38e317)
2024-10-14 16:26:16 +02:00
Eduardo Olivares
4c7b76f3db Add retries to get_device_port_at_ovs
Extending retries added to `get_ovs_patch_port_ofport` at [1].

[1] https://review.opendev.org/c/885976

Closes-Bug: #2080258
Change-Id: Id41336ad235159d5fbe125c6c1bbecd2a73a819e
(cherry picked from commit e615106ab89f38e7ad9ff60ea468ad161a8f77db)
2024-10-14 14:22:11 +00:00
Dmitrii Shcherbakov
656a427e39 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.

48db2a7a35

Let's allow this suffix to be set via a config option instead.

Change-Id: Ida30b46e16ddcdc2d82af980546876f72a845c1d
(cherry picked from commit e3cb1b4a472e0c2743690af62768a96a1c2b8c00)
2024-07-19 10:03:43 +00:00
Michel Nederlof
62c63f9855 Add the forgotten cleanup, that potentially messes up the next test in the py311 test
(if called by the same worker..)

Change-Id: I3d0a354d999f7a69b7ae5ceaf9ab2f3d59739132
(cherry picked from commit c0459dc8c6607b8f1cb742a6fad23738bc8c5118)
2024-07-05 09:48:51 +00:00
Luis Tomas Bolivar
f5640789cf Ensure cr-lrp permanent ip nei entry is added on NB DB driver
There wire provider port function had two definitions for the same
parameter (mac and lladdr). This patch is merging them and ensuring
it gets used on the NB DB Driver so that the PERMANENT ip nei entries
get added for the router gateway ports (cr-lrp)

Closes-Bug: #2068699
Change-Id: I9649cd185b100c9941887e3440bad8d39881f92c
(cherry picked from commit a4e307e6f53794532284f02c91c0ff7a96fb242f)
2024-06-26 11:57:05 +00:00
jayjahns
b71ce99ff6 Announce lrp ip if advertisement method is subnet
In the case of the subnet advertisement method, we do not
announce the route to the tenant subnet via BGP. While the routes
in br-ex are good, they do not fully expose the subnet.

This change exposes the router interface that connects the
tenant subnet.

Closes-Bug: 2068730
Change-Id: Id7dd902e5e2010ba41052cc9316db8518349c755
(cherry picked from commit bc1dc8ec9ea2438fe89ad0d9535dfddd05c463d9)
2024-06-14 09:33:17 +00:00
Luis Tomas Bolivar
1920102b15 Ensure cr-lrp ports are exposed
Even if expose_tenant_networks is not enabled, cr-lrp IPs must
be exposed

Closes-Bug: #2068028

Change-Id: Ibcffbad5204bfbc1a42c157755ac9ae9d7b67766
(cherry picked from commit d24d6fbf9fbd8dab260fd6c720d42edd052f76a9)
2024-06-10 13:22:02 +00:00
Michel Nederlof
47c18ffaa4 Add support for l3vpn with NB driver
Creates VRF/VXLAN per VNI, exposed through FRR with kernel routes
Vlan interfaces are added to the appropriate VNI, configured per bgpvpn
config options on the logical switch.

Related-bug: #2051105
Change-Id: I097c4629922d787827aba7761164f4004ed1305a
(cherry picked from commit b3ca890f471fc2694342edc1f22670913cece934)
2024-05-23 07:27:08 +00:00
Jakub Libosvar
bd0d29c71f Fix sync for OVN LB VIPs
There was a bad comparison of datapath types, we compared router
datapath is equal to loadbalancer datapaths instead of if it is included
there.

Closes-bug: #2064922

Change-Id: I4f92d75f512ca906ad884e9da21ee7048b1dc5d6
Signed-off-by: Jakub Libosvar <libosvar@redhat.com>
2024-05-06 17:42:26 +00:00
Michel Nederlof
047d261cb7 Fix placement of lsp when external_ids not in sync
When options.requested-chassis is not in sync with
external_ids.neutron:host_id it would pick both hosts, causing duplicate
announcements from more than 1 host.

This has been fixed in change 910305, but was left unchanged for the
sync method, causing issues when the sync interval was re-evaluating all
lsp's on the node.

The code for determining the chassis of a port has been moved from the
base_watcher to driver_utils so the logic for the event is the same as the
logic when fetching the records from the northbound database.

Related-bug: #2049902
Change-Id: I545d6b41fd308eb56e5295657260718dc14868f7
(cherry picked from commit 1bacff1dff825d267c390752fa21592c2e6f6588)
2024-03-19 12:59:04 +00:00
Michel Nederlof
8f3351072c [NB watcher] Prevent lsp events for remote tenant events
Added check in LSP events to see if the event would belong to a network
that is exposed remotely (e.g. tenant networks behind router)

Change-Id: Idcc7880fc877f0a876c65bb1877ec4f89c2af5aa
2024-03-08 15:50:08 +01:00
Luis Tomas Bolivar
c00139d559 Fix typo for linux util function used at evpn driver
Change-Id: I3503d0cd40485f4c44bdcd010b0e6ac7e8167bf1
2024-03-06 13:30:20 +01:00
Zuul
aa87c61831 Merge "Fix OVN LB Delete events for NB driver" 2024-03-04 12:11:03 +00:00
Fernando Royo
e6201b35bc Fix OVN LB Delete events for NB driver
When deleting an OVN LB with an attached FIP, the FIP is not
withdrawn from the BGP interface where it was exposed.

This patch corrects the behavior in accordance with the events
received from the OVN NB DB, taking as main source the vips
field provided in events to detect if added/removed entries.

Closes-Bug: #2049535
Change-Id: If0bca4a39a857364582804b64140f9a36bfc422a
2024-03-01 10:43:38 +01:00
Michel Nederlof
22ac0386f5 Fix address scope test and add address scope unit tests
Change-Id: I413fd8a22c30ea9dad5e2cf69bfd3d6bc18468ed
2024-02-29 11:09:06 +01:00
Michel Nederlof
326ec40230 Add feature to check if SNAT disabled before exposing tenant networks
If SNAT on the router is enabled, then the subnet is reachable
from the outside, but all new sessions created from within the subnet
will be SNAT-ed. So those sessions will use the external IP of the router.
For example whitelisting specific tenant ips would not be possible.

With SNAT disabled, the neutron router will act as a normal gateway, and
sessions created from within a tenant vm will be sent from the real ip.

Closes-Bug: #2052292
Change-Id: Ib97065fb2fcca069195278fea804256370d21816
2024-02-27 09:21:59 +00:00
Zuul
1362df06b3 Merge "Update NB driver to re-use new methods and make code cleaner" 2024-02-26 12:23:48 +00:00
Zuul
9f50cbdce0 Merge "Fix event handling for LSP and prefer the options.requested-chassis info" 2024-02-26 12:23:47 +00:00
Michel Nederlof
7243e1c1ab Fix backward compatibility for setups that export subnets per host
Closes-Bug: #2054696
Change-Id: I8a6c2d5e9c426f698c250793462ee5ef769748ab
2024-02-22 15:52:43 +01:00
Zuul
7fa2f22daa Merge "Trimm interface name consistently" 2024-02-22 12:00:05 +00:00
Zuul
1b371dfc03 Merge "Disable exposing remote_ips, when only the lrp prefix is sufficient" 2024-02-22 11:42:43 +00:00
Michel Nederlof
31c241ce6c Update NB driver to re-use new methods and make code cleaner
Change-Id: I6c3520dfe9bddb30008f61bbbf0d1bc2f4ed30a2
2024-02-22 11:55:06 +01:00
Michel Nederlof
6e0d576650 Fix event handling for LSP and prefer the options.requested-chassis info
Since the requested-chassis superseeds the placement in external_ids
(which is managed by neutron), we should preferable use that instead of the
value set by neutron (which _could_ lag or be wrong in specific scenario's)

Also update logic for FIP handling to make migrations more efficient.

Closes-Bug: #2049902

Change-Id: I7f73a1ba7956f22e58fdde383775e88bf72cba14
2024-02-22 11:47:26 +01:00
Michel Nederlof
5da36a2638 Disable exposing remote_ips, when only the lrp prefix is sufficient
This also requires to use redist kernel in FRR, so there is a change
here which allows to define the default redistribute options in the FRR
template.

Since now this method is now available, the separate KERNEL_LEAK template
can be removed, as the only difference was the redist kernel, instead of
redist connected.

Related-Bug: #2017886
Change-Id: I570d8c482f3d17d63d66699e402c84dc61787638
2024-02-22 10:31:26 +01:00
Dmitriy Rabotyagov
1ac77aba49 Trimm interface name consistently
In create_interface method we trimm interface name up to 16 symbols,
however in all following methods we do not care about same trimm, which
causes calls to such interfaces fail with NetworkInterfaceNotFound

Closes-Bug: #2054599
Change-Id: I15f773afa64079eec6534c53eab0e9b7dd796d5f
2024-02-21 19:54:04 +01:00
Zuul
269f324b24 Merge "Address the Load_Balancer's datapath_group column deprecation" 2024-02-02 12:07:08 +00:00
Lucas Alvares Gomes
5ffe0ce083 Address the Load_Balancer's datapath_group column deprecation
OVN deprecated the datapath_group column from Load_Balancer table. Now
this column was split in two: ls_datapath_group and lr_datapath_group.
This patch changes the code to also look for the datapath group in these
new columns.

This change is backward compatible and will work with a newer or older
version of OVN.

Change-Id: Ia3a95b77fccaa056aa9169114d102258f015002f
Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
2024-02-02 11:40:01 +00:00
Zuul
8d3273f6c6 Merge "Add support to PF OVN LBs for NB Driver" 2024-02-01 22:36:52 +00:00
Michel Nederlof
2402fdcc00 Check for networks on router port in match_fn
Ideally the _run method should not do a check to see if row is valid.
Also, add the _get_ips_info method in base to get in line with LSP events

Change-Id: I7320ba37d622cd6b7de55e994caf657fb8b70b8d
2024-01-29 16:17:18 +01:00
Fernando Royo
c923bd9c79 Add support to PF OVN LBs for NB Driver
This patch adds support to the OVN LBs created when a port forwarding
(PF) is configured over a FIP for the NB driver.

Closes-Bug: #2049415
Change-Id: I95d132172d54329306f41fee2cc631e27ccfd8c4
2024-01-29 11:37:46 +01:00
Zuul
6678aa5250 Merge "Fix startup if the hostname is not configured in OVS" 2024-01-22 11:20:35 +00:00