27864 Commits

Author SHA1 Message Date
5b49c507ba [OVN][CI] Update OVS_BRANCH to be compatible with ovn main
Required since [1].

[1] https://github.com/ovn-org/ovn/commit/dc34b4d9

Closes-Bug: #2051845
Change-Id: If1744f0f3d9905ccbe920581c9f39774ce5d7517
2024-01-31 18:54:10 +05:30
Zuul
ca8e5b62e8 Merge "Fix test_update_timestamp unit test failure" 2024-01-31 10:24:13 +00:00
Zuul
87d94a9ab9 Merge "[OVN][FT] Retry in case of timeout when executing "ovsdb-client"." 2024-01-30 16:39:49 +00:00
Zuul
737f16715a Merge "[OVN] Add the bridge name and datapath type to the port VIF details" 2024-01-30 11:57:59 +00:00
Zuul
f7b61ca333 Merge "[OVN] Add a start method to the OVN agent extensions" 2024-01-30 11:09:59 +00:00
Zuul
5de28bd1a1 Merge "[OVN] The OVN agent exposes the `load_config` method." 2024-01-30 11:09:55 +00:00
Zuul
2072bb4269 Merge "[ovn] AZs distribution in L3 port scheduler" 2024-01-29 21:23:25 +00:00
Zuul
075d2e12cc Merge "Set trunk parent port as access port in ovs to avoid loop" 2024-01-29 17:33:13 +00:00
Brian Haley
a926aad434 Fix test_update_timestamp unit test failure
openstack-tox-py311-with-sqlalchemy-master started
failing after commit bf2f8342d, which updated code
to use oslo_utils.timeutils.utcnow(). Since getting
admin context calls timeutils, move the reset_mock()
to be right after.

Trivialfix

Change-Id: Id42ffb7b3110869936319bf3c403d1958daee706
2024-01-29 10:23:48 -05:00
Rodolfo Alonso Hernandez
c6ac441a51 [UT] Change number of `utcnow call number in test_update_timpestamp`
Since [1], the method ``timeutils.utcnow`` is called from
``neutron_lib.context.ContextBase.__init__`` too. Although this patch is
still not released (current last neutron-lib version is 3.10.0), this
is affecting "openstack-tox-py311-with-sqlalchemy-master" that is using
neutron-lib master branch.

[1]https://review.opendev.org/c/openstack/neutron-lib/+/903841

Closes-Bug: #2051501

Change-Id: I1b2dd06d12dffd95869508167f8682e4042c044e
2024-01-27 20:19:52 +00:00
Zuul
7e6ac2792e Merge "If method `set_netns` fails, restore previous device namespace" 2024-01-26 17:36:53 +00:00
Yann Morice
a29ea3724e [ovn] AZs distribution in L3 port scheduler
Update l3 ovn schedulers (chance, leastloaded) to ensure that LRP gateways are distributed over chassis in the different eligible AZs.

Previous version already ensure that LRP gateways were scheduled over chassis in eligible AZs. But, depending on the deployment characteristics, all these chassis could be in the same AZ. In some use-cases, it could be needed to have LRP gateways in different AZs to be resilient on failures.

This patch re-order the list of eligible chassis to add a priority on selecting chassis in different AZs.

This should provide a solution for users who need to have their router gateways scheduled on chassis from different AZs.

Closes-Bug: #2030741
Change-Id: I72973abbb8b0f9cc5848fd3b4f6463c38c6595f8
2024-01-26 15:22:34 +01:00
Zuul
a98336043f Merge "[ovn] Honor enable_default_route_ecmp attribute" 2024-01-26 10:45:54 +00:00
Zuul
f4f2337af1 Merge "[ovn] Implement support for external-gateway-multihoming extension" 2024-01-26 10:33:36 +00:00
Frode Nordahl
4ccc296f56 [ovn] Honor enable_default_route_ecmp attribute
Only create multiple default routes when the router has the
`enable_default_route_ecmp` attribute set to True.

Partial-Bug: #2002687
Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
Change-Id: I17512ec494661151e46282f0bd08abc55bef1df8
2024-01-26 01:56:33 +00:00
Frode Nordahl
0bc9a71387 [ovn] Implement support for external-gateway-multihoming extension
The general approach is to update the ovn_client and ovn_db_sync
code to handle multiple gateway ports wherever a single gateway
port is handled today.

