28184 Commits

Author SHA1 Message Date
Zuul
8ee0ddadf6 Merge "Add wsgi tempest job for OVS and OVN" 2024-06-17 20:30:30 +00:00
Zuul
0c4793ed2a Merge "Remove neutron.wsgi module" 2024-06-16 12:21:16 +00:00
elajkat
b352917461 Add wsgi tempest job for OVS and OVN
Add wsgi tempest job for OVN and OVS in the
experimental and periodic queue.

Depends-On: https://review.opendev.org/c/919725
Depends-On: https://review.opendev.org/c/openstack/devstack/+/922012

Change-Id: Ibe2e5960f7c5daebda2a8ca3b1f619b0d93b7bc9
2024-06-14 12:09:49 +00:00
Ihar Hrachyshka
79b2d709c8 tests: fix IP address not accepted by latest netaddr
This raised the following error:

netaddr.core.AddrFormatError: invalid IPNetwork 10.10.20/24

Change-Id: I33d86b40bd8ef8dfb68892ad333a31ae24924a6a
2024-06-13 21:53:23 -04:00
Zuul
2a2d626ead Merge "Change to use selectin for DB load strategy" 2024-06-13 21:17:56 +00:00
Zuul
2b20737eb3 Merge "Improve ACL comparison efficiency" 2024-06-13 17:15:51 +00:00
Zuul
a247c9be2b Merge "[CI] Enable OVN grenade job in the check and gate queue" 2024-06-13 09:37:30 +00:00
zhouhenglc
dbca7e1f8c Improve ACL comparison efficiency
The current comparison strategy is very time-consuming, and if
there are hundreds of thousands of security group rules, the
comparison time can still vary from several hours. The main
time-consuming operations are [1].

This patch is sorted first by security group rule ID and then
compared. The execution of sorting actions is relatively fast.
After actual measurement, the total time consumption is in the
minute level.

Partial-Bug: #2023130
[1] b86ca713f7/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_db_sync.py (L285-L291)

Change-Id: If4c886d928258450aac31e12a4e26e0cbe2ace62
2024-06-12 21:45:08 +00:00
Stephen Finucane
34fafa2d8c Remove neutron.wsgi module
We want this module for use elsewhere. This has a natural home in the
neutron.api module so move it there. This is similar to what has
previously been done for nova [1].

Tests for the module are also moved and other tests slightly decoupled.

[1] https://review.opendev.org/c/openstack/nova/+/902686

Change-Id: I835e7ad95b6d7d83d06f4303b476519c16b9a2c8
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-06-12 19:46:11 +00:00
Brian Haley
05fcfef6ce Change to use selectin for DB load strategy
During a mailing list discussion on some OOM issues neutron
has been seeing [0], Mike Bayer recommended we should change
from using subquery to selectin DB load strategy.

A full description of this strategy can be found here [1],
but in short:

- “subquery” loading incurs additional performance / complexity
  issues when used on a many-levels-deep eager load, as
  subqueries will be nested repeatedly.

- "The subqueryload() eager loader is mostly legacy at this
  point, superseded by selectinload()

- "The only scenario in which selectin eager loading is not
  feasible is when the model is using composite primary keys,
  and the backend database does not support tuples with IN,
  which currently includes SQL Server." So that does not
  apply to us.

The plan agreed to at the neutron drivers meeting [2] was to
make this change early in the cycle so we would be able to
see if there were any issues through the D cycle.

Added hacking checks so new code using subquery loads is
not added back.

[0] https://lists.openstack.org/archives/list/openstack-discuss@lists.openstack.org/thread/EHLQQXNG3NLLZYPDGG2ES3DINIJ7YT3N/
[1] https://docs.sqlalchemy.org/en/20/orm/queryguide/relationships.html#selectin-eager-loading
[2] https://meetings.opendev.org/meetings/neutron_drivers/2024/neutron_drivers.2024-05-31-14.00.log.html#l-67

Closes-bug: #2067770
Depends-on: https://review.opendev.org/c/openstack/neutron-lib/+/920936
Change-Id: I6e40a15284da392a3d48d45205a7a5770c14c297
2024-06-12 11:31:22 -04:00
Zuul
abe8110f53 Merge "Revert "Use HasStandardAttributes as parent class for Tags DB model"" 2024-06-12 10:26:05 +00:00
Slawek Kaplonski
e1cf0f2d59 [CI] Enable OVN grenade job in the check and gate queue
As was agreed on the CI meeting [1], this patch moves
neutron-ovn-grenade-multinode job from the experimental queue to the
check and gate queues.
Now in check/gate there are 2 grenade jobs: one ovs-multinode job and
one ovn-multinode job.

