369 Commits

Author SHA1 Message Date
Luis Tomas Bolivar
48ad07e808 Group the ovn DBs configs together
Change-Id: Ibf55db6c36a8c9a98f08f96df29331f7b2f745be
2023-11-23 15:22:26 +01:00
Zuul
ac82d047ca Merge "Add support at NB BGP Driver for exposing OVN LBs" 2023-11-16 09:36:49 +00:00
Zuul
3c614a8a1a Merge "Add support at NB BGP Driver for exposing tenant IPs" 2023-11-16 09:36:46 +00:00
Zuul
3d6d0b0106 Merge "Add support at NB BGP Driver for exposing subnets" 2023-11-16 09:36:43 +00:00
Luis Tomas Bolivar
bb663ad778 Add support at NB BGP Driver for exposing OVN LBs
Change-Id: I4b1992d938e157a693c9db33882e5bc27ef8f604
2023-11-16 09:49:59 +01:00
Luis Tomas Bolivar
aaa0ae0c1a Add support at NB BGP Driver for exposing tenant IPs
Change-Id: Id4df869fdeb7a6b23aee74f4952466851cbc3b4b
2023-11-16 08:13:26 +01:00
Luis Tomas Bolivar
c63be7c85c Add support at NB BGP Driver for exposing subnets
Change-Id: I45e7269306e5c61cda8b6c429dd06c26828ee07b
2023-11-15 16:33:03 +01:00
Luis Tomas Bolivar
90858e581c Fix typo on listing config options
Change-Id: I036c41ad13d5c742f2a25b4d4dec7e70dd11ad44
2023-11-15 14:03:24 +01:00
Luis Tomas Bolivar
0c6a71314b Add support at NB BGP Driver for exposing CR-LRPs
Change-Id: I5c78f3aae9e02f862d1515aa40f17ff3b7e68bc9
2023-11-15 07:28:26 +00:00
Zuul
5a97fa191a Merge "Add initial support for local OVN cluster instead of kernel-networking" 2023-11-14 15:06:42 +00:00
Luis Tomas Bolivar
938cdc2643 Add initial support for local OVN cluster instead of kernel-networking
This patch adds support for configuring a local (in-node) OVN cluster
to do the actions that were being done by the kernel networking.
This way, things like ovs-dpdk or HWOL could be supported.

This also includes adaptation to the tox.ini coverage so that
test files are not considered. This was making coveraged artificially
higher that it was, so this patch is also adjusting the minimun
coverage accordingly.

Missing items to be handled in follow up patch sets:
- Documentation
- Support for IPv6
- Support for BFD
- Support for vlan provider networks

Change-Id: Ieff19d88a22d7267bd58f8d1d4ecbcdc668c6bfb
2023-11-14 15:45:59 +01:00
Zuul
1f6bd6e7ec Merge "Devstack plugin" 2023-11-07 10:37:00 +00:00
Lucas Alvares Gomes
fbf3f6eeb5 Devstack plugin
Initial support for devstack plugin, with default configuration
for the SB DB driver

Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
Change-Id: If806802fe65f852f643b85557c4c88973fa96dea
2023-11-06 10:55:02 +01:00
Justin Lamp
5bb65f5dd0
Fix [EVPN-Driver] Cannot remove routes
pyroute2 update breaks getting some route information.

Closes-Bug: #2038819
Change-Id: I17f6882b54314a65bdb05760609dbda1dcc82e6b
Signed-off-by: Justin Lamp <justin.lamp@netways.de>
2023-10-19 16:11:31 +02:00
629c6dff34 Update master for stable/2023.2
Add file to the reno documentation build to show release notes for
stable/2023.2.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2023.2.

Sem-Ver: feature
Change-Id: Iee1ea4f4cc78c7de1cda0369e892f44b1ea69269
2023-09-14 01:25:47 +00:00
maliangyi
6272a42f6c Fix spelling errors
Change-Id: I856058bf04f4c7822e3d21338b3bbdc5ffd4df9b
2023-09-12 15:58:26 +08:00
Rodolfo Alonso Hernandez
c1d16bc757 [UT] Fix the `TestLinuxNet` wrong assert calls
Closes-Bug: #2046262
Change-Id: Ibffa6c265d60f7decbce927080828b577393dcaa
2023-08-19 08:52:58 +00:00
Luis Tomas Bolivar
eaf217d89d Fix issue with virtual ports not being exposed on time
The requested-chassis information is only added by neutron
for "" port types. The virtual ports chassis is decided by OVN
not by neutron, and neutron only update that information in the
periodic maintenance task.