In this patch set multiple static routes for default gateway will
be added by default when multiple gw ports are present.  Support
for the `enable_default_route_ecmp` attribute to control this
behavior will be added in subsequent patch set to avoid making
this change too large.

Partial-Bug: #2002687
Change-Id: I00b1f29172be5a0034b921b11af3a8d502273766
2024-01-25 20:51:22 -05:00
Bence Romsics
27601f8eea Set trunk parent port as access port in ovs to avoid loop
A non-vlan-transparent trunk parent port (tpt) should only forward
untagged frames. Earlier it was configured to forward anything (trunk
mode in ovs). This patch changes the trunk mode to access mode and
sets the trunk parent's tag explicitly to 0.

Change-Id: I4bcfe53fe87d7c9218dd0db9d7224bb323709a21
Closes-Bug: #2048785
2024-01-24 14:42:13 +01:00
Thomas Goirand
bf2f8342d7 python-3.12: do not use datetime.datetime.utcnow()
This is deprecated in the favor of:
oslo_utils.timeutils.utcnow()

Change-Id: Ic7304aea55258822b0be59ce45c6686182f4ecd0
2024-01-20 04:30:48 +00:00
Brian Haley
3ef02cc2fb Consume code from neutron-lib
All of these exceptions and constants have been in
neutron-lib for a while, start using them.

While looking for other things to consume found an old
neutron-lib TODO that did not apply anymore, so removed.

TrivialFix

Change-Id: I9431075a50ba05be872db422125e6af6266ccb99
2024-01-19 17:18:57 -05:00
Rodolfo Alonso Hernandez
64fddf4f2d [OVN][FT] Retry in case of timeout when executing "ovsdb-client".
The shell command "ovsdb-client", in the functional tests, is prone to
timeouts. This patch adds a tenacity decorator and sets the command
timeout to 3 seconds, that should be more than enough to retrieve one
single register.

Closes-Bug: #1955008
Change-Id: I38626835ca809cc3f2894e5f81fab55cf3f40071
2024-01-19 11:41:15 +00:00
Zuul
5ce17647c6 Merge "Router flavors and service type for OVN" 2024-01-17 20:27:17 +00:00
Rodolfo Alonso Hernandez
cd1eb7852d [OVN] Add a start method to the OVN agent extensions
Each OVN agent extension can implement a start method. It is called
after the extension manager initialization, at the end of the
``OVNNeutronAgent.start`` call.

Related-Bug: #2017871
Change-Id: I334027f061fa963c1cf24540b27c1ff76145b977
2024-01-17 18:41:36 +00:00
Rodolfo Alonso Hernandez
9e74ea11e8 [OVN] The OVN agent exposes the `load_config` method.
Now the ``OVNNeutronAgent.load_config`` method is public and accessible
by the OVN agent extensions.

This patch also makes use of the property ``ovs_idl``, that implicitly
loads the OVS IDL if it is not done previously.

Related-Bug: #2017871
Change-Id: I356c16d753b524736673a665a6590ae903be5682
2024-01-17 18:40:47 +00:00
Zuul
52781954c2 Merge "Make get_ports RPC method common for the DHCP and Metadata agent" 2024-01-17 18:35:00 +00:00
Zuul
e6a7cc26a0 Merge "[OVN] Update lsp host id when virtual parent moves" 2024-01-17 18:08:17 +00:00
Miguel Lavalle
49366ecada Router flavors and service type for OVN
Support is added to the OVN L3 service plugin for the router
flavors and service type framework

Partial-Bug: #2020823
Change-Id: If40d7b39e7b59a39ff7622bd823dbdb14bfc69d2
2024-01-17 09:33:07 -06:00
Felix Huettner
3d5d82a197 ovn-l3: reschedule lower priorities
if a gateway chassis is removed we previously only plugged the hole it
left in the priorities of the lrps. This can lead to bad choice since we
are bound by all other currently used chassis.
By allowing us to also reschedule the lower priorities we get
significantly more freedom in choosing the most appropriate chassis and
prevent overloading an individual one.

As an example from the new testcase:
previously we would have had all prio 2 schedules on chassis3, but with
this change now this distributes better also to chassis4.