To not increase number of jobs in the check/gate, this patch also moves
neutron-ovs-grenade-dvr-multinode job to the periodic (and experimental)
queue.

[1] https://meetings.opendev.org/meetings/neutron_ci/2024/neutron_ci.2024-06-11-15.02.log.html#l-18

Change-Id: I22d0f9a59bca6f412dcf30005678229a859d5e4c
2024-06-12 09:42:32 +02:00
Zuul
939f86f027 Merge "Remove old excludes" 2024-06-12 00:09:39 +00:00
Zuul
efe7930dd0 Merge "[OVN] Bump revision number after update_virtual_port_host" 2024-06-11 22:09:58 +00:00
Zuul
25608f2165 Merge "Bump neutron-lib to 3.13.0" 2024-06-11 18:04:21 +00:00
Zuul
319489cc8f Merge "[OVN] Fix virtual parent match for PortBindingUpdateVirtualPortsEvent" 2024-06-11 18:04:11 +00:00
Miro Tomaska
bf123dfb38 Revert "Use HasStandardAttributes as parent class for Tags DB model"
This reverts commit 85d3fff97e55ba85f72cda4365ad0441c10bd9f6.

Reason for revert:
The original change was made as a “cheap win” to optimize the number
of queries the neutron server makes during testing. This did
improve the number of queries made but introduced regression in
real world deployments where some customers(through automation)
would define hundreds of tags per port across a large deployment.
I am proposing to revert this change in favor of the old “subquery”
relation in order to fix this regression. In addition, I filed the
Related-Bug #2069061 to investigate using `selectin` as the more
appropriate long term solution.

Change-Id: I83ec349e49e1f343da8996cab149d76443120873
Closes-Bug: #2068761
Related-Bug: #2069061
2024-06-11 11:10:18 -04:00
Fernando Royo
f210a90479 [OVN] Bump revision number after update_virtual_port_host
This patch adds bump revision after updating the hostname
of a virtual port (more specifically its associated port).
This way there is no misalignment between the revision number
of Neutron DB and OVN DB.

It also avoids the unnecessary execution of the maintenance
task to simply match the revision_number.

Closes-Bug: #2069046
Change-Id: I2734984f10341ab97ebbdee11389d214bb1150f3
2024-06-11 14:22:18 +02:00
Zuul
22aa83fa3b Merge "Fix trunk test_subport_delete functional test" 2024-06-11 07:28:16 +00:00
Zuul
267b3d4805 Merge "[eventlet] Bump eventlet version to 0.36.1" 2024-06-10 20:28:14 +00:00
Michel Nederlof
170d99f2d5 [OVN] Fix virtual parent match for PortBindingUpdateVirtualPortsEvent
As mentioned in change [1], the condition should be a `is None` as per inline comment.

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

Related-Bug: #2038413
Change-Id: I3666cf0509747863ca2a416c8bfc065582573734
2024-06-10 15:39:26 +02:00
Rodolfo Alonso Hernandez
9e7cc782e6 [eventlet] Bump eventlet version to 0.36.1
This version should allow to run asyncio and eventlet applications in
the same thread.

Change-Id: I413327a5e3cbfc13ccd9cc0f7480073cbf7b2b36
2024-06-10 06:51:05 +00:00
Brian Haley
a8b6080cdf Bump neutron-lib to 3.13.0
Will allow neutron to start using 'selectin' DB load
strategy and addresses some issues with netaddr library
related code.

Depends-on: https://review.opendev.org/c/openstack/requirements/+/921518
Change-Id: I1f4c3af87a2c997dbfb003e2d276df20fdf1d0d5
2024-06-07 10:34:35 -04:00
Slawek Kaplonski
6af25b2588 Add policy for create_agent api call
Creation of agents is not really supported and returns BadRequest
exception when called but without default policy for that call
oslo_policy module was using default rule for it and that default one is
'admin_or_owner' which is not correct in case of agent resource as it
don't belongs to any tenant so don't have owner.

Additionally it seems that BadRequest exception raised by the
create_agent method was missing resource and msg parameters so this
patch added them too.

Related-Bug: #2022043
Change-Id: I3beb3f2ee2f4717b80c5422a2d3db8e93d322a1c
2024-06-07 15:39:35 +02:00
Miguel Lavalle
784e737295 Fix trunk test_subport_delete functional test
This change fixes a race condition between deleting a subport in the
trunk plugin and the actual deletion in the OVN NBDB.

