Commit Graph

15 Commits

Author SHA1 Message Date
shanyunfan33 0e6257606a remove unicode from code
remove unicode from code

Change-Id: Ide37b3c1f8a2e2dcdcac0a2b0631cb197eca5baf
2021-12-24 10:02:03 +08:00
Przemyslaw Szczerbik 8db15cb2f3 Add port-resource-request-groups extension
port-resource-request-groups extension provides support for the
new format of resource_request. The new format allows to request
multiple groups of resources and traits from the same RP subtree.

Closes-Bug: #1943724
Partial-Bug: #1922237
Depends-On: https://review.opendev.org/c/openstack/tempest/+/809168/
See-Also: https://review.opendev.org/785236
Change-Id: I99a49b107b1872ddf83d1d8497a26a8d728feb07
2021-10-21 14:30:07 +02: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
Rodolfo Alonso Hernandez 0d43372f14 Add "project_id" filter when changing the network segmentation ID
When the segmentation ID of a network is updated, first the provider
network segment is validated and then reserved. If service plugin
"network_segment_range" is enabled, the Neutron server retrieves the
network segment ranges with shared=True or those ones with the same
project_id as the network.

This patch adds the "project_id" information to the filters when
reserving the network provider segment. This change will allow to
retrieve those private networks segments belonging to the same
project.

Change-Id: I21bd60af000276779f56b3a6d45b4a6c1836bed1
Closes-Bug: #1863619
2020-02-17 16:03:17 +00:00
Rodolfo Alonso Hernandez 380825fcf8 Check mech driver connectivity during port binding
In [1] the concept of "connectivity" was introduced for the ML2 drivers.
This parameter defines the mech driver connectivity type (layer 2, layer
3 only or legacy - not defined).

The spec defined in the blueprint allows to spawn a VM with ports
without IP addresses. As commented in the Nova spec [2], those ports can
be bound only to "l2" drivers.

[1] https://review.opendev.org/#/c/645645/
[2] https://review.opendev.org/#/c/641670/

bp boot-vm-with-unaddressed-port
Related-Bug: #1821058

Change-Id: I438cbab43b45b5f7afc820b77fcf5a0e823d0eff
2019-09-11 07:05:54 +00:00
Rodolfo Alonso Hernandez 6f26f4026b Change provider network segmentation ID
In the ML2 plugin, allow to update the segmentation ID of a single
provider network.

A new method in the "SimpleAgentMechanismDriverBase" is added:
"provider_network_attribute_updates_supported". This method returns,
if implemented in the specific agent, which network attributes can
be updated on a live network with ports bound to this network back-end.
By default, an empty list is returned.

Partial-Bug: #1806052

Change-Id: I2595335d6fbc51562b070f14eaeaadf49cf7c418
2019-04-01 12:55:50 +00:00
Bence Romsics 74c51a2e53 Drive binding by placement allocation
Drive the choice of mechanism driver during binding as inferred from
the resource provider allocated by nova and as told to neutron via the
port's binding:profile.

As discussed on a neutron qos irc meeting some time ago
this patch introduces a new assumption on bind_port() implementations.
That is an implementation of bind_port() in any mech driver supporting
Guaranteed Minimum Bandwidth bind_port() must not have a non-idempotent
side effect. Because the last binding level will be redone for a 2nd
time with a narrowed down list of mechanism drivers. And if the 2nd call
does not give the same result as the first all kind of weird things can
happen.

Change-Id: I2b7573ec6795170ce45a13d5d0ad7844fb85182d
Depends-On: https://review.openstack.org/574781
Depends-On: https://review.openstack.org/635160
Partial-Bug: #1578989
See-Also: https://review.openstack.org/502306 (nova spec)
See-Also: https://review.openstack.org/508149 (neutron spec)
2019-03-09 22:03:51 +00:00
Huang Cheng 69b8352630 Fix ml2 hierarchical port binding driver check error.
Avoid binding loop caused by the wrong comparison between
"id" and "segmentation_id" of a "segment" object.

