Commit Graph

64 Commits

Author SHA1 Message Date
Zuul ddac34b384 Merge "Don't run periodic actions for StaticScheduler" 2022-08-18 09:28:17 +00:00
Zuul e6f8165254 Merge "Fix missing functions in StaticScheduler" 2022-08-04 10:41:02 +00:00
Dr. Jens Harbott acfcd04dd4 Don't run periodic actions for StaticScheduler
We want bindings to be fully static when using the StaticScheduler, so
do not run the periodic actions in that scenario.

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: I2d874ce7170cdf3d81940dbe64960247b244fe87
2022-08-02 09:38:02 +02:00
Dr. Jens Harbott 012f2358d2 Fix missing functions in StaticScheduler
Seems the original approach was too simple, it is causing some
tracebacks due to missing functions.

Closes-Bug: 1980235
Change-Id: I15ef7ec34eeccf4dfcce94b3bca2c853c4c4a609
2022-08-01 16:41:39 +02:00
Renat Nurgaliyev b9c085b85f
Consume BGP service plugin queue in RPC workers
This patch adds BGP service plugin RPC queue to RPC workers, like it is
done in other Neutron service plugins (l3-plugin, metering, etc.).
Without it some RPC requests and AMQP heartbeats are not processed in
time, causing AMQP connection dropping, and other unpredictable unwanted
behavior.

Closes-Bug: #1974057
Change-Id: I1b13f01ca47c8390f1361e01d5eb313fe2fc417f
2022-05-18 18:09:16 +02:00
silvacarloss 180396b18c Register common config options by default
The [1] change modified the behavior Neutron had, which used to
force the default config options to be automatically set.

Neutron-dynamic-routing expects some of the default config options
to be set while initializing some services. If they are not set
the initialization will fail [2].

This change invokes the method that sets such config options to
fix this initialization issue.

[1] https://review.opendev.org/c/openstack/neutron/+/837392
[2] https://paste.opendev.org/show/b8DReLeBPl9xTGooN8wu/

Releated-Bug: #1968606
Change-Id: Ib3bdf9b19feb68647460814cc973699622d0a6e8
2022-04-21 08:38:46 +00:00
Dr. Jens Harbott 8a0ddf6051
Add a StaticScheduler without automatic scheduling
The automatic scheduling that was introduced in [0] is having some
issues. Add a StaticScheduler that can be used as an alternative for
deployments that want explicit control over where their BGP speakers are
getting scheduled.

Add a job that runs with the new scheduler.

[0] https://review.opendev.org/c/openstack/neutron-dynamic-routing/+/478455

Depends-On: https://review.opendev.org/c/openstack/neutron-tempest-plugin/+/815294
Closes-Bug: 1920065
Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: Ib7fcd0c7371bc75089b10024ee1b6e75c98f0188
2021-11-04 15:21:51 +01:00
Nurmatov Mamatisa cae03eaa49 Use payload style callback
Neutron-lib registry.notify will be removed

Change-Id: I5d773851136759117b048660d34209a601054a69
2021-09-13 12:31:13 +00:00
Manu B 630678b5f9 Payload changes for FLOATING_IP events
Depends-On: https://review.opendev.org/#/c/798009

Signed-off-by: Manu B <manu.b@est.tech>
Change-Id: I4c6e04b82426ebbe41273fbc584ee3e8df70aead
2021-09-06 07:01:24 +00:00
Boden R 891ca86212 use payloads for ROUTER_INTERFACE events
This patch switches the code over to the payload style of callbacks [1]
for ROUTER_INTERFACE events for those that are not using them yet.

Depends-On: https://review.opendev.org/#/c/639814/

[1] https://docs.openstack.org/neutron-lib/latest/contributor/callbacks.html

Change-Id: I332e9745b57a22f0ca9338b52dab69c53ff59fcc
2021-09-02 09:49:44 +00:00
elajkat b8b8788d23 Use payload for PORT and FLOATING_IP events
* Updated callback functions port_callback,
  floatingip_update_callback to include payload
* Fixed unit test cases

Change-Id: I84956d86ea45039a8841b2b1f4f02bf373efcef5
Signed-off-by: Manu B <manu.b@est.tech>
2021-09-02 09:49:30 +00:00
elajkat c021b106d9 Use bgp api-def from neutron-lib
As neutron-dynamic-routing is a Neutron stadium project the api-def
and the api-ref should be in neutron-lib.

Change-Id: Idccc69f025a0d1ec0453d13a7d81b94e3a15149d
Depends-On: https://review.opendev.org/c/openstack/neutron-lib/+/788322
2021-05-31 12:32:55 +00:00
Aggelos Kolaitis 43f50d5d9b
Fix TypeError when formatting BGP IP address.
floating_ip_address may be a netaddr.IPAddress, and using '+'
to append the /32 suffix raises a TypeError. Explicitly convert to
string before appending the suffix.

