Commit Graph

18 Commits

Author SHA1 Message Date
Rodolfo Alonso Hernandez 2f944d3105 Support filtering for QoS rule type list
Added support for filtering the QoS rule type list command.
Two new filter flags are added:
- all_supported: if True, the listing call will print all QoS rule
  types supported by at least one loaded mechanism driver.
- all_rules: if True, the listing call will print all QoS rule types
  supported by the Neutron server.

Both filter flags are exclusive and not required.

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

Closes-Bug: #1959749
Change-Id: I41eaab177e121316c3daec34b309c266e2f81979
2022-02-24 08:28:53 +00:00
Nurmatov Mamatisa 26f3de0f78 Add minimum bw qos rule validation for network
Minimum bandwidth QoS rule is only applicable for the network which is
backed by physical networks.
It will raise exception when you want to set Minimum bandwidth QoS rule
or update rule on network without ports.

Closes-Bug: #1913180
Change-Id: I6ab945086b13730ad60957760bbc2eb5c321aca2
2021-02-19 11:26:40 +03:00
Brian Haley 7594bb0627 Remove the dependency on the "mock" package
Now that we are python3 only, we should move to using the built
in version of mock that supports all of our testing needs and
remove the dependency on the "mock" package.

This patch moves all references to "import mock" to
"from unittest import mock". It also cleans up some new line
inconsistency.

Fixed an inconsistency in the OVSBridge.deferred() definition
as it needs to also have an *args argument.

Fixed an issue where an l3-agent test was mocking
functools.partial, causing a python3.8 failure.

Unit tests only, removing from tests/base.py affects
functional tests which need additional work.

Change-Id: I40e8a8410840c3774c72ae1a8054574445d66ece
2020-04-28 18:05:37 -04:00
Bence Romsics 321afc8f89 Move rejection of min-bw rule on non-physnet port to the ovs qos driver
The ovs qos driver only supports the min-bw rule on physnet ports.
However other (future) qos drivers may support the min-bw rule on
non-physnet ports too, therefore implementing the rejection of the
unsupported combination in the qos plugin was a bug.

This change moves the rejection from the qos plugin to the ovs qos
driver.

Change-Id: I02d77a03c411dc8ab303a7d7b53d7ea93cc9f4c6
Closes-Bug: #1861442
Depends-On: https://review.opendev.org/705694
Related-Bug: #1819029
2020-02-21 15:00:23 +01:00
Boden R 9bbe9911c4 remove neutron.common.constants
All of the externally consumed variables from neutron.common.constants
now live in neutron-lib. This patch removes neutron.common.constants
and switches all uses over to lib.

NeutronLibImpact

Depends-On: https://review.openstack.org/#/c/647836/
Change-Id: I3c2f28ecd18996a1cee1ae3af399166defe9da87
2019-04-04 14:10:26 -06:00
Boden R 68fd13af40 remove neutron.common.exceptions
Today the neutron common exceptions already live in neutron-lib and are
shimmed from neutron. This patch removes the neutron.common.exceptions
module and changes neutron's imports over to use their respective
neutron-lib exception module instead.

NeutronLibImpact

Change-Id: I9704f20eb21da85d2cf024d83338b3d94593671e
2019-02-01 14:35:00 -07:00
Miguel Lavalle 03db94ebaa Pluralize binding relationship in Port
As a consequence of implementing multiple bindings for ports, [1] made
the following attributes lists:

- 'port_binding' in the in the SQLAlchemy Port model
- 'binding' in the Port OVO

This patch pluralizes their names to 'port_bindings' and 'bindings'
respectively

[1] Ie31d4e27e3f55edfe334c4029ca9ed685e684c39

Change-Id: I4ebe47cf9d51a700310aad8dcccc82fea3f00a16
2018-07-13 19:37:36 -05:00
Jakub Libosvar f7b62a7f29 Multiple port binding for ML2
Functionality is added to the ML2 plugin to handle multiple port
bindings

Co-Authored-By: Anindita Das <anindita.das@intel.com>
Co-Authored-By: Miguel Lavalle <miguel.lavalle@huawei.com>

Partial-Bug: #1580880

Change-Id: Ie31d4e27e3f55edfe334c4029ca9ed685e684c39
2018-07-13 18:14:50 -05:00
Boden R 1b8664f8e1 use qos constants from neutron-lib
neutron-lib contains the QoS constants. This patch removes them from
neutron and replaces all such uses to lib's QoS constants.

NeutronLibImpact

