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
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>
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
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>
The path was old pointing not existing networking-ovn path.
Fixed also first paragraph about OVS/OVN installation.
Change-Id: Iee77443c0ac8cb83d4e380c53db8405eca642b2b
Closes-Bug: #1879747
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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