As part of [1] information about the virtual port chassis is being
added to the external_ids, as well as for "" ports. This patch is
adapting the NB DB driver to consume this new source of information
and being able to expose those ports when OVN associates them to a
node.

Depends-On: https://review.opendev.org/c/openstack/neutron/+/882705

Closes-Bug: #2020157

[1] https://review.opendev.org/c/openstack/neutron/+/882705

Change-Id: I9abf987004370d0c3ec6a152bb28ab450a9af2c2
1.0.0.0rc1 1.0.0
2023-07-05 16:25:02 +02:00
Luis Tomas Bolivar
61848561e5 Make debug log less chatty
There is a lot of logs from pyroute2 through privsep. This change
ensures the DEBUG option does not change them to DEBUG too so that
the ovn-bgp-agent logs are not that chatty and do not include
uneeded exceptions at the lower levels that are part of the normal
execution path (such as adding an IP already added)

Change-Id: I5627a5d546740e8797edb5c2c3a6fc6b6598699c
2023-07-04 07:55:51 +02:00
Zuul
c930d52563 Merge "Avoid vlan device leaking" 1.0.0.0b1 2023-06-29 09:23:59 +00:00
Zuul
af09aae6fe Merge "Ensure agent is protected again wrong/missing bridge mappings" 2023-06-29 07:27:51 +00:00
Luis Tomas Bolivar
26df66bc8b [functional testing] enhance _get_device aux function
Ensure we only get the device we are interested in, instead of a
list of all existing ones

Change-Id: I9b5404e2290ffe5b2e2aa6c6a5fcd9761530e019
2023-06-28 11:31:39 +02:00
Luis Tomas Bolivar
6c765fcd66 Ensure agent is protected again wrong/missing bridge mappings
If the bridge mappings are changed to a wrong value, we should not
expose the previous IPs. This is needed to ensure the traffic is
only exposed in the right node.

Closes-Bug: #2025057
Change-Id: I5d56801ae87d2640d9671aaef65bc94228c60f52
2023-06-28 10:30:49 +02:00
Rodolfo Alonso Hernandez
40541207e9 Explicitly define the MAC address when creating the interface
In the test ``test_get_interface_address``, when the interface is
created, the MAC address is defined too. This random MAC address is
compared with the result from the tested method.

Change-Id: I20820a6a2351e2eded5e352d2d82fbad1edf3080
2023-06-27 18:05:20 +00:00
Luis Tomas Bolivar
dbf0e7198f Avoid vlan device leaking
If provider network are recreated the vlan devices created
for them are leaked. With this patch we ensure those devices
are deleted as part of the resync action

Closes-Bug: #2020653
Change-Id: I57775fdeaa3ea6dfa35c0ca44b226fa8b44e0cd3
2023-06-27 09:38:45 +02:00
Zuul
439efdb30a Merge "Reshape code around ip neigh" 2023-06-26 10:44:27 +00:00
Luis Tomas Bolivar
bc9e779b08 Reshape code around ip neigh
This makes the code cleaner for adding/deleting ip nei entries.

Partial-Bug: #2022357
Change-Id: I20350ee2c02374ffbeaef0b3173523a9e8da1ccb
2023-06-22 15:00:57 +02:00
elajkat
c9af4dfedf CI: add periodic weekly and experimental queue
Add periodic weekly and experimental queues to ovn-bgp-agent
to increase the coverage and have early warning for issues
with oslo master.
Change openstack-python3-zed-jobs to openstack-python3-jobs-neutron.

Change-Id: I10471cb663aea743dc5f4dd27e1d0cac7ea60a69
2023-06-22 07:51:13 +02:00
Zuul
74b99ff4c2 Merge "Ensure FIPs are exposed as part of cr-lrp binding events" 2023-06-20 14:00:42 +00:00
Luis Tomas Bolivar
727f99bd13 Config register_opts for tests in base class
Change-Id: I37bffbe7a68e66960d60e54750b73d985c7c75b6
2023-06-19 16:50:32 +02:00
Luis Tomas Bolivar
6194a579e7 Minor code improvements around move from NDB to IPRoute
There was a few suggestions to improve the code that were not
included in the main patch sets. Adding them here