Partial-Bug: #2023993
Change-Id: I786ff6c0c4d3403b79819df95f9b1d6ac5e8675f
2024-01-17 12:04:09 +01:00
Felix Huettner
b5f5f3def3 ovn-l3 scheduler: calculate load of chassis per priority
previously we calculated the "load" of a chassis across the highest
priority of each of the chassis. This can lead to suboptimal results in
the following situation:
* you have gateway chassis: hv1, hv2, hv3
* you have routers:
   * g1: with priority 3 on hv1, priority 2 on hv2, priority 1 on hv3
   * g2: with priority 3 on hv1, priority 2 on hv2, priority 1 on hv3
   * g3: with priority 3 on hv3, priority 2 on hv2, priority 1 on hv1
   * g4: with priority 3 on hv3, priority 2 on hv2, priority 1 on hv1

When now creating a new router the previous algorythm would have placed
prio 3 of it either on hv1 or hv3 since their count of highest
priorities (2 of prio 3) is lower than the count of the higest priority
of hv2 (4 of prio 2). So it might have looked like:
* g5: with priority 3 on hv3, priority 2 on hv1, priority 1 on hv3
(This case has been implemented as `test_least_loaded_chassis_per_priority2`).

However this is actually a undesired result. In OVN the gateway chassis
with the highest priority actually hosts the router and processes all of
its external traffic. This means it is highly important that the highest
priority is well balanced.

To do this now we no longer blindly use the count of routers of the
highest priority per chassis, but we only count the routers of the
priority we are currently searching a chassis for. This ensures that in
the above case we would have picked hv2 for priority 3, since it has not
actually active router running.

The algorithm implemented now is based upon the assumption, that amount
of priorities scheduled per router is equal over all routers. This means
it will perform suboptimally if some phyiscal network is available on 5
gateway chassis, while another one is only available on 2. (It is
however unclear if the previous implementation would have been better
there).

In this commit we also adopt the testcases in test_l3_ovn_scheduler to match
to this assumption. Previously the distribution data used for testing
had been unrelasitic as it mostly scheduled one gateway chassis for each
router.

It also fixes the previously broken priority calculation in the
testcase, that would just assign prio 0 to all gateways.

Partial-Bug: #2023993
Change-Id: If2afcd546a1da9964704bcebbfa39d8348e14fe8
2024-01-17 12:04:09 +01:00
Zuul
b28bf2d3a1 Merge "Cleanup setup.py and requirements" 2024-01-17 08:30:41 +00:00
Zuul
1211530294 Merge "Add firewall_v2 to extensions supported by ovn" 2024-01-17 07:47:56 +00:00
Zuul
290cb63003 Merge "dhcp: improving log level of cleanup stale devices" 2024-01-17 07:24:23 +00:00
Rodolfo Alonso Hernandez
e234a7aeab If method `set_netns` fails, restore previous device namespace
If the ``IpLinkCommand.set_netns`` fails, the method restores the
previous device namespace before raising the exception.

Closes-Bug: #2049590
Change-Id: I73b36ef161441b52922d888c11a144eafe8a7ed0
2024-01-17 04:25:44 +00:00
Miro Tomaska
637e7a5007 Make get_ports RPC method common for the DHCP and Metadata agent
This patch is the initial implementation on the suggestion
from this patch[1].

The DHCP agent can query the existing `get_ports` RPC method because
this method is already exposed in the MetadataRpcCallback(server side)
which runs under the same topic(PLUGIN) and namespace(None). The benefit
here is that there is no change needed to the API, however it does
go against how we historically setup the RPC layer between a server and client.

[1] https://review.opendev.org/c/openstack/neutron/+/903572/comments/3d4e0453_4b4d2ab6

Related-Bug: #1982569
Change-Id: Icd7c55d2a5103bdbd90907b1dbfb9ccfe34c020a
2024-01-16 15:30:24 -05:00
70f9dd926f update OVS_BRANCH to be compatible with ovn main branch
Required since [1] included in ovn repo.

[1] https://github.com/ovn-org/ovn/commit/66ef670

