28325 Commits

Author SHA1 Message Date
Rodolfo Alonso Hernandez
ae90e2ccbf Make RPC event cast synchronous with the event
Sometimes, the methods ``NeutronObject.get_object`` and
``ResourcesPushRpcApi.push`` yield the GIL during the execution.
Because of that, the thread in charge of sending the RPC information
doesn't finish until other operation is pushed (implemented in [1]).

By making the RPC cast synchronous with the update/delete events, it
is ensured that both operations will finish and the agents will receive
the RPC event on time, just after the event happens.

This issue is hitting more frequently in the migration to the WSGI
server, due to [2]. Once the eventlet library has been deprecated from
OpenStack, it will be possible to use the previous model (using a long
thread to handle the RCP updates to the agents). It is commented in the
code as a TODO.

This patch is temporarily reverting [3]. This code should be restored
too.

[1]https://review.opendev.org/c/openstack/neutron/+/788510
[2]https://review.opendev.org/c/openstack/neutron/+/925376
[3]https://review.opendev.org/c/openstack/neutron/+/824508

Closes-Bug: #2077790
Related-Bug: #2075147
Change-Id: I7b806e6de74164ad9730480a115a76d30e7f15fc
2024-08-27 15:11:11 +00:00
Zuul
f19bbae345 Merge "docs: Clarify fullstack local run procedure" 2024-08-22 19:46:18 +00:00
Ihar Hrachyshka
6e30a825a3 docs: Clarify fullstack local run procedure
First, explain where the repos should be checked out to. Second,
recommend rebooting with the latest distro kernel to avoid ovs module
incompabitilities.

Change-Id: I480ba689a4e20f373e30fe77059474b6dbea5a72
2024-08-22 15:16:29 +00:00
Zuul
b847d89ac1 Merge "Revert "Temporary mark ovs-rally job as non-voting"" 2024-08-21 16:56:28 +00:00
Zuul
0807c94dc9 Merge "Fix support of IPv6 only networks in OVN metadata agent" 2024-08-20 23:16:32 +00:00
Zuul
2a8b262cbb Merge "Add tap_mirror to extension to OVN supported extensions" 2024-08-20 16:27:31 +00:00
a35c2f8c38 Revert "Temporary mark ovs-rally job as non-voting"
This reverts commit ffaf021810fcd8132582de544d3c324c3cc43b95.

Reason for revert: Fixed in oslo.serialization==5.5.0
Depends-On: https://review.opendev.org/c/openstack/requirements/+/926373

Change-Id: Ie09e230447f80b53a31bd1dad26e7f1722df2f30
2024-08-20 08:10:32 +00:00
Rodolfo Alonso Hernandez
6168db6058 Service workers stop re-writing the process name
In a Neutron server, there are workers that are not spawned in a single
process. These processes are grouped and spawned within a service class
called ``AllServicesNeutronWorker``. This class spawns a thread per
service worker. That reduces the footprint of the Neutron server,
reducing the number of processes spawned.

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

Related-Bug: #2069595
Change-Id: I24313dc891f179a600909854dd8f9a09f74088f5
2024-08-19 07:20:26 +00:00
Miguel Lavalle
f7000f3d57 Fix support of IPv6 only networks in OVN metadata agent
When an IPv6 only network is used as the sole network for a VM and
there are no other bound ports on the same network in the same chassis,
the OVN metadata agent concludes that the associated namespace is not
needed and deletes it. As a consequence, the VM cannot access the
metadata service. With this change, the namespace is preserved if there
is at least one bound port on the chassis with either IPv4 or IPv6
addresses.

Closes-Bug: #2069482

Change-Id: Ie15c3344161ad521bf10b98303c7bb730351e2d8
2024-08-13 19:25:36 -05:00
Rodolfo Alonso Hernandez
f17cc24e8a Adopt to StandardAttribute load method change to "selectin"
Required since the Depends-On patch included, without
it postgres job fails with:-
AttributeError: 'NoneType' object has no attribute 'id'

Depends-On: https://review.opendev.org/c/openstack/neutron-lib/+/923926
Related-Bug: #2072567
Change-Id: I8f2229eb0a9d8dce927ded004037eda93ce3650d
2024-08-13 12:53:21 +00:00
ffaf021810 Temporary mark ovs-rally job as non-voting
Until the required fixes lands and release temporary
mark the job non-voting to unblock neutron gate.