Change-Id: Ibc9f3093318d92027eaaf81bd08401c0f02ae414
Closes-Bug: #1760029
2018-07-20 05:57:05 +00:00
Bo Chi 892c1ec690 fix same mechanism driver called twice bug
when a mechinism driver calls context.continue_binding to
continue binding, it will be called again because
_check_driver_to_bind compares driver name with driver.

Closes-Bug: #1745572
Change-Id: I62b32c9b9d01dd929fe8cd3634c78dc0cbe325b6
2018-02-01 18:51:39 +08:00
Aradhana Singh d00a50aad1 Refactoring config options for ml2 config opts
Refactoring neutron ml2 config opts to be in neutron/conf/plugins/ml2.
This would allow centralization of all configuration options and
provides an easy way to import.

NeutronLibImpact

Change-Id: Ibc5a9ab268578c243ef13f7e0041bacd6c0c410b
Partial-Bug: #1563069
Needed-By: Id0a97dda7718f06e33b2d30ce01cdcb3e9a46f7d
2017-09-08 15:34:49 -04:00
Boden R fde6710515 use MechanismDriver from neutron-lib + shim
The ml2 MechanismDriver is now in neutron-lib along with its associated
constants. This patch switches over to the lib versions of those, but
leaves a shim of the MechanismDriver that just ref's the driver from
lib. This shim allows our broad consumer base of the driver to switch
over at their leisure.

NeutronLibImpact

Change-Id: I99e3de6d933a1bb341394f85415fb07306a82a01
2017-06-05 14:09:07 -06:00
Trevor McCasland 453e8064a5 Exit on failure to load mechanism drivers
By using the on_missing_entrypoints_callback and
on_load_failure_callback options[1] we can call a handler for the
missing driver error properly.

As the bug states, I logged it as a critical failure and terminated
the neutron server.

I used SystemExit, I wasn't sure if there was a more graceful way
of exiting.

[1] http://docs.openstack.org/developer/stevedore/managers.html

Change-Id: Id18afd159d0b0ada0cc36964dd9c1ebe7a1cd94b
Closes-Bug: #1659290
2017-04-11 09:56:08 -05:00
Cao Xuan Hoang 4a91eea3e0 Change import statement to not rename the module
Importing "config" then renaming it to "config" is duplicative.

Change-Id: I630c4d23b233e65244d53746ddcb50b4e2bf8b4a
2016-11-14 13:53:51 +07:00
Isaku Yamahata 7e69891412 ml2: allow retry on retriabable db error by precommit
Db retriable error by precommit can be recovered with upper layer by
retry instead of converting into ML2MechanismDriverError.
Raise retriable db error instead of swallowing it and let upper layer to
retry.
Due to concurrency, db error by precommit is sometimes inevitable.
precommit may issue db transactions depending on mechanism driver, Some
operations on e.g. subnet, routers, touches many other resources (e.g. ip
allocation, ports) in single db transaction as well. And background
operation by mechanism driver (e.g. background sync, monitoring
resources periodically, etc) may touch those db tables with other
order.

Change-Id: Ifc670c1eb5801934bf46fdc23a7721ce4c2cfa6c
Closes-Bug: #1609184
Closes-Bug: #1609149
2016-08-08 17:12:01 -07:00
Hong Hui Xiao 9db81351ed Fix wrong use of list of dict in _check_driver_to_bind
From [1], the segments_to_bind should be a list of dict, so the
"level.segment_id in segments_to_bind" will never work.

This patch extracts a set of segment ids and uses the set in the
if condition.

[1] https://goo.gl/yKYSTA

Change-Id: I58f1d128e6cd79546d84f7d5bfcb026affc4fc5e
Closes-bug: #1524356
2016-03-21 03:39:41 -04:00