This patch adds support for QoS minimum bandwidth rules in tunnelled
networks. Now the ML2/OVS and ML2/OVN mechanism drivers can represent
in the Placement API the available bandwidth of the tunnelled networks
in each compute host.
Both mechanism drivers represent the compute VTEP (VXLAN) or TEP
(Geneve) interface as an IP address. This new resource provider
(by default called "rp_tunnelled") represents the available bandwidth
of this interface. Any new port created in a compute node that belongs
to a tunnelled network, will request to the Placement API the
corresponding bandwidth from the resource provider inventory.
This patch does not provide backend enforcement support for minimum
bandwidth rules.
RFE spec: https://review.opendev.org/c/openstack/neutron-specs/+/860859
What is missing and will be added in next patches:
* Tempest tests, that will be pushed to the corresponding repository.
Depends-On: https://review.opendev.org/c/openstack/neutron-tempest-plugin/+/863880
Partial-Bug: #1991965
Related-Bug: #1578989
Change-Id: I3bfc2c0f9566bcc6861ca91339e32257ea92c7e9
Add packet rate limit rule to the openvswitch QoS
driver SUPPORTED_RULES list. This patch adds the
ability to limit neutron port packet I/O rate. We
will leverage the ovs meter to achieve the limitation.
The meter action is only supoorted when datapath is
in user mode (with ovs >= 2.7) or ovs kernel datapath with
kernel version >= 4.15 (and ovs >= 2.10).
[1] https://docs.openvswitch.org/en/latest/faq/releases/
Partially-Implements: bp/packet-rate-limit
Related-Bug: #1938966
Related-Bug: #1912460
Change-Id: Ib6341ad539afc9f94f1783a721cf5f793ccdc7d8
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
Today the sriov qos service plugin blindly blocks creating ports
with minimum bandwidth qos and with direct_physical vnic_type. This was
originally added when only dataplane enforcement was the scope of the
qos service plugin. However in the last many releases we created
placement enforcement for this qos rule regardless of the vnic_type.
So now blindly blocking the port creation is now preventing using the
placement enforcement for this rule for direct_physical ports.
This patch removes this limitation by marking minimum bandwidth as
supported rule for the sriov qos service plugin. The limitation that
data plane enforcement is not supported for this rule remains. The agent
will not even try to apply any kind of rules to these ports as port
binding is not forwarded for the sriov agent at all.
The documentation is extended to explain that placement enforcement now
works while data plane enforcement still not supported.
This is somewhat similar to the case when the support for egress
direction is added to the minimum bandwidth rule, while the sriov data
plane enforcement was not (could not) been implemented for this
direction in the sriov agent. Today the sriov agent simply ignores the
egress direction rules in the minimum bandwidth qos rule during applying
the data plane enforcement.
Closes-Bug: #1949877
Change-Id: I20ad32eac414ff90b551bff940d92cbcfa848101
Remove the QoS constants from Neutron code. QoS constants are now
located in ``neutron_lib.services.qos.constants``.
This patch also reverts [1]. This patch was merged in order to
allow a newer neutron-lib release in "requirements". This test
was failing because the element order of the "VALID_RULE_TYPES"
list was different between Neutron and neutron-lib. That was
modifying the "QosRuleType" OVO hash.
[1]https://review.opendev.org/c/openstack/neutron/+/817940
Closes-Bug: #1950977
Related-Bug: #1922237
Change-Id: I31edea3cc0f4a284a773a35302997ca6069efc95
In order to be able to schedule a port bound to OVN backend and a
minimum bandwidth rule, this type of QoS rule should be supported
in the mechanism QoS driver ``OVNQosDriver``.
This new QoS rule has no driver enforcement; it is used only for
Placement scheduling.
Partial-Bug: #1578989
Change-Id: Ia10aae1820f13bb28956d9ef45eced2dba71be98
This patch does *not* implement dataplane enforcement.
QoS minimum packet rate rule is enabled in OVS backend driver and
create/delete/update empty methods are added to enable placement
enforcement.
Partial-Bug: #1922237
See-Also: https://review.opendev.org/785236
Change-Id: Ie283ad3a4ec433c88ac23f798908cd143159394b
This patch adds new API extension to QoS service plugin
to allow CURD actions for packet rate limit (packet per
second) rule in Neutron server side.
NOTE: This patch will NOT implement the real functionality
in L2/L3 backend to limit the pps.
Co-Authored-By: NANALI <lin203@chinaunicom.cn>
Closes-bug: #1912460
Change-Id: Icc88accb88d9cec40c960c56f032c3c27317b42e
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
As spotted in Focal testing patch [0], pep8 test fails with many
C0321 false-positives, reported in pylint as current version does not
support python 3.8 [1]
Use a newer version of pylint and astroid, fixing or disabling some of
the new checks: no-else-*, unnecessary-comprehension, import-outside-toplevel
[0] https://review.opendev.org/#/c/738163/
[1] https://github.com/PyCQA/pylint/issues/2737
Change-Id: Ie646b7093aa8634fd950c136a0eba9adcf56591c
The QoS OVN client extension is moved to the ML2 driver. This
extension is called from the OVN driver in the events of:
- create port
- update port
- delete port
- update network
The QoS OVN client extension now can accept several rules per policy
as documented in the SUPPORTED_RULES. The QoS OVN client extension
can write one OVN QoS rule per flow direction and each OVN QoS rule
register can hold both a bandwidth limit rule and a DSCP marking rule.
The "update_policy" method is called from the OVN QoS driver, when
a QoS policy or its rules are updated.
The QoS OVN client extension updates the QoS OVN registers
exclusively, based on the related events.
Closes-Bug: #1863852
Change-Id: I4833ed0c9a2741bdd007d4ebb3e8c1cb4c30d4c7
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
If QoS rule is QosBandwidthLimitRule, then the generated options in
the QoS OVN driver of the QoS service should contain those two
parameters: "qos_max_rate" and "qos_burst".
According to [1], the units used are:
- qos_max_rate: kbps, the one used in Neutron
- qos_burst: kilobits, the one used in Neutron
A "rule.max_kbps" value should be always present in the rule, but not
"rule.max_burst_kbps". This value can be None in
OvnNbApiIdlImpl.QoSAddCommand.
[1]http://www.openvswitch.org/support/dist-docs/ovn-nbctl.8.html
Change-Id: Ie1598be7d21f33df6b1a66fa71ba6783d2433dca
Closes-Bug: #1861680
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
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
Enable QoS minimum-bandwidth rule for ovs and sriov backends for both
ingress and egress directions.
Add qos-bw-limit-direction as supported extension to qos-plugin, and
add create/delete/update_minimum_bandwidth and
delete_minimum_bandwidth_ingress empty methods to sriov/ovs/linuxbridge
extension drivers.
Change-Id: I6eb21ccf0400ea9adae90ff0bf97e08cdb09b8eb
Depends-On: https://review.openstack.org/609368
Partial-Bug: #1578989
See-Also: https://review.openstack.org/502306 (nova spec)
See-Also: https://review.openstack.org/508149 (neutron spec)
The get_port_binding_by_status_and_host function was rehomed into
neutron-lib with https://review.openstack.org/#/c/580786/ and released
in neutron-lib 1.18.0. This patch consumes the function by removing it
in neutron and replacing all uses with lib's version.
NeutronLibImpact
Change-Id: Iac3246d0eb59709749e0b7e857091447d11a0133
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
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
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
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
Part of the work we did while rehoming the callback modules introduced
the notion of payload objects [1] to replace the unstructured kwargs
used today. When using payloads event sources need to use publish()
rather than notify() to trigger the callback(s) and pass along a payload
object (if needed).
This patch begins to move us onto the payload objects by updating
BEFORE_INIT and AFTER_INIT event types to use the payloads.
NB: This change needs to be in sync with consumers using the events
herein. Once publish() is used with payloads, callback functions must
also define the payload kwarg to follow suit. Therefore such consumers
need to depend on this patch.
NeutronLibImpact
[1] https://docs.openstack.org/neutron-lib/latest/contributor/callbacks.html#event-payloads
Change-Id: I9194c7857f10392149159071cda8e080e93adc10
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
Since Pike log messages should not be translated.
This patch removes calls to i18n _LC, _LI, _LE, _LW from
logging logic throughout the code. Translators definition
from neutron._i18n is removed as well.
This patch also removes log translation verification from
ignore directive in tox.ini.
Change-Id: If9aa76fcf121c0e61a7c08088006c5873faee56e
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
Add support for QoS ingress bandwidth limiting in
linuxbridge agent.
It uses traffic shaping done by tc with tbf qdisc.
DocImpact: Ingress bandwidth limit in QoS supported by
Linuxbridge agent
Change-Id: Id495b302d31f5527db3e45b51517bc53153e7fc2
Partial-Bug: #1560961
Add support for QoS ingress bandwidth limiting in
openvswitch agent.
It uses default ovs QoS policies on bandwidth limiting
mechanism.
DocImpact: Ingress bandwidth limit in QoS supported by
Openvswitch agent
Change-Id: I9d94e27db5d574b61061689dc99f12f095625ca0
Partial-Bug: #1560961
Changed allowed directions for QoS minimum bandwidth rule in
SR-IOV driver to only "egress". Currently this is the only
supported direction for this rule in this backend.
Closes-Bug: #1696679
Change-Id: Ia56146143e902663e9a47231773956ab2f035c8e
With [1], the vif_type for a Linux Bridge port is set
to 'tap', replacing 'bridge'. This definition needs to be
changed in the list of supported vif types in the pluging
driver.
[1] https://review.openstack.org/#/c/447150/
Change-Id: I715565627b2446533298b5905edbaa256bd84c92
Closes-Bug: #1694190
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
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
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
This patch introduces the new parameter "direction" to
the QoS bandwidth limit rule. It will allow the creation
of bandwidth limit rules for either ingress or egress
traffic. For backwards compatibility the default direction
will be egress.
DocImpact: Ingress bandwidth limit available for QoS
APIImpact: New type of parameter for QoS rule in neutron API
Change-Id: Ia13568879c2b6f80fb190ccafe7e19ca05b0c6a8
Partial-Bug: #1560961
The callback modules have been available in neutron-lib since commit [1]
and are ready for consumption.
As the callback registry is implemented with a singleton manager
instance, sync complications can arise ensuring all consumers switch to
lib's implementation at the same time. Therefore this consumption has
been broken down:
1) Shim neutron's callbacks using lib's callback system and remove
existing neutron internals related to callbacks (devref, UTs, etc.).
2) Switch all neutron's callback imports over to neutron-lib's.
3) Have all sub-projects using callbacks move their imports over to use
neutron-lib's callbacks implementation.
4) Remove the callback shims in neutron-lib once sub-projects are moved
over to lib's callbacks.
5) Follow-on patches moving our existing uses of callbacks to the new
event payload model provided by neutron-lib.callback.events
This patch implements #2 from above, moving all neutron's callback
imports to use neutron-lib's callbacks.
There are also a few places in the UT code that still patch callbacks,
we can address those in step #4 which may need [2].
NeutronLibImpact
[1] fea8bb64ba7ff52632c2bd3e3298eaedf623ee4f
[2] I9966c90e3f90552b41ed84a68b19f3e540426432
Change-Id: I8dae56f0f5c009bdf3e8ebfa1b360756216ab886
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
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
Neutron-lib 1.1.0 is now out and contains the portbindings
API definition (as per commit [1]). This patch moves neutron
references over to the neutron-lib version.
NeutronLibImpact
- Consumers using the public constants within neutron's
portbindings API extension must now use the values
from neutron-lib.
[1] 87e42f993c07ae320159d5123662ee9f3bd4d903
Change-Id: I669af9b4c712877772d91a03857ab108714001d4