Additionally, introduce a unit test case for floatingip_update_callback
to test that the error does not re-appear.

Closes-Bug: #1924237
Signed-off-by: Aggelos Kolaitis <akolaitis@admin.grnet.gr>
Change-Id: I98d266fb986649f1d14969c968baa2f93b469f73
2021-04-15 21:02:15 +03:00
elajkat 6a6f49b609 Migrate to new engine facade
Partially-Implements blueprint: enginefacade-switch

Change-Id: I70636da4b3d4aa633286366f47ea997111b3bc2e
2020-12-15 17:35:17 +00:00
Zuul e6274b2d16 Merge "Clean up workaround in bgp_dragent_scheduler" 2020-08-07 12:57:10 +00:00
Dr. Jens Harbott 76de6240c9 Clean up workaround in bgp_dragent_scheduler
This was added as a workaround until neutron gets a new release in [0].
We can switch to the new code now.

[0] I5661e8689d8e3ea861fdd0393e6f25c42cd324c3

Change-Id: Ie5b3d5c5b978494abf8d58f3f0a92cb95209fb56
2020-06-14 12:31:13 +00:00
zhanghao f8f9463cf7 Remove usage of six
With python3.x, classes can use 'metaclass=' instead of
'six.add_metaclass', 'six.integer_type' can be replaced
by 'int', 'six.string_type' and 'six.text_type' are just
'str'.

Change-Id: I40a020aa4a8e69a8dd7e800352dc54a9e694d500
2020-05-27 06:58:27 -04:00
Zuul 05b3f52bf7 Merge "bgp: Gracefully handle missing last_known_router_id" 2019-11-13 22:31:21 +00:00
Jens Harbott e2d4cede45 Fix resource_filter.bind method that was changed in neutron
This happened in [0], we need to add a partial workaround until a new
neutron release is made.

[0] https://review.opendev.org/288271

Change-Id: I5661e8689d8e3ea861fdd0393e6f25c42cd324c3
2019-11-11 12:33:54 +00:00
Boden R 979b676e3a use payloads for ROUTER_GATEWAY events
This patch switches the code over to the payload style of callbacks [1]
for ROUTER_GATEWAY events for those that are not using them yet.
The unit tests are also updated where needed to account for the
payload style callbacks and publish() method. Finally the patch
normalizes the passing of gateway IPs which are currently referred to
as 'gw_ips' and 'gateway_ips' depending on the event; now all events use
'gateway_ips'.

Depends-On: https://review.opendev.org/#/c/638274/

[1] https://docs.openstack.org/neutron-lib/latest/contributor/callbacks.html

Change-Id: I8f797f31b3413e4879400ad2832539314d6e9cfc
2019-07-30 11:19:55 -06:00
Benoît Knecht 4780fe548b bgp: Gracefully handle missing last_known_router_id
When a server is deleted before its floating IP has been disassociated,
the notification doens't contain a `last_known_router_id` key, which
results in a `KeyError` exception being thrown.

This commit gracefully handles this situation by setting
`last_router_id` to `None` when `last_known_router_id` is missing.

Change-Id: If127a33cec7ce6c4d264a191df37c30decab4daa
Closes-Bug: #1795816
2019-06-14 10:30:12 +02:00
Ryan Tidwell 69e9888b01
Implement DVR-aware fixed IP lookups
This change adds DVR-aware announcements for routable fixed IP's
to be sent, thereby routing traffic directly to the appropriate
compute node instead of the centralized router on the network node.

Change-Id: I3aecdd7979dba97dab12a6550655c90a57f56cb3
Partial-Bug: #1775250
2019-03-03 10:00:06 -06:00
Ryan Tidwell fc2dae7c93
Enable MP-BGP capabilities in Ryu BGP driver
This change enables all capabilties regardless of peer address
family, thereby enabling announcement of IPv6 prefixes over IPv4
sessions and vice-versa. Peers can opt in/out with capabilities
configured on the remote end of the session.

Change-Id: I7b241cdfddcecbdd8cdde2e88de35b9be6982451
Closes-Bug: #1784590
2019-02-28 08:20:39 -06:00
Ryan Tidwell 34655a8e6e
Migrate neutron-dynamic-routing from Ryu to os-ken
This change causes neutron-dynamic-routing to stop consuming Ryu
in favor of os-ken. os-ken becomes the reference implementation
for BGP services and neutron-dynamic-routing no longer has a
dependency on Ryu.

