Commit Graph

23449 Commits (91f0bf3c8511bf3b0cc63746f767d8d4dce601bd)

Author SHA1 Message Date
Slawek Kaplonski 91f0bf3c85 [DVR] Reconfigure re-created physical bridges for dvr routers
In case when physical bridge is removed and created again it
is initialized by neutron-ovs-agent.
But if agent has enabled distributed routing, dvr related
flows wasn't configured again and that lead to connectivity issues
in case of DVR routers.

This patch fixes it by adding configuration of dvr related flows
if distributed routing is enabled in agent's configuration.

It also adds reset list of phys_brs in dvr_agent. Without that there
were different objects used in ovs agent and dvr_agent classes thus
e.g. 2 various cookie ids were set on flows in physical bridge.
This was also the same issue in case when openvswitch was restarted and
all bridges were reconfigured.
Now in such case there is correctly new cookie_id configured for all
flows.

Change-Id: I710f00f0f542bcf7fa2fc60800797b90f9f77e14
Closes-Bug: #1864822
2020-05-26 13:14:27 +02:00
Zuul 4acc6843e8 Merge "Switch to newer openstackdocstheme and reno versions" 2020-05-26 00:01:56 +00:00
Lucas Alvares Gomes f6010f6042 [OVN] Enhance port's extra DHCP options support
Prior to this patch OVN did not validate any extra DHCP option passed
to the port leading to confusion because the user of the API could just
input any value and OVN would accept it (returning 200) but ignoring the
option internally.

This patch now adds such validations on port creation and update.

This patch also sync with the latest supported DHCP options from OVN and
create a map between the different names and option codes to their OVN
counterpart.

Closes-bug: #1874282
Change-Id: I99799e54e941cdd8da2614feecad1ef6299703fc
Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
2020-05-25 11:23:02 +01:00
Zuul 673c5cb52b Merge "[OVN][DOC] Update path to L3RouterPlugin" 2020-05-25 09:48:13 +00:00
Zuul a1179e4065 Merge "Remove usage of the "firewall_driver" in the neutron server" 2020-05-25 02:37:34 +00:00
Zuul 4aace7ad30 Merge "[ci] Fix several rally task arguments" 2020-05-22 20:52:06 +00:00
Zuul ef97c83e87 Merge "Remove usage of six.add_metaclass" 2020-05-22 20:35:31 +00:00
Zuul 354dcccf2d Merge "Default OVN_BRANCH and OVS_BRANCH to latest stable" 2020-05-22 14:10:53 +00:00
Zuul 7b7ced04bb Merge "ovn: Override clean_hash_ring for sync util" 2020-05-22 11:41:01 +00:00
Zuul 6941530dca Merge "Fix neutron-ovn-db-sync-util issues" 2020-05-22 11:40:57 +00:00
Zuul 271c8a845f Merge "Ensure that stale flows are cleaned from phys_bridges" 2020-05-22 02:11:37 +00:00
Brian Haley 08a60f7483 Remove usage of six.add_metaclass
With python 3.x, classes can use the metaclass= logic
to not require usage of the six library.

One step in removing all of six usage from neutron.

Change-Id: I2f815e412d9a96eb5faf2b3bb3a1e393a9db9309
2020-05-21 14:41:18 -04:00
Jakub Libosvar f5c3910771 ovn: Override clean_hash_ring for sync util
ML2 OVN Mechanism driver wipes all the nodes from ovn_hash_ring table on
initialization. The DB sync untility inherits from the mechanism driver
calling the cleanup whenever sync util is executed. This leads to nodes
being deleted while neutron-server is typically running, causing serious
issues to neutron-server until it is restarted.

This patch overrides the clean method to no-op.

Change-Id: I5ea8278c0387009ff429572662d64e7664f493e7
Closes-Bug: #1879950
Signed-off-by: Jakub Libosvar <libosvar@redhat.com>
2020-05-21 15:18:39 +00:00
Zuul 8b2550d376 Merge "Fix broken unit tests related to ovsdbapp indexing" 2020-05-21 13:23:56 +00:00
Maciej Józefczyk 2d1cd99311 [OVN][DOC] Update path to L3RouterPlugin
The path was old pointing not existing networking-ovn path.

Fixed also first paragraph about OVS/OVN installation.

Change-Id: Iee77443c0ac8cb83d4e380c53db8405eca642b2b
Closes-Bug: #1879747
2020-05-21 12:32:24 +02:00
Zuul ac86b58c26 Merge "Time port fetches" 2020-05-21 04:53:49 +00:00
Andreas Jaeger d46228b0b3 Switch to newer openstackdocstheme and reno versions
Switch to openstackdocstheme 2.2.1 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems

Update Sphinx version as well.

Set openstackdocs_pdf_link to link to PDF file. Note that
the link to the published document only works on docs.openstack.org
where the PDF file is placed in the top-level html directory. The
site-preview places the PDF in a pdf directory.

Set openstackdocs_auto_name to use 'project' as name.

Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.

Remove docs requirements from lower-constraints, they are not needed
during install or test but only for docs building.

openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.

See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html

Change-Id: I780eea00c9c47f52dcc7928546fd22dec5d145b4
2020-05-20 22:06:45 +02:00
Zuul 415ddbff82 Merge "Revising log with wrong network_id when create port failed" 2020-05-20 18:28:24 +00:00
Zuul 418d09f687 Merge "Allow usage of legacy 3rd-party interface drivers" 2020-05-20 18:22:20 +00:00
Terry Wilson 162c5572df Fix broken unit tests related to ovsdbapp indexing
The periodic job running ovsdbapp master started failing after the
ovsdbapp custom indexing patch merged. There were just some things
that needed to be mocked out.

Closes-Bug: #1879717
Change-Id: I37d4c655662dd9d55b6096f2dc4fc861894706d2
2020-05-20 16:04:21 +00:00
Zuul c9753afaa2 Merge "Update QoS docs with info about OVN driver" 2020-05-20 04:04:50 +00:00
Zuul 9548991deb Merge "Add sg name in after delete event kwargs" 2020-05-20 04:04:37 +00:00
Slawek Kaplonski 30d573d5ab Allow usage of legacy 3rd-party interface drivers
In the patch [1] we changed definition of the abstract method
"plug" in the LinuxInterfaceDriver class.
That broke e.g. 3rd-party drivers which still don't accept this
new parameter called "link_up" in the plug_new method.

So this patch fixes this to make such legacy drivers to be still working
with the new base interface driver class.

This commit also marks such definition of the plug_new method as
deprecated. Possibility of using it without accepting link_up parameter
will be removed in the "W" release of the OpenStack.

[1] https://review.opendev.org/#/c/707406/

Change-Id: Icd555987a1a57ca0b31fa7e4e830583d6c69c861
Closes-Bug: #1879307
2020-05-20 00:32:49 +00:00
Terry Wilson 21405378f0 Fix neutron-ovn-db-sync-util issues
Two places needed to pass the _plugin_context like the mech driver
already does since PortContext has no session. There was also a
place where a port object was passed instead of a port id.

Closes-Bug: #1879502
Change-Id: I19ee7b0cf4f8ab187e0a9025eece1ad3525e58e4
2020-05-19 14:11:05 +00:00
Zuul ba05201e0e Merge "Optimize QoS bound objects queries" 2020-05-18 10:20:20 +00:00
Zuul be8cab91f8 Merge "Fix neutron tests" 2020-05-16 22:10:44 +00:00
Zuul dbc4e8ce44 Merge "Fix mock.patch.stopall issue with ovsdbapp" 2020-05-15 23:31:51 +00:00
Zuul 15088b39ba Merge "Set class ovsdb_conection to None" 2020-05-15 23:07:23 +00:00
Hang Yang a2561fa480 Add sg name in after delete event kwargs
Allow the subscriber to know the deleted security group name. It can
help some downstream callback utilization to use the deleted sg name for
additional workflow.

Change-Id: Ia321ff96cf445d20f082779d3f6a96fac07b0943
2020-05-15 10:10:15 -05:00
Terry Wilson ccb0cddd4a Fix mock.patch.stopall issue with ovsdbapp
After I876919dfc1fa0ae36bd99e3d760e38d207ee6ef3, two test classes
that inherit from both neutron's oslotest-based base classes and
ovsdbapp's unittest-based base class would fail due to
mock.patch.stopall being called twice. This appears to be because
of some special handling in oslotest addCleanup that checks a
private _cleanups variable before adding a cleanup to stopall.
Changing the order of the imports so that neutron can register its
cleanups first seems to fix the issue.