Closes-Bug: #2049488
Change-Id: Ia50937dd81a33da8297576e91aa69e1897899529
2024-01-16 13:04:19 +05:30
Zuul
3ced5956a7 Merge "Forbid the subnet gateway IP deletion if a router interface is attached" 2024-01-15 19:45:23 +00:00
Rodolfo Alonso Hernandez
f9e40971e9 Forbid the subnet gateway IP deletion if a router interface is attached
When a router interface is created, the corresponding subnet gateway IP
is tested first [1]. If the subnet has no gateway IP, the router
interface cannot be created. This IP will be assigned to this port.

The Neutron API also prevents from modifying the subnet gateway IP
if assigned to a router interface [2]. However the API is not
preventing the subnet gateway IP deletion. This patch is adding
this check.

This patch is being tested in the neutron-tempest-plugin [3].

[1]de58c1b995/neutron/db/l3_db.py (L902-L904)
[2]de58c1b995/neutron/db/db_base_plugin_v2.py (L715)
[3]https://review.opendev.org/c/openstack/neutron-tempest-plugin/+/904710

Closes-Bug: #2036423
Change-Id: I4c7b399a3a052749abdb88fb50be628ee91b63a0
2024-01-17 13:33:41 +00:00
Zuul
d34c1f916f Merge "Remove deprecated OVN vif_type config option" 2024-01-15 12:45:52 +00:00
Zuul
a89ba3ae32 Merge "Remove _use_db_facade()" 2024-01-15 12:30:02 +00:00
Zuul
6d927d283c Merge "Fix implicit-str-concat warnings" 2024-01-15 12:17:19 +00:00
Zuul
77ad1ba640 Merge "Fix use-maxsplit-arg warnings" 2024-01-15 12:17:15 +00:00
Zuul
8137d0b728 Merge "Fix use-list-literal warnings" 2024-01-15 12:17:11 +00:00
Zuul
3c31f027a1 Merge "Fix unnecessary-list-index-lookup warning" 2024-01-15 11:25:48 +00:00
Zuul
a921d14d9a Merge "Revert "Disable mysql gather performance in jobs"" 2024-01-15 10:24:49 +00:00
Rodolfo Alonso Hernandez
baaf240ce3 [OVN] Add the bridge name and datapath type to the port VIF details
Same as in ML2/OVS, the ML2/OVN mechanism driver adds to the port
VIF details dictionary the OVS bridge the port is connected to
and the integration bridge datapath type.

Closes-Bug: #2045889
Change-Id: Ifda46c42b9506449a58fbaf312cc71c72d9cf2df
2024-01-14 15:51:07 +00:00
Brian Haley
d55b15bedc Fix unnecessary-list-index-lookup warning
Noticed this test file had this warning, fixed it.
No functional change.

TrivialFix

Change-Id: I2c32838d32d7e5c2ef3d573f2b55eb668ea09c67
2024-01-13 13:53:26 -05:00
liushy
5dfb742d71 Add firewall_v2 to extensions supported by ovn
This addition is required to run a devstack setup with ovn
that includes firewall_v2 from the proposed patch [1]

[1]https://review.opendev.org/c/openstack/neutron-fwaas/+/845756

Related-Bug: #1971958
Change-Id: Id370e86e470c160c38cfb5126bbfa0f0babe4485
2024-01-13 03:18:55 +00:00
Brian Haley
d2a50945bf Remove _use_db_facade()
neutron.object.base._use_db_facade() is unused according
to codesearch, except for the test cases. Remove it.

TrivialFix

Change-Id: I8f183584bf66bac157694c51769409dba2c79da2
2024-01-12 18:29:00 -05:00
Brian Haley
c05fa72915 Fix use-list-literal warnings
Noticed a few test files had these warnings, fixed them.
No functional change.

TrivialFix

Change-Id: Ieb31fed3278e0ca226ef7a64902c06c1df70ecc0
2024-01-12 16:00:24 -05:00
Brian Haley
3d8460c222 Fix use-maxsplit-arg warnings
Noticed a few test files had these warnings, fixed them.
No functional change.

TrivialFix

Change-Id: I082baf04588e3f96a975c8fb2d74b5ec1b987801
2024-01-12 15:54:28 -05:00
Brian Haley
3e2ae14c07 Fix implicit-str-concat warnings
Noticed two test files had these warnings, fixed them.
No functional change.

TrivialFix

Change-Id: I495aaef050da2bd10912d87451b8177a6a929563
2024-01-12 15:44:05 -05:00