Change-Id: I836d47a1879d474c2171905416a2838cfe3bab5a
Closes-Bug: #2067400
2024-06-06 19:46:20 -05:00
Zuul
ebed620aaf Merge "Bump oslo.service to 3.5.0" 2024-06-06 21:19:43 +00:00
Brian Haley
11027e3e1e Fix regex lines in zuul.d/* files
Commit 260c968118934 broke the gate by causing jobs
to not get run when it added RE2 compatibility for
irrelevant-files. Digging found that RE2 doesn't
support negative lookahead (and won't ever), so it's
impossible to replace the previous pcre filter with a
similar RE2 filter.

Instead of reverting to the original filter, which
is considered obsolete by zuul, this patch fixes the
issue by explicitly listing all files under zuul.d/
except the one that we actually want to trigger the
jobs: zuul.d/project.yaml.

Listing all the files in the directory for every job
is not ideal, and we may revisit it later, or perhaps
even reconsider the extensive use of irrelevant-files
in the neutron tree. This will have to wait for when
the gate is in better shape though.

[0] https://github.com/google/re2/issues/156

Related-bug: #2065821
Change-Id: I3bba89ac14414c6b7d375072ae92d2e0b5497736
2024-06-06 11:37:52 +05:30
eaca8a360f Add some swap to tox-cover job
As mentioned in the related bug we are seeing
hign memory usage in the job since sqlalchemy
bump to 2.0 and this leads to gate instability.
Adding some swap to handle this until the issue
is fixed.

Also reverts the concurrency reduction change[1]
that was done for this issue as that shouldn't be
needed now.

[1] https://review.opendev.org/c/openstack/neutron/+/920766
Related-Bug: #2065821

Change-Id: I33c4869c1d5230c0c8cc2f0dd4f6d071600bf220
2024-06-06 11:13:54 +05:30
Zuul
4769811451 Merge "Make openstack-tox-py311-with-sqlalchemy-master non-voting" 2024-06-04 12:18:48 +00:00
Zuul
bee9bde182 Merge "Add a default goto table=94 for openvswitch fw" 2024-06-04 05:36:55 +00:00
Ihar Hrachyshka
768d20f285 Bump oslo.service to 3.5.0
This is to include Ief3ab2f56fa3d805296709e12e5f7a71560f7b6e that is
needed by I730a12746bceaa744c658854e38439420efc4629.

Related-Bug: #2056366

Change-Id: I8a21c96e18df89301e5f1eeab51c4026e2635de9
2024-06-03 17:03:38 -04:00
Zuul
42ea2b28e1 Merge "Use RE2 compatible regex for irrelevant-files" 2024-06-03 18:50:52 +00:00
Zuul
9b89f51852 Merge "Bump neutron-lib to 3.12.0" 2024-06-03 09:39:47 +00:00
260c968118 Use RE2 compatible regex for irrelevant-files
Zuul has deprecated the usage of negative regex[1] and
reports WARNINGs when these are used.
This patch switches the branches regex to the supported
one.

[1] https://review.opendev.org/c/zuul/zuul/+/916141

Change-Id: I56a286cf33afb574436039128095e260539f63d9
2024-06-03 12:08:20 +05:30
Zuul
0397b307c2 Merge "Increase code coverage for safe_configure_dhcp_for_network()" 2024-06-03 06:10:02 +00:00
Zuul
c62ca18e41 Merge "reno: ml2/ovn allows to create/delete trunks for bound ports" 2024-06-02 18:41:52 +00:00
Zuul
5554613d53 Merge "Revert "[OVN] Prevent Trunk creation/deletion with parent port bound"" 2024-06-02 11:44:16 +00:00
Zuul
2f351d9e64 Merge "tests: Don't except error 400 from allocation_pools=None" 2024-06-02 09:48:32 +00:00
Ihar Hrachyshka
a508ce3913 reno: ml2/ovn allows to create/delete trunks for bound ports
Related-Bug: #2065707
Change-Id: I3db28c5b289aefd78055416db972d71352307302
2024-05-31 15:39:39 +00:00
Ihar Hrachyshka
ac15191f88 Revert "[OVN] Prevent Trunk creation/deletion with parent port bound"
There are three reasons to revert this patch.

1. It broke RPC push API for trunks because it added port db model to
   event payload that is not serializeable.

2. It also broke the callback event payload interface, which requires
   that all entries in .states attribute belong to the same core object.

To quote from neutron-lib,

```
 # an iterable of states for the resource from the newest to the oldest
 # for example db states or api request/response
 # the actual object type for states will vary depending on event caller
 self.states = ...
```

3. There is no good justification why ml2/ovn would not allow this
   operation. The rationale for the original patch was to align the
   behavior with ml2/ovs, but we don't such parity requirements. The 409
   error that can be returned by the API endpoints is backend specific.

To quote api-ref,

```
409 The operation returns this error code for one of these reasons:
    A system configuration prevents the operation from succeeding.
```

AFAIU there is nothing that prevents ml2/ovn to create a trunk in this
situation.

This will have to be backported in all supported branches (the original
patch was backported down to Wallaby).

Conflicts:
	neutron/services/trunk/drivers/ovn/trunk_driver.py

This reverts commit 833a6d82cd705548130cdac73a88d388f52c7824.

Closes-Bug: #2065707
Related-Bug: #2022059
Change-Id: I067c2f7286b2684b67b4389ca085d06a93f856ce
2024-05-31 15:39:25 +00:00
Ihar Hrachyshka
fe7276ecd8 tests: Don't except error 400 from allocation_pools=None
A recent change in neutron-lib [1] changed the behavior somewhat,
handling the None value explicitly passed as `allocation_pools` the same
way as if the field was not passed at all (meaning, setting pools from
start/end IP addresses for the subnet.)

This new behavior seems reasonable, so instead of reverting to the
original behavior, I'm making the test cases here not check an error
happens when None is passed.

[1] If768ab6a5f92d200841a734087bbc8fba8870dc6

Change-Id: I938ffabe7e74fa129c58dd4786153a0b4f374194
2024-05-31 11:25:08 -04:00
Ihar Hrachyshka
fd7ebe2960 Make openstack-tox-py311-with-sqlalchemy-master non-voting
The job can be affected by any patch landed in neutron-lib; the latter
repo doesn't run the job at all though.

We can add the job to neutron-lib check pipeline too (see bug referred
below), but more generally, we shouldn't gate on unreleased libraries.

The job is still extremely useful, but as advisory signal to anticipate
upcoming breakages.

Related-Bug: #2067515
Change-Id: Ia0be288b794b11659a5c98e4bd7c12a97c958926
2024-05-31 11:20:02 -04:00
Zuul
a8ca0930a7 Merge "Rename delete_flow_for_ip -> delete_flow_for_ip_and_mac" 2024-05-30 21:28:50 +00:00
Brian Haley
5a1e9826c2 Temporarily add '--concurrency 4' to coverage job
Add '--concurrency 4' when running coverage job as it
helps work around an OOM killer issue we are seeing in
the gate. It typically only adds between 10 and 30
minutes to job. Can revert once issue is resolved.

Partial-bug: #2065821
Change-Id: I33aea3a3c884877573d4d45c6e07955bb177c766
2024-05-29 13:41:04 -04:00
Zuul
06c1972a48 Merge "Return both project_id when validating auto allocate network" 2024-05-24 09:31:16 +00:00
Zuul
0534f5dea7 Merge "Do not fail on missing logical router ports" 2024-05-23 04:00:40 +00:00
Zuul
2718a7da47 Merge "Bump port revision if binding_levels changed" 2024-05-22 23:33:39 +00:00
Zuul
147dc93eff Merge "tests: Use del_fake_chassis when deleting a chassis" 2024-05-22 22:19:40 +00:00
Slawek Kaplonski
dfc01beab2 Return both project_id when validating auto allocate network
When neutron API is called to check requirements for the auto_allocate
topology, it needs to return not only 'tenant_id' field but also
'project_id' as that is required for the policy enforcement.
Without this 'project_id' field requirements check was failing for
member and reader users as they got 404 from the Neutron API. And the
reason why Neutron was returning 404 was that it wasn't passing policy
enforcement due to missing project_id field in the 'target' object.

Closes-bug: #2066369
Change-Id: Idf96a82bc6c8cb0b47dfde3baba94b42a8a8beba
2024-05-22 15:28:05 +02:00
Ihar Hrachyshka
60167cbb6e tests: Use del_fake_chassis when deleting a chassis
This will guarantee that regardless of ovsdbapp version, Chassis_Private
will be deleted. This allows us to wait for a single event (DELETE) and
test the same behavior for all ovsdbapp versions. (Behavior of agent
listing when both Chassis and Chassis_Private records are deleted from
ovn db.)

Depends-On: https://review.opendev.org/c/openstack/requirements/+/920062
Change-Id: I0dfa21a927067afb532d7632f7e05427623327f5
2024-05-22 05:40:01 +00:00