Change-Id: I6ed379b178a2b79fd14385a1d1e87d87eb04bfb9
2017-10-26 19:57:19 +00:00
Boden R 0822b0aef4 consume common constants from lib
The neutron-lib commit I360545b6ee4291547e0c5c8e668ad03d3efa4725 moved
the externally consumed globals from neutron.common.constants into lib.
With the exception of PROVISIONAL_IPV6_PD_PREFIX all other constants
in neutron.common.constants should only be used in neutron, and will
hopefully remain that way. External consumers needing access to other
common constants should move them into lib first.

NeutronLibImpact

Change-Id: Ie4bcffccf626a6e1de84af01f3487feb825f8b65
2017-10-13 11:45:18 -06:00
Boden R d37e974e46 use qos DriverBase from neutron-lib
neutron-lib contains the QoS DriverBase class. This patch removes
DriverBase and its associated UTs from neutron and uses them from
neutron-lib.

This patch also switches test_ovs_bridge to use mock.patch.object rather
than mock.patch as py27 was incurring sporadic failures running this
test module.

NeutronLibImpact

Change-Id: Ic8027b73f82d691bd3c465061a4c8d8301288b07
2017-09-05 11:05:00 -06:00
Sławek Kapłoński 2cc547241c New API call to get details of supported QoS rule type
This commit adds new API call that allows to discover
details about supported QoS rule type and its parameters
by each of loaded backend drivers.

DocImpact: New call to get details about supported
           rule_type for each loaded backend driver
ApiImpact

Change-Id: I2008e9d3e400dd717434fbdd2e693c9c5e34c3a4
Closes-Bug: #1686035
2017-07-11 14:24:17 +00:00
YAMAMOTO Takashi 55d810c7e6 Revert "Change list of available qos rules"
This reverts commit 3299cdffae.

At least, there's a user which relies on the previous
semantics. (Our tempest plugin)
We should not change API semantics lightly
in an incompatible way.

Closes-Bug: #1694396
Related-Bug: #1694190
Change-Id: I88a216951d8996ac8bc90078b4239f0d25392e58
2017-05-30 08:12:28 +00:00
Miguel Angel Ajo 45fd7eef6e Add precommit calls to the QoSDriver class
Added create, update and delete precommit calls for QoS
driver, to be used by some out-of-tree backends.

Co-Authored-By: Miguel Angel Ajo <mangelajo@redhat.com>
Co-Authored-By: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>

Closes-Bug: #1657381
Change-Id: I44dd7e049eab054363063021f07ade81ef2d1a90
2017-05-23 10:59:56 +01:00
Sławek Kapłoński 3299cdffae Change list of available qos rules
This patch changes way how neutron calculates which QoS rules
are available to use. It now returns all rule types which are
supported by at least one loaded QoS driver.
If user will want to apply policy with rule unsupported by driver
used by port then it will be catched on port/network update event.
This validation mechanism was introduced in
I75bd18b3a1875daa5639dd141fb7bbd6e1c54118

DocImpact: list of returned available QoS rule types is changed

Change-Id: Ia00d349625db358ab486802fc0ff2e69eaa3895e
Closes-Bug: #1686898
2017-05-03 17:14:29 +00:00
Miguel Angel Ajo 6037e53f07 Remove deprecated support for QoS notification_drivers
In Ocata, notification_drivers were deprecated in favor of
the new QoSDriver architecture.

This patch removes backwards compatible support for notification
drivers along with its testing.

Change-Id: I5f747635be3fd66b70326d9f94c85a6736286bd2
2017-04-17 06:32:01 -07:00
Sławek Kapłoński e2226fe373 Improve validation of supported QoS rules
New way of validation of QoS policy can be applied on port/network based on
port_types. It can validate if port can support rule by rule_type and also by
rule parameters or some values of parameters.

For example bandwidth_limit_rule can have parameter "direction" with
possible values "ingress" and "egress". Some of mechanism drivers can support
only one of those directions.

If user will try to apply policy with rule unsupported by port_type then it
will get error message and policy will not be applied.
Such validation is made during:
* port create
* port update
* network update
* QoS rule create
* QoS rule update

Co-Authored-By: Miguel Angel Ajo <majopela@redhat.com>

Implements blueprint qos-rules-validation
Closes-Bug: #1586056

Change-Id: I75bd18b3a1875daa5639dd141fb7bbd6e1c54118
2017-04-02 16:33:11 +00:00
Miguel Angel Ajo 38c1812015 Transition qos notification driver into qos driver
This will deprecate the notification_driver config setting,
and no config setting will be needed.

Also it lays down the foundation for a more decoupled interaction
with mechanism drivers.

Closes-Bug: #1657379
Related-Bug: #1627749
DocImpact

Change-Id: I2f166a43f0b980ad22617f8a3f7b4cc7f4786c48
2017-01-25 14:13:36 +01:00