Closes-Bug: #1878708
Change-Id: I5b3812a9765a37b3e66d6c8ca0cb42ee1b7a2b9a
2020-05-14 22:33:50 +00:00
Slawek Kaplonski 740ab628f4 Remove usage of the "firewall_driver" in the neutron server
Back in Newton, patch [1] added to the agents possibility to report in
the heartbeat messages if hybrid plug of the ports is required or not.
Usage of "firewall_driver" option by mechanism drivers (so on the
server's side) was kept just for backward compatibility.
But as we are now about 4 years from the [1] I think it should be safe
to do small cleaning, remove usage of this option in the neutron server
and not confuse users where this config option has to be set and why.

[1] https://review.opendev.org/#/c/311814/

Change-Id: I2ccc4c8784c64858acaa3c3431cf9a3d13e5e154
2020-05-14 23:55:59 +02:00
Michal Arbet faead08d8f Fix neutron tests
Test test_handle_trunk_remove_trunk_manager_failure is trying
to connect to tcp:127.0.0.1:6640. This behaviour can be visible
by netcat while test is running. As this is unit test, it should
use mock, not real ovsdb. This patch is fixing this.

$ nc -l -p 6640
{"id":0,"method":"get_schema","params":["Open_vSwitch"]}

Change-Id: I25161913d701e15d127c70d71ac025e4573e81f1
2020-05-14 19:13:21 +02:00
Zuul cb55643a06 Merge "[OVN]: Make _delete_port() more error-resilent" 2020-05-14 00:33:54 +00:00
Zuul 80ac531a3f Merge "Skip OVS module compilation for kernels newer than 5.5" 2020-05-14 00:20:45 +00:00
Zuul 21b5e5afc1 Merge "Fix ovn-db-sync-util after removing l3 ovsdb connection" 2020-05-14 00:12:44 +00:00
Zuul fc2ed6f477 Merge "Add Rocky milestone tag for alembic migration revisions" 2020-05-13 22:37:14 +00:00
Slawek Kaplonski 63c45b3766 Ensure that stale flows are cleaned from phys_bridges
In case when neutron-ovs-agent will notice that any of physical
bridges was "re-created", we should also ensure that stale Open
Flow rules (with old cookie id) are cleaned.
This patch is doing exactly that.

Change-Id: I7c7c8a4c371d6f4afdaab51ed50950e2b20db30f
Related-Bug: #1864822
2020-05-13 23:10:41 +02:00
Rodolfo Alonso Hernandez 1f018514d7 Optimize QoS bound objects queries
Optimize the following methods:
- get_bound_networks
- get_bound_ports
- get_bound_floatingips
- get_bound_routers

Those methods, using the "QosPolicy_XXXX_Binding" OVO interface, were
retrieving all objects with a certain policy ID and then returning
only the ID of the _XXXX_ object. That means to retrieve a full
register list from the DB, then converted them to OVOs and extract
only the _XXXX_ ID.

This patch retrieves only the _XXXX_ object IDs from the DB and
returns the list, without the OVO conversion.

Change-Id: I891eba93b3b4abaec8ada13a032b5440cbb0548d
Closes-Bug: #1877560
2020-05-13 16:44:15 +00:00
Dongcan Ye 9ae865a5b5 Add Rocky milestone tag for alembic migration revisions
Add lacking alembic migration revisions for Rocky.

Change-Id: I287d7aea1ffa1a380ba627eb1c9addd794a8059c
Closes-Bug: #1878314
2020-05-13 02:30:01 +00:00
Akihiro Motoki 52e3fee5ef Switch to hacking 3.0.1
In hacking 2.0 or later, local-check-factory was removed as it is not
compatible with flake8 3.x and it is advised to use flake8's local
plugins [1]. neutron-lib provided a factory to register common hacking
rules, but it no longer works with hacking 2, so we need to define rules
defined in neutron-lib as flake8 local check plugin [2] explicitly.
This needs to be done in each neutron related project, so it is the
downside of the migration to hacking 2.x (I explored a way to continue
to use the factory but failed to find a good way to achieve this) but
I believe it is good to migrate the newer libraries.

* flake8ext decorator in neutron/hacking/checks.py is also replaced with
  hacking.core.flake8ext to avoid the copy-and-paste code.
* neutron-lib dependency is updated as neutron-lib 2.3 added hacking 3 support.
* Python modules related to coding style checks (listed in blacklist.txt in
  openstack/requirements repo) are dropped from lower-constraints.txt
  as they are not actually used in tests (other than pep8).
* HackingDocTestCase is now converted into normal test cases.
  HackingDocTestCase depends on the internal of hacking and pycodestyle
  so it looks better to use normal style of writing tests.

[1] https://docs.openstack.org/releasenotes/hacking/unreleased.html#relnotes-2-0-0
[2] https://flake8.pycqa.org/en/3.7.0/user/configuration.html#using-local-plugins

Change-Id: I92cf50a84bb587a0649a7cffee15cce4ce37d086
2020-05-12 16:58:41 -04:00
Maciej Józefczyk 0ba08d7eb4 Skip OVS module compilation for kernels newer than 5.5
For now OVS doesn't support compilation of kernel module
for kernels newer than 5.5 [1].
Recently Fedora 31 upgraded the kernel to 5.6.8 and that is
why the periodic jobs started to fail [2].
By default we enabled OVS module compilation because Ubuntu
Bionic one doesn't have support for Openflow Meter actions.

In case flag OVN_BUILD_MODULES is set to True and kernel is
newer than 5.5 lets skip the module compilation with proper log.

Closes-Bug: #1877377

[1] https://zuul.openstack.org/builds?job_name=neutron-ovn-tempest-ovs-master-fedora
[2] 59e9944266

Change-Id: I63b2f198468c9e30af8284c8033fa31f2af2518a
2020-05-12 17:51:26 +00:00
Zuul 08e9ec1b56 Merge "Open Victoria DB branch" 2020-05-12 17:05:29 +00:00
Zuul 2542020748 Merge "Add "qos_policy_id" field to "FloatingIP" OVO" 2020-05-12 17:05:25 +00:00
Nate Johnston 09bf28aa88 Time port fetches
Time port fetches to isolate performance problems.

Change-Id: Idaca95e5769e0562b29ffc148b39b287cc31939e
2020-05-12 12:02:20 -04:00
Terry Wilson c05bac8c40 Set class ovsdb_conection to None
We override ovsdbapp's Backend class to change from using a class
variable for the ovsdb_connection to using an instance variable.
This means we have to override several different methods/properties.
This could be simplified in ovsdbapp by making ovsdb_connection a
property, which in ovsdbapp access a class variable, and in neutron
it is overridden to to store on the instance, so there would be
less to override.

ovsdbapp is adding user-definable indexed columns so things like
lookups by name will be faster. Due to the way it is architected,
the place to generate the indexes would be just before the
connection starts. Since methods like start_connection are
classmethods in ovsdbapp, and instance methods in neutron, this is
hard to do cleanly w/o ovsdb_connection being a property. Without
this change, neutron would fail if that property was defined. With
the change, it should pass with both old and new code.

Change-Id: Idd184807de24c79dd892046f01e3acdd1168ca2d
2020-05-12 15:29:38 +00:00
Brian Haley 0a4b95eec2 Fix some pep8 errors
A new pep8 style library must have been released which
is causing some new errors, E471 among them. Clean-up
on aisle 8.

Change-Id: I153abada74e8c522fe9866a239a36dbb8365a29e
2020-05-11 18:23:22 -04:00
Maciej Józefczyk e0e3086b46 Default OVN_BRANCH and OVS_BRANCH to latest stable
If other openstack project uses Neutron with OVN
(as enable_plugin ... neutron) and doesn't specify
OVN_BRANCH and OVS_BRANCH variables in configuration
it will use master branch of those two repositories.

Master branch servers for OVN testing and aligning OVN
Neutron driver with new features.

For now we don't have voting OVN master CI job, to ensure that
everything is fine with it, so we should default OVN for other
projects to the latest stable version that we know works properly.

Change-Id: I6e36ccb8cf4846a1eb11619e7c339a0fc193c4f6
2020-05-11 16:26:11 +02:00
Rodolfo Alonso Hernandez 8cfe41fa6b Add "qos_policy_id" field to "FloatingIP" OVO
This new synthetic field is linked to a "QosPolicyFloatingIPBinding"
register. This binding register will bind a QoS policy and a
floating IP.

Now is possible to provide this field in the create/update input
parameters. If provided, the "FloatingIP" OVO will create/delete the
"QosPolicyFloatingIPBinding" register.

The OVO takes this parameter from the DB object. When the DB object
is retrieved, the QoS policy binding register is retrieved too due
to a backref link in the "QosFIPPolicyBinding" DB model to the
"FloatingIP" DB model.

Change-Id: Ideb042a71336b110bbe0f9e81ed8e0c21434fc42
Closes-Bug: #1877404
Related-Bug: #1877408
2020-05-11 11:29:30 +00:00
Zuul 2ac52607c2 Merge "Complete removal of dependency on the "mock" package" 2020-05-10 12:57:39 +00:00
Zuul 244f2764b3 Merge "port_forwarding: extend support for OVN usage" 2020-05-09 14:26:29 +00:00