Related-Issue: #2076430
Change-Id: I1044a5613e960bc24d63b7268f891abf1f223d28
2024-08-13 16:49:50 +05:30
Zuul
37b616a62d Merge "Use the RBAC actions field for "network" and "subnet"" 2024-08-07 21:50:03 +00:00
elajkat
b63442e046 Add tap_mirror to extension to OVN supported extensions
This addition is required to run a devstack setup with ovn
that includes tap_mirror extension from tap_as_a_service
see: the proposed patch [1]

[1]: https://review.opendev.org/c/openstack/tap-as-a-service/+/893509

Depends-On: https://review.opendev.org/c/893509
Depends-On: https://review.opendev.org/c/895603
Change-Id: I798c765568430c5346e9bfc81dde6470661b96c2
Related-Bug: #2015471
2024-08-07 08:36:28 +00:00
Zuul
9cbaceff20 Merge "Skip abandoning of the old patches in unmaintained branches" 2024-08-06 00:33:31 +00:00
Slawek Kaplonski
5e583d3240 Skip abandoning of the old patches in unmaintained branches
By default abandon_old_reviews.sh script will now ignore
patches from any unmaintained branches.
Cleanup of those patches can be done by passing "--unmaintained"
parameter to the script

Change-Id: If7626543f9095196ef1515039f153b16282c27a4
2024-08-04 18:52:50 +02:00
Zuul
0666008f78 Merge "Reduce to 1 thread the processing of `IpConntrackManager` events" 2024-08-02 16:04:30 +00:00
Zuul
f4ab100d88 Merge "Add dynamic lookup for tcpdump binary" 2024-08-02 11:22:26 +00:00
Zuul
394c7774da Merge "Lower spacing time of the OVN maintenance tasks which should be run once" 2024-08-02 10:37:26 +00:00
Zuul
bca71e8a30 Merge "Fix setting correct 'reside-on-chassis-redirect' in the maintenance task" 2024-07-31 21:42:10 +00:00
Zuul
4b8696d111 Merge "Initialize the policy enforcer for the "tagging" service plugin" 2024-07-31 16:48:59 +00:00
Slawek Kaplonski
04c217bcd0 Lower spacing time of the OVN maintenance tasks which should be run once
Some of the OVN maintenance tasks are expected to be run just once and
then they raise periodic.NeverAgain() to not be run anymore. Those tasks
also require to have acquried ovn db lock so that only one of the
maintenance workers really runs them.
All those tasks had set 600 seconds as a spacing time so they were run
every 600 seconds. This works fine usually but that may cause small
issue in the environments were Neutron is run in POD as k8s/openshift
application. In such case, when e.g. configuration of neutron is
updated, it may happen that first new POD with Neutron is spawned and
only once it is already running, k8s will stop old POD. Because of that
maintenance worker running in the new neutron-server POD will not
acquire lock on the OVN DB (old POD still holds the lock) and will not
run all those maintenance tasks immediately. After old POD will be
terminated, one of the new PODs will at some point acquire that lock and
then will run all those maintenance tasks but this would cause 600
seconds delay in running them.

To avoid such long waiting time to run those maintenance tasks, this
patch lowers its spacing time from 600 to just 5 seconds.
Additionally maintenance tasks which are supposed to be run only once and
only by the maintenance worker which has acquired ovn db lock will now be
stopped (periodic.NeverAgain will be raised) after 100 attempts of
run.
This will avoid running them every 5 seconds forever on the workers
which don't acquire lock on the OVN DB at all.

Closes-bug: #2074209
Change-Id: Iabb4bb427588c1a5da27a5d313f75b5bd23805b2
2024-07-31 17:07:28 +02:00
Slawek Kaplonski
4b1bfb93e3 Fix setting correct 'reside-on-chassis-redirect' in the maintenance task
Setting of the 'reside-on-chassis-redirect' was skipped for LRP ports of
the provider tenant networks in patch [1] but later patch [2] removed
this limitation from the ovn_client but not from the maintenance task.
Due to that this option wasn't updated after e.g. change of the
'enable_distributed_floating_ip' config option and connectivity to the
existing Floating IPs associated to the ports in vlan tenant networks
was broken.