Change-Id: I3ea3012e7dc5196c1d35b6265bb7c50ffa576c1e
2023-06-19 11:28:44 +02:00
Luis Tomas Bolivar
3e50c275dd Ensure FIPs are exposed as part of cr-lrp binding events
This ensures the FIPs associated to cr-lrps are processed as part
of the cr-lrp chassis binding event

Closes-Bug: #2024196
Change-Id: I5bfa99c8ee7decf7ff50a2a7de87362eed9eb7a0
2023-06-16 16:00:17 +02:00
Luis Tomas Bolivar
14a78503de Avoid usage of NDB linux_net utils
This patch continues with the work on avoiding NDB usage in favor
of IPRoute

Partial-Bug: #2022357
Change-Id: I1a8e1a8ca3c82d3cc5a4a10dbccd28cbe14f64c7
2023-06-16 13:04:47 +02:00
Luis Tomas Bolivar
1e95409666 Avoid usage of NDB in ovn_bgp_driver, and ovs and wire utils
This patch continues with the work on avoiding NDB usage in favor
of IPRoute

Partial-Bug: #2022357
Change-Id: Id94c0d911ab9bb320a88b87e834ecf2fc423e041
2023-06-16 11:33:20 +02:00
Luis Tomas Bolivar
7115d6bf93 Add new privileged rule methods implementations
This patch add the following new privileged methods implementations:
* rule_create
* rule_delete

These new method use pyroute2 IPRoute class, replacing the use of the
NDB class.

Partial-Bug: #2022357
Change-Id: I7cb004b7523d957b3849621a0387288e758b8520
2023-06-15 12:12:25 +02:00
Luis Tomas Bolivar
6f1d816f76 Add more new privileged method implementations
This patch add the following new privileged methods implementations:
* route_create
* route_delete
* add_unreachable_route

These new method use pyroute2 IPRoute class, replacing the use of the
NDB class.

Partial-Bug: #2022357
Change-Id: Iff355d59d7e3bfe4434162b96391f9c7634accd9
2023-06-15 12:12:18 +02:00
Rodolfo Alonso Hernandez
1cbfe7823c Add new privileged method implementations
This patch add the following new privileged methods implementations:
* create_interface: this method will be used to create dummy, vlan,
  vxlan, bridge and vrf interfaces.
* delete_interface: to delete a interface
* set_link_attribute: to set UP the interface
* add_ip_address: to add an IP address on a interface
* delete_ip_address: to delete an IP address on a interface
* set_master_for_device: defines a master device for a second one

These new method use pyroute2 IPRoute class, replacing the use of the
NDB class.

This patch is creating the functional test framework, in order to
test these new methods.

This patch is also adding a new CI job to the gate (to be defined).

Partial-Bug: #2022357
Change-Id: I40d70829bfccb2df98b822afacbdab7da5a5ab7f
2023-06-15 12:12:08 +02:00
Zuul
a5d8436049 Merge "Retry get_ovs_patch_port_ofport if empty port" 2023-06-15 09:55:37 +00:00
Luis Tomas Bolivar
1d00d2c58f Retry get_ovs_patch_port_ofport if empty port
It seems sometimes we are getting [] instead of the ofport,
possibly due to a race between creating the interface and
attaching it to the ovs bridge. This ensure it is also
retried in that case

Change-Id: I2f0766c3a018336168c02ab77bbdfc9ed246a150
2023-06-15 11:03:17 +02:00
Luis Tomas Bolivar
b5ac73f138 Ensure PortBindingChassis Events consider the port up status
There may be cases where the port is not up, so it does not matter
if the chassis is set, we don't need to expose the IP, and the
opposite for the deletion. This also avoid races where the chassis
gets re-added but the port is still down, avoiding to process extra
events that are not needed

Change-Id: I64680c4ce8d776e57c16e06e0f376d7d9fba3733
2023-06-15 09:38:32 +02:00
Luis Tomas Bolivar
e3828acc48 Minor code improvements on priviledged linux_net functions
Small code changes to use replace instead of set, and catch the
possible error/race adding an ip nei on a deleted nic

Also improve the add_ip_to_dev/del_ip_from_dev by getting the
address information outside of the ndb context

Change-Id: I627b58b6f245b3ad186832d0f3b1b5de59d61cae
2023-06-07 10:00:47 +02:00
Luis Tomas Bolivar
8028e8f945 [NB Driver] Ensure proper processing of LSP ports creation updates
In case the chassis and up event come in different updates we
need to ensure the fields are set in the old row, as it was
already done on the Deletion event. We also need to make sure the
up field is processed as a boolean to avoid false positives