Partially-Implements: blueprint ryu-framework-maintenace-transition
Change-Id: I4a68440809cad5de2d6d191f7211d68b542672e5
2018-12-18 14:03:13 -06:00
Boden R 266246fd84 use common rpc and exceptions from neutron-lib
The neutron.common.rpc and exceptions were rehomed into neutron-lib and
are currently shimmed in neutron [1]

This patch consumes those modules from neutron-lib by using lib's
modules rather than neutrons.

[1] https://review.openstack.org/#/c/586525/

Change-Id: Ic95e9ab17fa6ba3b12cea7837322f113d0084aeb
2018-12-10 06:27:26 -07:00
Boden R 367201cb00 load neutron objects using neutron-lib
To access neutron objects we're moving to a dynamic plugin approach as
shown in the depends on and related patches.

This patch removes the imports of neutron.objects and uses neutron-lib
to load them instead.

Change-Id: I63bf23a6c116388dd038cfb4b75721f314997bca
2018-12-03 13:34:36 -07:00
Boden R 78d68a18ba use rpc Connection rather than create_connection
The create_connection function in neutron.common.rpc is just an alias to
Connection. This patch switches to the later so we can remove the former
in: https://review.openstack.org/#/c/560130

Change-Id: Ie8eaca442fa2872fe061f997898d9cd7d9195c9d
2018-04-12 14:03:01 -06:00
Zuul 0e61c281c0 Merge "Enable mutable config in Neutron-dynamic-routing" 2018-04-09 20:50:09 +00:00
Sławek Kapłoński dcba0d29c4 Enable mutable config in Neutron-dynamic-routing
New releases of oslo.config support a 'mutable' parameter to Opts.
This is only respected when the new method mutate_config_files is
called instead of reload_config_files. Neutron-dynamic-routing
delegates making this call to oslo.service.
This was provided in patchset
Icec3e664f3fe72614e373b2938e8dee53cf8bc5e

Further patches will be needed to make select config options be
marked as mutable. This change enables support for oslo provided
config options to be updated via SIGHUP such as log level.

Change-Id: Icb405ae7197af7507469593e8555b833186c0e68
Task: 12505
Story: 2001545
2018-04-06 13:12:22 +02:00
Thomas Morin 3192147009 remove unused plugin.get_plugin_name()
This method does not seem to be used anymore:

http://codesearch.openstack.org/?q=get_plugin_name&i=nope&files=&repos=neutron,neutron-lib

Change-Id: Iccb492f7dd81686f43db0be5389052d1a1833f09
2018-03-29 11:59:40 +02:00
Zuul 0c727cd4ba Merge "Fix failure when adding a speaker to an agent" 2018-03-22 06:39:11 +00:00
Boden R ee37a36894 use common agent topics from neutron-lib
The neutron.common.topics module was rehomed into neutron-lib with
commit Ie88b84949cbd55a4e7ad06341aab77b286cdc485
This patch consumes it by using neutron-lib's version of the module in
prep for Ia4a4604c259ce862597de80c6deeb3d408bf0e95

Change-Id: I71a90ca62a664a9bab2e7b151f0cce7eeab8ff41
2018-03-01 07:33:30 -07:00
Jens Harbott fd497a491a Fix failure when adding a speaker to an agent
When get_bgp_speaker_with_advertised_routes() collects the data for BGP
peers, it needs to include the auth_type field, otherwise adding the
speaker to an agent will fail.

Change-Id: I668397be4a531ba5c0628eb23df9a84d0de8c28c
Closes-Bug: 1750121
2018-02-20 11:01:30 +00:00
zhaojingjing0067370 0d8ab06004 The description of the range for local_as and remote_as is incorrect in file "base.py"
The range for local_as and remote_as  has been  modified for [MIN_ASNUM,MAX_4BYTE_ASNUM],
so the description of the range should be modified in file "base.py".

Change-Id: Id37af6c571f7fb028c315c61ffffee0fc0482362
2018-01-25 15:56:40 +08:00
Nguyen Phuong An 39699184d8 Use agent OVO for bgp_dragent_scheduler
Neutron agent scheduler has been switched to use Agent OVO[1].
So this patch uses agent OVO for bgp_dragent_scheduler.

[1] https://review.openstack.org/#/c/495810

Change-Id: I7e5da95ab3c28c00f3be9eca2c92a772492cfa69
Closes-Bug: #1732603
2017-11-16 16:35:59 +07:00
Hirofumi Ichihara 972756f603 Support 4-Byte AS Numbers
Now neutron_dynamic_routing supports 2 byte AS numbers only.
This patch expands AS numbers constraint so that it supports
4 byte AS numbers. It expects that operators use asplain
notation to set AS numbers[1]. That's backward compatible with
existing 2 byte AS numbers.