This patch removes that limitation and this option is now updated for
all of the Logical_Router_Ports for vlan networks, not only for external
gateways.

[1] https://review.opendev.org/c/openstack/neutron/+/871252
[2] https://review.opendev.org/c/openstack/neutron/+/878450

Closes-bug: #2073987
Change-Id: I56e791847c8f4f3a07f543689bf22fde8160c9b7
2024-07-31 16:29:26 +02:00
Zuul
0488bdafa1 Merge "Only query for port do not get directly" 2024-07-31 08:17:55 +00:00
Zuul
7502ecf370 Merge "Start using constants from neutron-lib" 2024-07-31 07:59:52 +00:00
Zuul
169c710fc4 Merge "Do not release the executor inside `_check_child_processes`" 2024-07-30 21:50:47 +00:00
Zuul
819e1fb5b9 Merge "Use has_lock_periodic decorator for the tasks which require ovn db lock" 2024-07-30 19:56:06 +00:00
Miro Tomaska
c1b88fc5f5 Only query for port do not get directly
It was observed in the tempest tests that the port could be already
deleted by some other concurrent event when the `run` is called.
This caused a flood of exception logs. Thus, with this patch we only
query for the port and only update_router_port when the port was
found.

Closes-Bug: #2073567
Change-Id: I54d027f7cb5014d296a99029cfa0a13a7800da0a
2024-07-30 15:30:19 -04:00
Zuul
2937080d63 Merge "[OVN][CI] Update OVS_BRANCH to be compatible with ovn main" 2024-07-30 15:39:18 +00:00
Slawek Kaplonski
2a6bc5db23 Use has_lock_periodic decorator for the tasks which require ovn db lock
This is follow up patch for the [1] which introduced this new decorator.

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

Change-Id: I2de3b5d7ba5783dd82acacda89ab4b64c2d29149
2024-07-30 14:52:49 +02:00
Rodolfo Alonso Hernandez
f22f7ae012 Use the RBAC actions field for "network" and "subnet"
Since [1], it is possible to define a set of RBAC actions to filter the
model query. For "network" and "subnet" models, it is needed to add the
RBAC action "access_as_external" to the query. Instead of adding an
additional filter (as is now), this patch replaces the default RBAC
actions used in the model query, adding this extra one.

The neutron-lib library is bumped to version 3.14.0.

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

Closes-Bug: #2059236
Change-Id: Ie3e77e2f812bd5cddf1971bc456854866843d4f3
2024-07-30 09:23:49 +00:00
Brian Haley
498d7d5f87 Start using constants from neutron-lib
A number of things were moved to neutron-lib earlier
this year, start using them throughout the tree.

Added tests to cover TYPE_GRE_IP6 usage in
get_gre_tunnel_port_type() as I noticed it was
untested.

TrivialFix

Change-Id: Idceb1bc4ba7de3b007a5c2fac28df7659166438c
2024-07-29 18:16:33 -04:00
Zuul
2b6abf0fc0 Merge "Remove the tenant_id/project_id parameter from QoS rule commands" 2024-07-29 21:03:06 +00:00
Zuul
f139fd75d5 Merge "Fix typos in the S-RBAC document" 2024-07-29 17:58:25 +00:00
Pierre Riteau
f63e7999e2 [OVN][CI] Update OVS_BRANCH to be compatible with ovn main
Required since [1].

[1] 4ed71c20f5

Change-Id: Ibc5cb55163928cb1168c09b44842d5b9b389e945
2024-07-29 15:19:14 +02:00
Brian Haley
a1d39a2132 Increase code coverage for OVN metadata agent
Add test for _get_instance_and_project_id() that returns
two ports, a failure path.

TrivialFix

Change-Id: Ic731ae612b73d09dcd01d20c4a3d439471d4b1e2
2024-07-28 19:34:47 -04:00
Brian Haley
92d0cc2919 Fix typos in the S-RBAC document
Found some typos after change was merged, fix them.

TrivialFix