In addition it is decreasing the timeout for patch ports to
appear as it not needed -- it was a wrong workaround

Closes-Bug: #2022925

Change-Id: I5bc54092cbe3b6b2046987a74eb9e90306d3519b
2023-06-05 12:33:55 +00:00
Luis Tomas Bolivar
cbe1e16d42 Ensure watchers do not crash
We are overwriting the run method to ensure it is catching any
possible exception generated and allow the driver/watchers to
continue working after that

Closes-Bug: #2022357

Change-Id: Ib66aa082b97b02c3662be647f477707fd8353ae0
2023-06-02 15:31:31 +02:00
Luis Tomas Bolivar
721dfdfafa Add more pyroute2 protection
It seems there can be more points where NetlinkDumpInterrupted
can happen, so adding extra protection just in case

Change-Id: Iffb67f33ed07c719983dace35002a6c167492f1f
2023-06-02 10:32:16 +02:00
Luis Tomas Bolivar
331bbb597d Give more time for patch ports to be created
It may happen that 5 seconds is not enough for the patch port
to be created, so doubling it to avoid the issue

Change-Id: I5a64875ea6a5b17a5fb6add974802ac377358138
2023-05-24 15:16:33 +02:00
Zuul
e697e350af Merge "Publish docs at docs.openstack.org" 2023-05-11 05:34:19 +00:00
Lucas Alvares Gomes
fa68b784ed Publish docs at docs.openstack.org
The project is now part of openstack/governance, we now can publish the
documentation at docs.openstack.org instead of readthedocs.

Change-Id: I2a1577c1b7c12aba9ac91cd4b4857959fe1327da
Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
2023-05-10 15:58:40 +01:00
Luca Czesla
4d5e42cf1a Handle DatapathNotFound in l2 driver
In the ovn_stretched_l2_bgp_driver the function
is_router_gateway_on_any_chassis() can trigger the exception
DatapathNotFound which was not handled. In that case we ignore the port
now.

Traceback:
  File "/usr/local/lib/python3.10/dist-packages/ovsdbapp/event.py", line
177, in notify_loop
    match.run(event, row, updates)
  File
"/usr/local/lib/python3.10/dist-packages/ovn_bgp_agent/drivers/openstack/watchers/bgp_watcher.py",
line 179, in run
    self.agent.expose_subnet(ip_address, row)
  File
"/usr/local/lib/python3.10/dist-packages/oslo_concurrency/lockutils.py",
line 414, in inner
    return f(*args, **kwargs)
  File
"/usr/local/lib/python3.10/dist-packages/ovn_bgp_agent/drivers/openstack/ovn_stretched_l2_bgp_driver.py",
line 219, in expose_subnet
    cr_lrp = self.sb_idl.is_router_gateway_on_any_chassis(row.datapath)
  File
"/usr/local/lib/python3.10/dist-packages/ovn_bgp_agent/drivers/openstack/utils/ovn.py",
line 317, in is_router_gateway_on_any_chassis
    port_info = self.get_ports_on_datapath(
  File
"/usr/local/lib/python3.10/dist-packages/ovn_bgp_agent/drivers/openstack/utils/ovn.py",
line 211, in get_ports_on_datapath
    raise exceptions.DatapathNotFound(datapath=datapath)
ovn_bgp_agent.exceptions.DatapathNotFound: Datapath was not found:
<ovs.db.data.Atom object at 0x7f83b604c2b0>.

Change-Id: I5cfae5e818aeaf0c94d5540d1c83f9c86c25f779
2023-05-09 11:40:59 +02:00
Luis Tomas Bolivar
adf6609c86 Use logical_port instead of name for port binding (localnet) entries
Closes-Bug: #2018720
Change-Id: Ibf39c1f879e45fd93d6da9e8fdb0aa8097ffcfa0
0.4.0
2023-05-08 11:24:33 +02:00
Luis Tomas Bolivar
246567c2aa Optimize the patch port ofport retrieval
This pathc optimizes the ofport information retrieval for patch
ports, so that there is no need to list them all, but just the
specific one

It also ensures that the "Added route" log message is only
logged if the wiring was succesfull

Change-Id: I42cbe9301f90148ff8d9f037dfa21817c12ffcca
2023-05-05 16:44:53 +02:00