Commit Graph

9 Commits

Author SHA1 Message Date
Rodolfo Alonso Hernandez 10c2fa034f [QoS][L3] Use floating IP OVO QoS fields
Since [1], "FloatingIP" OVO has the synthetic field "qos_policy_id",
linked to "QosPolicyFloatingIPBinding". This patch uses the OVO
implementation to bind the corresponding QoS policy to the floating
IP register.

Related-Bug: #1877404

[1]https://review.opendev.org/c/openstack/neutron/+/726208

Change-Id: I7071eb29c55fadcb3a87bd9c7f76e4c68c3ea217
2022-03-15 09:14:24 +00:00
Rodolfo Alonso Hernandez 42cfa055c2 Add network QoS inheritance to floating IP
Added information of the floating IP network QoS policy to the
``FloatingIP`` OVO. The view-only parameter added allows to check
the network QoS policy in the floating IP object.

This patch does not implement any change in the L3 code (OVS or
OVN). This patch does not change any existing behaviour.

NOTE: bump neutron-lib version

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

Partial-Bug: #1950454
Change-Id: I9d7bb54b14fb983161fdf51c96b6fda107db4fe6
2021-11-24 09:01:09 +00:00
Boden R 29f56478d1 remove the neutron.db._resource_extend module
The _resource_extend module is already rehomed into neutron-lib and is
shimmed in neutron. This patch removes the module as no active
consumers are using it.

NeutronLibImpact

Change-Id: I1550075fa5fa2aa2f1a88ee7189d311a1fe78391
2019-01-02 13:02:06 -07:00
LIU Yulong a034e8e0f8 Refactor duplicated implementation of _get_policy_obj
This patch moves the implementation of the function
_get_policy_obj to the policy object code scope.

Change-Id: I7057558a5ec32a55a37a6b93dabc997d69abfb98
2018-06-20 09:51:02 +08:00
Ihar Hrachyshka adbef04629 Remove redundant get_object call when creating fip qos binding
We try to fetch binding (and doing it wrong by passing incorrect OVO
class), and then return the result to callers. But no callers care about
the result, so it's useless work (and bad code).

TrivialFix

Change-Id: I68b436c9a0665d276bcda30f414a79f4d83e3758
Related-Bug: #1746996
2018-02-08 20:53:58 -08:00
Ihar Hrachyshka 6f83466307 Allow objects to opt in new engine facade
New facade is enabled by setting new_facade = True for the object of
interest. With new_facade on, all OVO actions will use the new reader /
writer decorator to activate sessions.

There are two new facade decorators added to OVO: db_context_reader and
db_context_write that should be used instead of explicit
autonested_transaction / reader.using / writer.using in OVO context.

All neutron.objects.db.api helpers now receive OVO classes / objects
instead of model classes, since they need to know which type of engine
facade to use for which object. While it means we change signatures for
those helper functions, they are not used anywhere outside neutron tree
except vmware-nsx unit tests, and the latter pass anyway because the
tests completely mock out them disregarding their signatures.

This patch also adds several new OVO objects to be able to continue
using neutron.objects.db.api helpers to persist models that previously
didn't have corresponding OVO classes.

Finally, the patch adds registration for missing options in
neutron/tests/unit/extensions/test_qos_fip.py to be able to debug
failures in those unit tests. Strictly speaking, this change doesn't
belong to the patch, but I include it nevertheless to speed up merge in
time close to release.

There are several non-obvious changes included, specifically:

- in neutron.objects.base, decorator() that refreshes / expunges models
from the active session now opens a subtransaction for the whole span of
call / refresh / expunge, so that we can safely refresh model regardless
of whether caller opened another parent subtransaction (it was not the
case for create_subnetpool in base db plugin code).

- in neutron.db.l3_fip_qos, removed code that updates obj.db_model
relationship directly after corresponding insertions for child policy
binding model. This code is not needed because the only caller to the
_process_extra_fip_qos_update method refetches latest state of floating
ip OVO object anyway, and this code triggers several unit test failures.

- unit tests checking that a single commit happens for get_object and
get_objects are no longer valid for new facade objects that use reader
decorator that doesn't commit but close. This change is as intended, so
unit tests were tweaked to check close for new facade objects.

Change-Id: I15ec238c18a464f977f7d1079605b82965052311
Related-Bug: #1746996
2018-02-09 04:07:34 +00:00
Boden R 54444407f4 use l3 api def from neutron-lib
Commit I81748aa0e48b1275df3e1ea41b1d36a117d0097d added the l3 extension
API definition to neutron-lib and commit
I2324a3a02789c798248cab41c278a2d9981d24be rehomed the l3 exceptions,
while Ifd79eb1a92853e49bd4ef028e7a7bd89811c6957 shims the l3
exceptions.

This patch consumes the l3 api def by:
- Removing the code from neutron that's now in lib.
- Using lib's version of the code where applicable.
- Tidying up the related unit tests as now that the l3 api def from lib
is used the necessary fixture is already setup in the parent chain when
setting up the unit test class.

NeutronLibImpact

Change-Id: If2e66e06b83e15ee2851ea2bc3b64ad366e675dd
2017-12-15 07:03:14 -07:00
Lujin 9566810b38 Integration of Floating IP OVO
This patch integrates floating IP OVO.

Co-Authored-By: Shashank Kumar Shankar <shashank.kumar.shankar@intel.com>
Change-Id: I543669ed3bd59a1f7d5b999e3113bcea7b3c52a8
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
2017-12-04 19:30:02 +09:00
LIU Yulong 8fcda21a06 [L3][QoS] Neutron server side Floating IP QoS
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
2017-11-29 16:45:38 +08:00