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
(cherry picked from commit 8a0ddf6051)
This commit is contained in:
Dr. Jens Harbott 2021-10-25 11:50:24 +02:00 committed by Dr. Jens Harbott
parent ce8ae8b9db
commit 3d5eddd70b
7 changed files with 68 additions and 8 deletions

View File

@ -1,3 +1,15 @@
- job:
name: neutron-dynamic-routing-static
parent: neutron-tempest-plugin-dynamic-routing
vars:
devstack_localrc:
BGP_SCHEDULER_DRIVER: neutron_dynamic_routing.services.bgp.scheduler.bgp_dragent_scheduler.StaticScheduler
devstack_local_conf:
test-config:
$TEMPEST_CONFIG:
neutron_plugin_options:
bgp_schedule_speakers_to_agents: true
- job:
name: neutron-dynamic-routing-functional
parent: neutron-functional
@ -20,6 +32,7 @@
check:
jobs:
- neutron-dynamic-routing-functional
- neutron-dynamic-routing-static
- neutron-tempest-plugin-dynamic-routing
gate:
jobs:

View File

@ -48,8 +48,24 @@ BGP Scheduler
BGP Speaker and DRAgent has 1:N association which means one BGP speaker can be
scheduled on multiple DRAgents.
There are different options for the scheduling algorithm to be used, these can
be selected via the ``bgp_drscheduler_driver`` configuration option.
StaticScheduler
~~~~~~~~~~~~~~~
This is the most simple option, which does no automatic scheduling at all.
Instead it relies on API requests to explicitly associate BGP speaker with
DRAgents and to disassociate them again.
Sample configuration::
bgp_drscheduler_driver = neutron_dynamic_routing.services.bgp.scheduler.bgp_dragent_scheduler.StaticScheduler
Here is an example to associate/disassociate a BGP Speaker to/from a DRAgent.
.. TODO(frickler): update the examples to use OSC
::
(neutron) bgp-speaker-list
@ -88,7 +104,22 @@ Here is an example to associate/disassociate a BGP Speaker to/from a DRAgent.
(neutron)
.. note:: Currently, auto-scheduling is not supported.
ReST API's for neutron-dynamic-routing scheduler are defined as part of the
`Neutron API reference`_.
.. _Neutron API reference: https://docs.openstack.org/api-ref/network/#bgp-dynamic-routing
ChanceScheduler
~~~~~~~~~~~~~~~
This is the default option. It will automatically schedule newly created BGP
speakers to one of the active DRAgents. When a DRAgent goes down, the BGP
speaker will be disassociated from it and an attempt is made to schedule
it to a different agent. Note that this action will override any manual
associations that have been performed via the API, so you will want to use
this scheduler only in very basic deployments.
Sample configuration::
bgp_drscheduler_driver = neutron_dynamic_routing.services.bgp.scheduler.bgp_dragent_scheduler.ChanceScheduler
ReST API's for neutron-dynamic-routing scheduler is defined in the
API document :doc:`/reference/index`

View File

@ -127,4 +127,4 @@ It manages and configures different dynamic routing stack through
.. note::
Currently, only integration with `os-ken <https://docs.openstack.org/os-ken/latest/>`_
is supported. Future releases will add the support for Quagga, Bird, etc.
is supported.

View File

@ -53,9 +53,8 @@ functionality of a dynamic routing protocol::
+-------------------------------+
.. note::
In the first release, only the integration with os-ken is supported. Later release will
have support for Quagga, Bird etc. Besides, BGP is the only protocol supported now
but support for more dynamic routing protocols might come in the future.
Currently only the integration with os-ken is supported
BGP is the only protocol supported.
Configuration

View File

@ -565,7 +565,8 @@ Service Test
* Schedule the BGP speaker to ``BGP dynamic routing agent``
The first BGP speaker is scheduled to the first dynamic routing agent automatically.
With the default scheduler configuration, the first BGP speaker is
scheduled to the first dynamic routing agent automatically.
So for a simple setup, there is nothing to be done here.
* Verify scheduling of the BGP speaker to the agent.

View File

@ -217,3 +217,9 @@ class WeightScheduler(base_scheduler.BaseWeightScheduler,
def __init__(self):
super(WeightScheduler, self).__init__(self)
self._register_callbacks()
class StaticScheduler(BgpDrAgentFilter):
def __init__(self):
super(StaticScheduler, self).__init__()

View File

@ -0,0 +1,10 @@
---
features:
- |
A new BGP scheduler has been added, called ``StaticScheduler``. It will
not perform any automatic scheduling of speakers to agents, instead
relying on API calls to perform explicit scheduling, fulfilling the
needs of larger deployments.
See also bug `1920065 <https://bugs.launchpad.net/neutron/+bug/1920065>`_.
The plan is to make the ``StaticScheduler`` the default option for the next
release and possibly deprecate the current default, ``ChanceScheduler``.