[1]: https://tools.ietf.org/html/rfc5396

Change-Id: I06ae0c42d983e88e1f38c501d5c85a7956f195ad
Closes-Bug: #1573092
2017-11-06 09:39:34 +00:00
fumihiko kakuma e71d151668 Use common constants in neutron-lib
AGENT_REVIVED has been moved from neutron.common.constants
into neutron-lib.

Change-Id: I5f7fc42a5d9c2e0246d6274223247c6efd5e67e5
2017-10-23 10:48:00 +09:00
Jenkins 09530bc15a Merge "Stop using is_agent_down" 2017-09-14 06:33:43 +00:00
chenghuiyu 699531dd4b Stop using is_agent_down
The usage of is_agent_down in neutron.db.agents_db.AgentDbMixin
is deprecated for removal in version ocata, and usage of the is_agent_down
neutron.agent.common.utils is recommended in future release.

Change-Id: Idb52516e4b8f916f4fa50a3d7ff349cd06b8f18e
2017-09-14 11:01:05 +08:00
Brian Haley d13fdaef43 Fix unit tests and test configuration
A recent change in the neutron repository changed the
import statements for external_process, fixing fallout.

Fix post gate hook to accommodate for new os-testr.
New versions now use .stestr instead of previous .testrepository
directory.

Related-bug: #1716746
Change-Id: Iba7579f8de63c6ce87d95167918fc46979702a35
2017-09-13 14:08:41 -06:00
fumihiko kakuma 0e7e93051e Reschedule a bgp speaker binded to a down dr-agent
If a bgp speaker is binded to a down dr-agent, unbind and reschedule it.
If there is an unbinded bgp speaker, schedule it.

Change-Id: If5de81f1ca9b7781f48fd9bea84848f4261ccbe6
2017-08-29 08:33:25 +09:00
Jenkins 74ed9a7999 Merge "use synchronized decorator from neutron-lib" 2017-07-28 07:39:36 +00:00
Boden R bb77654516 use synchronized decorator from neutron-lib
neutron-lib contains the synchronized lock decorator and neutron is
removing it's implementation I729da348e340509f2d09f8a6436716e2398f1583

This patch uses the decorator from neutron-lib rather than neutron.

Change-Id: Iaf2ce2e339471c91fa64047942c0bb385dd224ee
2017-07-25 12:01:33 -06:00
Akihiro Motoki 1c9168176c Update the documentation link for doc migration
Change-Id: Ic57e6ddbc8407fb2ceb7a7b8995486bf06390258
2017-07-20 03:58:14 +00:00
Gary Kotton 6a4916e313 Use flake8-import-order plugin
Automate the process

Change-Id: Ic2ff59ed8b5e4677117a5fca5ab32c26b2401724
2017-07-07 07:06:10 +00:00
Boden R 19852a6693 consume neutron-lib callbacks
The callback system in neutron has moved to neutron-lib and hence
consumers need to follow suit.
See Ib6baee2aaeb044aaba42a97b35900d75dd43021f for more details.

Change-Id: Ibe6ec3bf9c4a97ab2e0aa9747272d885fca2936b
2017-04-27 14:52:08 -06:00
fumihiko kakuma 086384c3b1 Enable neutron-dynamic-routing scheduler
This executes the dr scheduler on the callback for create_bgp_speaker.
Also add the following variable for devstack.
  BGP_SCHEDULER_DRIVER: specify dr scheduler driver

Change-Id: Ibf94cc2183783f9bdb2dd245ad28d304ca930589
2017-04-04 14:49:02 +09:00
John Perkins d59cc092d2 Agent common config move
The common config is moving from neutron/agent/common/config
to neutron/conf/agent/common.

Change-Id: I467d93897196e2b0c0c18e2938900e50238d81df
Depends-On: Iebac0cdd3bcfd0135349128921b7ad7a1a939ab8
2017-03-08 08:49:16 -07:00
Armando Migliaccio 2a4ae06b8c Use neutron-lib's context module
Depends-on: I48cf45dc1b07035d952152eac2548a3bd9fc2832

Change-Id: If1c6e17eee3fbee7f59a7421ac2a5b983b77668a
2017-03-06 15:45:54 -08:00
Boden R 0ee597c4fa consume ServicePluginBase from neutron-lib
Neutron-lib now contains the ServicePluginBase class and
thus is being removed from neutron [1]. This patch moves
all such references from neutron to neutron-lib in accordance
with the neutron-lib rehoming.

[1] https://review.openstack.org/#/c/441129/

Change-Id: I5f8f849fb3457198b4565ff37cbdf6fd212b4cdd
2017-03-03 11:44:43 -07:00