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
The remainder of the neutron.common.exceptions were rehomed into
neutron-lib with [1]. This patch shims them in neutron to reference
those in neutron-lib thereby allowing consumers to move over to them
at their leisure. Once everyone is over to lib's version of the
exceptions we can remove them from neutron.
[1] https://review.openstack.org/#/c/628004/
Change-Id: I6af654a9854fb09353e7aa48b96a533490da6e96
This patch enables to bind a QoS policy to the router gateway,
then in L3 agent side SNAT traffic for the VMs without floating
IPs can be limited under the policy bandwidth rules. This is
suit for all kinds of L3 routers: DVR, DVR with SNAT HA, L3 HA
and Legacy.
API update router gateway json:
{
router": {
"external_gateway_info": {
...
"qos_policy_id": "policy-uuid"
}
}
}
Depends-On: https://review.openstack.org/#/c/567497/
Partially-Implements blueprint: router-gateway-ip-qos
Closes-Bug: #1757044
Related-Bug: #1596611
Change-Id: I26e22bce7edd1f93b2ac0048b61b14f858938537
The TenantIdProjectIdFilterConflict exception lives in neutron-lib now
and is not used anywhere in neutron. This patch removes the
TenantIdProjectIdFilterConflict class from neutron.
NeutronLibImpact
Change-Id: I0b56973f7500ce236b29ab858047f65d704347e1
The common rpc and exceptions were rehomed into
neutron-lib with [1]. This patch shims those rehomed
modules in neutron to switch over to neutron-lib's
versions under the covers.
To do so:
- The rpc and common exceptions are changed to
reference their counterpart in neutron-lib effectively
swapping the impl over to neutron-lib.
- The fake_notifier is removed from neutron and lib's
version is used instead.
- The rpc tests are removed; they live in lib now.
- A few unit test related changes are required
including changing mock.patch to mock.patch.object,
changing the mock checks for a few UTs as they don't
quite work the same with the shim in place.
- Using the RPC fixture from neutron-lib rather than
that setup in neutron's base test class.
With this shim in place, consumers are effectively using
neutron-lib's RPC plumbing and thus we can move consumers
over to neutron-lib's version at will. Once all
consumers are moved over we can come back and remove
the RPC logic from neutron and follow-up with a consumption
patch.
NeutronLibImpact
[1] https://review.openstack.org/#/c/319328/
Change-Id: I87685be8764a152ac24366f13e190de9d4f6f8d8
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
Currently, the neutron-openvswitch-agent does not start on Windows
due to Linux specific imports. This patch addresses this issue.
Also, we're wrapping the object returned by subprocess.Popen using
tpool.Proxy in order to prevent IO operations on the stream
handles from blocking other threads. Currently, the ovs db monitor
blocks the whole process.
Closes-Bug: #1775382
Co-Authored-By: Lucian Petrut <lpetrut@cloudbasesolutions.com>
Change-Id: I8bbc9d1f8332e5644a6071f599a7c6a66bef7928
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
This patch removes a handful of unused exceptions from
neutron.common.exceptions as follows:
The following exceptions already live in neutron-lib and are thus
duplicates in neutron:
PlacementEndpointNotFound
PlacementResourceProviderNotFound
PlacementInventoryNotFound
PlacementAggregateNotFound
PlacementInventoryUpdateConflict
NetworkVlanRangeError
PhysicalNetworkNameError
MacAddressGenerationFailure
The following exception is not used anywhere today:
TenantNetworksDisabled
NeutronLibImpact
Change-Id: Ie8227954681292ead1da0dedc950c54028ce84f1
When user tries to create QoS rule which already exists in same
QoS policy, only check if rule is duplicated was done on DB layer.
Because of that, there was many retries of DB operations so user
waits to response from Neutron server long time.
Also error message returned from this DB related exception was not
user friendly.
This patch adds additional check of such duplicated rules before
there is attempt to save new/updated rule in database so in case
of error, response is send to user faster and it has proper
message.
Change-Id: I7d55df1eb931583c3dde064e073deb3e5479acc2
Closes-Bug: #1746526
Add qos_policy_id to floating IP, then the user could set/update
the binding QoS policy of a floating IP.
APIImpact: a new parameter qos_policy_id was added to floating IP
related API.
Partial-Bug: #1596611
Partially-Implements blueprint: floating-ip-rate-limit
Change-Id: I4efe9e49d268dffeb3df4de4ea1780152218633b
This is the TC lib utils for L3 IP QoS implementation.
For more detail please see [1]: L3 agent side TC rules.
[1] https://review.openstack.org/#/c/374506/
Partially-Implements blueprint: floating-ip-rate-limit
Related-Bug: #1596611
Change-Id: Icfec83ca6dc31d7283d9c6c6ef0997d5e60daae6
There are four exceptions (TenantNetworksDisabled,
InvalidExtensionEnv, DvrHaRouterNotSupported,
MissingMinSubnetPoolPrefix) that are not used in Neutron, thus
unnecessary to have them in neutron/common/exceptions.py.
- TenantNetworksDisabled was added in [1] to Quantum, and was
raised when the tenant network type was TYPE_NONE.
It was used in the openvswitch and linuxbridge plugins in Quantum,
but now there are no occurrences of usage.
It is still used in the Neutron plugin of OpenContrail though,
so complete removal may be inappropriate right now.
- InvalidExtensionEnv (previously InvalidExtenstionEnv, renamed in
[2a]) was added in [2b] to Quantum. It was raised when the
appropriate quota driver was not provided, thus the extension
environment was invalid. The usage was removed in [2c].
- DvrHaRouterNotSupported was added in [3a], and was raised when the
router was both DVR and HA (it was not supported by that time).
The usage was removed in [3b].
- MissingMinSubnetPoolPrefix was added in [4]. I did not find any
prior usage of this exception.
This patch removes the last three exceptions from exceptions.py,
and adds a note to the first about possible removal in the future.
[1]: https://review.openstack.org/#/c/12362/
[2a]: https://review.openstack.org/#/c/23902/
[2b]: https://review.openstack.org/#/c/10484/
[2c]: https://review.openstack.org/#/c/23406/
[3a]: https://review.openstack.org/#/c/143733/
[3b]: https://review.openstack.org/#/c/196893/
[4]: https://review.openstack.org/#/c/148698/
Change-Id: Id47044e1feea4aea0d375b922aea7bd6cc50ac08
Added QoS policy network binding OVO. Direct access to
'qos_network_policy_bindings' DB table is removed.
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
Change-Id: I2a2037dae5a071bd220fa04b0988bc8e7172eb59
Added QoS policy port binding OVO. Direct access to 'qos_port_policy_bindings'
DB table is removed.
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
Change-Id: I40268f84bef808dcebd5c123fafc7a50a4d036f4
This patch implements the "default" behaviour for QoS policies.
If this flag is enabled for a QoS policy in a project, all
new networks created will have this QoS policy assigned by default.
If a new QoS policy is created or updated with this flag and another
QoS policy in the same project is set as the default policy, the new
one won't be created or updated. To set another QoS policy as default,
the current one must be unset.
DocImpact: A "default" flag is introduced for QoS policies. If this flag
is enabled in a QoS policy (attached to a project), then all
networks created in this project would have this QoS policy
assigned, unless an explicit policy is specified.
APIImpact
Closes-Bug: #1639220
Change-Id: If5ff2b00fa828f93aa089e275ddbd1ff542b79d4
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
Currently it is possible to create 2 rules in the same policy
where the Max Bandwidth ( from the Bandwidth Limit Rule ) can
be less than Minimum Bandwidth defined in ( Minimum Bandwidth
Rule) , which can be pretty confusing.
This patch raises an exception if such an issue occurs.
Change-Id: Ib748947bcd85253aa22e370a56870afbfbafa19b
Closes-Bug: #1667138
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
Using Nova's generic resource pools (GRP) API, publish routed networks
IPv4 inventory. This inventory is then used by the Nova scheduler to
place instances based on the availability of IPv4 addresses in
routed networks segments.
Change-Id: Ib6b00c4889d6a34765844ce46280819dff0108c5
Partially-Implements: blueprint routed-networks
This patchset adds a ReST client for the placement API. This
client is used to update the IPv4 inventories associated with
routed networks segments. This information is used by the
Nova scheduler to decide the placement of instances in hosts,
based on the availability of IPv4 addresses in routed
networks segments
DocImpact: Adds [placement] section to neutron.conf with two
options: region_name and endpoint_type
Change-Id: I2aa614d4e6229161047b08c8bdcbca0e2e5d1f0b
Partially-Implements: blueprint routed-networks
Subprojects have had enough time to switch to neutron-lib for
the deprecated items from these modules.
Change-Id: Ib2f4acf7e0153667389c57a52f2db33a23758b24
The deprecation shim created by Doug turns out to be rather useful.
It emits a warning when an global (attribute of a module) is
referenced but that global has been moved to another module.
This update makes the following changes to the shim:
- Rename it to _MovedGlobals to better describe what it is a
debtcollector for.
- Use inspect to get the original reference and to check that
_MovedGlobals is called from the last line of a module.
- Save the old reference automatically in the instance to prevent it
from getting garbage collected.
- Beef up the _moved_global() method for moving/renaming individual
globals, allowing it to move and rename or rename in place.
Change-Id: I868aa4a3129dd05467a103364088efbb86bc5d0f
Remove deprecation warnings for various constants
and exceptions that have moved to neutron_lib.
Fix miscellaneous other deprecations.
Uses constants instead of l3_constants when importing
neutron-lib constants.
Co-Authored By: Henry Gessau <gessau@gmail.com>
Co-Authored By: Gary Kotton <gkotton@vmware.com>
Change-Id: Ib0e8ff5c3e23677c1009241a1818cbc8a3430c38
Objects will directly support project_id filters only. The tenant_id
property is provided for mere convenience, and does not serve for
filtering purposes. So every time we'll need to pass filters from API
that still supports tenant_id attribute filtering, we'll need to do the
filter conversion.
This patch introduces the util function that will later be used by
other objects, like subnet, security group, or subnetpool (for the
latter, once we convert its existing tenant_id field to project_id).
Change-Id: If82c180688e1ecdff1c8a6e29cb8668838ac0a5b
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
The callback framework will collect all exceptions that occur
during the notification loop and raise a single exception
containing all of them. The issue with this is that the code
that notifies has to manually unpack the exceptions and choose
what to reraise for the API layer even if it has no other reason
to catch the exception (i.e. any encountered exceptions should be
fatal). If it doesn't, the server will just return a generic HTTP
500 error to the user even if the internal exception is a normal
error that would convert to a 404, 409, etc.
This patch makes the API exception conversion layer aware of
exceptions containing other exceptions so code no longer has to
catch callback failures if it has no specific error-handling logic.
Multiple exceptions that translate to the same HTTP error code will
be converted into one exception of the same error code with the
details of each exception line-separated in the exception message.
Multiple exceptions that translate to different HTTP error codes will
be concatenated together line-separated with their HTTP error prefixes
into an HTTP Conflict exception.
If there is only a single exception in the multi exception type, the
inner exception is used directly.
Partially-Implements: bp/multi-l3-backends
Change-Id: I528de088079b68cf284ef361fee9bd195125e0d8
Currently when the tenant attempts to detach an enforced QoS policy
for a port or network set by admin, the attempt fails but the API
feedback indicates that it was successful. This change will
fix the API response so the failure is accurately signalled
to the tenant.
Co-Authored-By: litong01 <litong01@us.ibm.com>
Co-Authored-By: gong yong sheng <gong.yongsheng@99cloud.net>
Co-Authored-By: Nate Johnston <Nate_Johnston@cable.comcast.com>
Co-Authored-By: Margaret Frances <margaret_frances@cable.comcast.com>
Change-Id: I977feecc6cce378abc1e6092afbaf9f2681b2ec6
Closes-bug: #1486607
This was planned to be removed a long time ago but no one ever got to
it. This shouldn't come as a surprise.
Closes-Bug: #1500960
Change-Id: I3a50d4c069dc54a7c86e7d79586d893a3ae31f2c
Co-authored-by: Ryan Moats <rmoats@us.ibm.com>
Since the InvalidIpForNetwork and InvalidContentType exception definitions
have already defined in neutron-lib, we don't need them in Neutron code.
Change-Id: I35afdf75a5e1fcb100f13f9ec3a0282192111e76
Signed-off-by: liusheng <liusheng@huawei.com>
If a tenant quota is not found, the delete operation should fail
with a 404 error. It currently returns 204 even if the delete
operation actually does not delete anything which is inconsistent
with other delete operations in the Neutron API.
APIImpact
Change-Id: I1cd91b5e06bd17f9aac97bba71228f2e5c48879b
Closes-Bug: 1307506
Co-Authored-By: Salvatore Orlando <salv.orlando@gmail.com>
I could not find any use of this exception in Neutron,
nor in any other project. It has a bad message: the policy
file name is hard coded. The policy file name is a config
option so it could be anything.
It should have been deleted with https://review.openstack.org/123673
Discovered while picking exceptions to move to neutron-lib.
Change-Id: I4732d84186520be3286417579ee3e2528fcf53a3
Debtcollector warnings are enabled by an env var for now, to avoid blasting
everyone's unit tests at once.
Partially-Implements: blueprint neutron-lib
Depends-On: I6991464acc3aef99f6ec5eff56a893deaaefe40b
Change-Id: If183b7a6797834e29c377937fc06261aa3b00249
Adds an ip_version field for enforcing an address family on
an AddressScope. All SubnetPools in an AddressScope must be
from the same address family. A SubnetPool cannot be created
in an AddressScope with a different address family.
Change-Id: Ibc6de08e0ef58a5da954d13f274f6003012a76cd
Partially-Implements: blueprint address-scopes
RetryRequest exception defined in oslo.db need be called with a arg
which describes the inner exception. _lock_subnetpool method missed this
arg, and this patch adds it.
Change-Id: I44869c97ecd7d59d40d8793c71515067a237150b
Closes-Bug: #1506818
This patch introduces mechanism similar to compare-and-swap
for updating reserved DHCP port.
This addresses a case when two DHCP agents that start nearly at
the same time are assigned to one network and there is a reserved
DHCP port in the network. Then each of agents will try to use it
because agents don't check if reserved port is still available.
Reserved DHCP port can be acquired by different agent between calls to
get_active_networks and update_port, so this patch adds a check for
this case.
Change-Id: I0277ab537ff9d3a664c03ea291b9ec2b0e784dbb
Closes-Bug: #1425402
This patch addresses below nits for existing neutron exceptions.
- Fix messages as appropriate.
- Remove additional spaces.
- Add periods as appropriate.
Change-Id: I8cfb5b3b5e4fdc2bf1e50ab6d898cb4c21e7ced1
Updating a distributed router back to a legacy router
should return error 400 (BadRequest), not error 500.
Closes-Bug: #1505346
Change-Id: Ia57e80107bd11ff7b38b89d30279603017913724
Instead of freeing the conntrack zone ids from removed ports
right before allocating a new one, wait until there is an
allocation error. This removes the overhead from the initial
zone id creation. Since there are 64K zone ids we might not
ever need to clean stale ones anyway.
Change-Id: Ie2d33f8d4650b7798d4ffdeb3ea79cc1092d6c2c
Note to reviewers: gerrit diff for merge patches is very limited, and
leaving comments in global section won't scale, so please comment here:
https://etherpad.openstack.org/p/qos-merge-back-review
This merge commit introduces QoS feature into Liberty release of
Neutron.
The feature is documented in: doc/source/devref/quality_of_service.rst
included with the merge patch.
It includes:
- QoS API service plugin with QoS policy and QoS bandwidth limit
(egress) rule support;
- core plugin mechanism to determine supported rule types, with its ML2
implementation;
- new agent extension manager;
- QoS agent extension with pluggable backend QoS drivers (Open vSwitch
and SR-IOV support is included).
To extend network and port core resources with qos_policy_id attribute,
a new ML2 extension driver (qos) was introduced that relies on the QoS
core resource extension (the idea is that eventually we'll get a core
resource extension manager that can be directly reused by core plugins).
Agent-server interaction is based on:
- get_device_details() method that is extended with qos_policy_id;
- a new push/pull mechanism that allows agents and servers to
communicate using oslo.versionedobjects based objects sent on the
wire.
The merge includes the following types of test coverage:
- unit tests;
- functional tests for OVS agent, QoS agent extension, and low level
ovs_lib changes;
- API tests to cover port/network qos_policy_id attribute and new QoS
resources.
The client changes can be found at:
* https://review.openstack.org/189655
* https://review.openstack.org/198277
The team also prepared fullstack test but it needs to wait for client
merge before it can pass in the gate:
* https://review.openstack.org/202492
Gerrit does not show diff for merge changes that did not result in any
conflict, so to facilitate review, rely on the following steps:
- fetch the patch locally
- git fetch origin
- git diff origin/master...
This merge also disables qos extension API tests until the service is
enabled in master gate.
Local changes apart from conflicts:
- updated down_revision for qos migration to reflect master expand head;
- disabled qos API tests with gate_hook.sh until we have it enabled in
master gate;
- bumped oslo.versionedobjects requirement to reflect what is in
openstack/requirements' global-requirements.txt
DocImpact
APIImpact
Partially-Implements: blueprint quantum-qos-api
Partially-Implements: blueprint ml2-qos
Partially-Implements: blueprint ml2-qos-ovs-bwlimiting
Partially-Implements: blueprint ml2-sriov-qos-with-bwlimiting
Change-Id: I92916d0e391791187e9a25ff172fb4b3504857b1