Change-Id: I3eb0a6f65a8dd544034bb268e8f7f2ec0d9c46d8
2024-07-28 19:04:56 -04:00
Zuul
fd6012e24d Merge "[Docs] Add document with description of the RBAC roles" 2024-07-26 13:50:16 +00:00
Zuul
29de222623 Merge "Add ML2/OVN security group logging documentation" 2024-07-26 12:37:35 +00:00
Slawek Kaplonski
aa5b2808a8 [Docs] Add document with description of the RBAC roles
This patch adds short document with description of the roles supported
by the default Neutron's API policies.

Change-Id: Id8106478fc32cd2da283fa4b5763d535372127a6
2024-07-24 22:12:39 +02:00
Rodolfo Alonso Hernandez
bfd32488a6 Remove the tenant_id/project_id parameter from QoS rule commands
Removed the tenant_id/project_id parameter from any QoS rule command
in the fullstack framework.

Closes-Bug: #2074360
Related-Bug: #2022043
Change-Id: I18efb28ffc02323e82f6b116a3f713cb9e2a132e
2024-07-24 07:10:13 +00:00
Zuul
725f3cbd8e Merge "Actualy set global "removal limit" options" 2024-07-22 20:47:07 +00:00
Zuul
f6c657624b Merge "Use convert_version_to_tuple() instead of pkg_resources" 2024-07-22 19:21:22 +00:00
Terry Wilson
b4c8cc600a Actualy set global "removal limit" options
Neither fdb_removal_limit nor mac_binding_removal_limit config
options currently get set in the OVN DB. This patch corrects that
and adds missing testing for the MAC_Binding aging maintenance
task.

Fixes: 0a554b4f29 ("Add support for OVN MAC_Binding aging")
Fixes: 1e9f50c736 ("Add support for FDB aging")
Closes-Bug: #2073309
Change-Id: I80d79faeb9f1057d398ee750ae6e246598fd13d2
2024-07-22 08:10:00 -05:00
Zuul
024c890921 Merge "Add "subnet-external-network" extension to "subnet" resource" 2024-07-22 10:32:05 +00:00
Zuul
2efa0da955 Merge "[OVN] Remove maintenance method "remove_duplicated_chassis_registers"" 2024-07-22 09:40:19 +00:00
Zuul
bd35de886d Merge "[DHCP] Inform about the number of pending events to be processed" 2024-07-22 06:58:18 +00:00
Rodolfo Alonso Hernandez
776178e907 Initialize the policy enforcer for the "tagging" service plugin
The "tagging" service plugin API extension does use the policy enforcer
since [1]. If a tag API call is done just after the Neutron server has
been initialized and the policy enforcer, that is a global variable per
API worker, has not been initialized, the API call will fail.

This patch initializes the policy enforcer as is done in the
``PolicyHook``, that is called by many other API resources that inherit
from the ``APIExtensionDescriptor`` class.

[1]https://review.opendev.org/q/I9f3e032739824f268db74c5a1b4f04d353742dbd

Closes-Bug: #2073782
Change-Id: Ia35c51fb81cfc0a55c5a2436fc5c55f2b4c9bd01
2024-07-20 14:59:08 +00:00
Zuul
045530814f Merge "[OVN] Add support for broadcast_arps_to_all_routers" 2024-07-19 20:44:01 +00:00
Rodolfo Alonso Hernandez
23b9077df5 Reduce to 1 thread the processing of `IpConntrackManager` events
The multithread processing does not add any speed improvement to the
event processing. The aim of this patch is to reduce to 1 the number of
threads processing the ``IpConntrackManager`` events.

Closes-Bug: #2073745
Change-Id: I190d842349a86868578d6b6ee2ff53cfcd6fb1cc
2024-07-19 18:27:02 +00:00
Rodolfo Alonso Hernandez
baa57ab38d Do not release the executor inside `_check_child_processes`
The method ``ProcessMonitor._check_child_processes`` was releasing
the thread executor inside a method that creates a lock for the resource
"_check_child_processes". Despite this resource is not used anywhere
else (at least for this instance), this could lead to a potential
deadlock.

The current implementation of ``lockutils.synchronized`` with the
default value "external=False" and "fair=False" is a
``threading.Lock()`` instance. The goal of this lock is, precisely, to
execute the code inside the locked code without any interruption and
then to be able to release the executor.

Closes-Bug: #2073743
Change-Id: I44c7a4ce81a67b86054832ac050cf5b465727adf
2024-07-19 18:03:16 +00:00