Commit Graph

42 Commits (master)

Author SHA1 Message Date
Mitchell Jameson 03a525f9b0 Don't use router_interface fixed_ip for MLAG peer SVI IPs
When selecting IPs for MLAG peers SVIs, we typically choose
the top two IPs in the subnet (eg. .254 and .253 in a /24).
However, this may collide with the fixed_ip for the router,
which will cause EOS to reject the router create on one of
the peers as the VARP IP cannot be the same as the SVI IP.

The fix prosed here is to use the third highest IP in the
subnet if the fixed_ip is one of the two highest IPs in the

Change-Id: I6a320a31b55edc947d288c9ad030bc476ae6ee9f
2022-05-03 17:09:15 -07:00
Mitchell Jameson 8a02945f61 Start running jobs against newer python versions
Notable changes:
 - bump hacking to make it py38+ compatible
    - (with changes to pass against the newer pep8 rules)
 - ensure requests get monkey-patched to avoid exceeding
   maximum recursion depth in SSL
 - start running openstack-python3-yoga-jobs-neutron

Change-Id: I84be86737b493dfc811a772bbeabefd10e645206
2022-03-03 22:14:20 -08:00
Mitchell Jameson bf3aa1d3b1 Handle new payload format for SUBNETs, SG and SG_RULES
Change-Id: Id592f871a199913ecbe48f6704a34e16e644852a
2021-07-08 16:21:06 -07:00
Mitchell Jameson 225765aca3 Fix L3 plugin to handle new payload format
A recent to the way neutron sends network info in callbacks
partially breaks the Arista L3 plugin.

This change moves over to the new format.

Change-Id: I553f8911a79d2b3ad8fdb03c9ceb9f9ff2acb6b0
2021-05-28 01:44:15 +00:00
Alin Iorga 382e8a9266 Remove delete_default_gateway from create_router
This change removes the delete_default_gateway function from
create_router call path and updates the synchronize function to update
proper VRF default gateways only when needed.

Change-Id: I874b3f15f39e914282d7b92a07af9024c39e916f
2020-04-04 09:32:44 -07:00
Alin Iorga 4b002ee6bb Use show version to validate vrf support
Updated the code to use show version to check which vrf creation command
the switch supports. This will eliminate extra entries in syslog

Change-Id: Id3c3e42d2fc7165e5ea3c20bec3343c559f6465f
2020-02-21 10:32:36 -08:00
Alin Iorga b6d6c44428 Prevent recursive check for vrf supported commands
On switches that do not support vrf instance command, if the command
fails it will try again to check which commands are supported and will
generate a loop. This will prevent the L3 plugin to check for vrf
supported commands while it is checking what command are supported

Change-Id: If441bbf2c5d3863282aaede55f7f6f130c67844e
2020-02-06 16:38:59 -08:00
Zuul 61aef1b0ff Merge "Wrap L3 synchronize function in try catch" 2020-01-31 00:36:56 +00:00
Alin Iorga 9b721aa315 Synchronize requirements with neutron
This commit is removing support fro python2 in networking-arista and
synchrinizing the package requirements with neutron. Because of this
some code changes have been performed in order for the pep8 test to pass

Change-Id: I829d7eec72cb22d1142782894b9833769f432a66
2020-01-30 15:10:14 -08:00
Alin Iorga bcaa26f6a6 Wrap L3 synchronize function in try catch
When an exception happens in synchronize thread, it will die and not
recover. Wrapping in try/catch to protect against any error. Also added
some logging to know step in processing

Change-Id: Ic0c9016daebd547ffa23408444c43849b953d98b
2020-01-28 23:37:11 +00:00
Alin Iorga 06d6342a44 Add option to create default route to router VRFs
This change adds the option to create default route for routers that
have a default gateway defined. This is controled by setting
vrf_default_route option in the configution

Change-Id: I16ae7feacb04730111a4b5eb61d2c3ae0fb3f041
2020-01-06 17:23:13 +00:00
Alin Iorga 19642cd335 Update L3 plugin to handle new syntax for deprecated vrf forwarding
Change-Id: I30e77ea2f8b4fa29ce309cb075e6ed780af6d7bc
2019-12-02 23:27:03 +00:00
Alin Iorga 5db5ff746f Update L3 plugin to handle switches that support vrf instance
L3 plugin will be able to handle both swtiches that support only the
newer syntax with vrf instance and the old vrf definition syntax.

Change-Id: I2e9b88c4e6d18eb3880f44532c93cc8cb9b2f2f4
2019-11-26 18:38:58 +00:00
Boden R 406f350954 use neutron-lib for rpc
This patch switches the code over to use neutron-lib's rpc module rather
than neutrons.

Change-Id: Icb0407cf51d280a80b3fa84265fe8d2b840f92e6
2019-01-02 09:17:50 -07:00
Mitchell Jameson 4c70351150 Only create SVIs for router_interface ports in sync worker
We were filtering ports only by device_id for the purpose of SVI/VLAN
creation. We only create SVIs for network:router_interface ports in the
driver, so the same should hold for the sync worker.

Change-Id: I31f6229b3c50b0c57ecbfb32de99ec080070cb94
2018-12-18 14:44:14 -08:00
Mark McClain a80268e6b8 Make protected_vlans valid range inclusive
Change-Id: Ife31165251ae4bd5aa6589ac8bf278d6e2192c38
2018-12-12 16:49:22 +00:00
Mitchell Jameson 2e36773c2d Add ability to cleanup L3 resources
This adds two new config settings: enable_cleanup and protected_vlans
that allows the L3 sync worker to cleanup stale VRFs, SVIs and VLANs
on L3 hosts without affecting config from sources that are not the Arista
L3 plugin. This change also adds support for automatic config file
generation with oslo-config-generator.

Change-Id: Ia1f151e7e54a7d8712279aa0d7b3adf7731feaab
2018-11-19 10:27:17 -08:00
Boden R 79bb65f868 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.


Change-Id: I5da2225efcb330a4840b82ca8c185e4e9a8d7d44
2018-09-26 14:11:43 -06:00
Mitchell Jameson bd3d794e01 Add support for VRFs on MLAGs
- Improved error logging for L3/SG/arista_vlan
- Fixed tenant_id filter for router query
- Fixed VRF creation for routers with a space in their name

Change-Id: I7917b988d3e45e653a19c791b8529077ba93389b
2018-08-20 10:03:47 -07:00
Mark McClain 5d0345cf13 Remove remaining portion of NeutronNets in favor of calling core plugin
Change-Id: I6ccde39ac866a6aecd277e676eb7b364d4f3edbe
2018-07-10 15:25:36 -04:00
Mark McClain 6ce6107c44 Convert l3 sync thread to ServiceWorker
Change-Id: Iac9fb0753bcc87dc578f96ce7e7ec3dfc9601492
2018-07-10 15:25:36 -04:00
Mark McClain fc12d9acde Simplify base class to service worker
Change-Id: Ica23c60f457072c83ba2db4bc87b755b5e552e2a
2018-07-10 15:25:29 -04:00
Boden R c8c4d61a8d 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

Change-Id: I8f0a3f18d0fb1131fe1df581bfa4c720c0808648
2018-04-12 12:28:14 -06:00
Boden R 507af45dfb 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: I300f81cb4c93a485dfef4e7d8a1ad61d239dccf5
2018-02-28 15:28:39 -07:00
Boden R fed3fdef12 use service type constants from neutron_lib plugins
The well known service type constants are in
neutron_lib.plugins.constants, but for legacy reasons a few still exist
and are referenced from neutron_lib.constants [1] that we'd like to

This patch switches references over to neutron_lib's plugin constants.


Change-Id: Iea954a5c916b527c7bb9d1db761204c3297b1fa6
2017-06-27 12:40:07 -06:00
Mark McClain 59a821fd54 Enable Python3.5 support
Change-Id: I1696aaa9905d648c1985c8bd7219b91dbd880778
2017-03-31 16:52:48 -04:00
Mark McClain 9ee8a47a9e Add cfg.CONF.import_group() to document option dependencies
This change documents option dependencies within the code and ensures
isolated test runs will work properly and not depend on other import side

Change-Id: I42aa0a496f64ecbae3f70af214b03e3dc9bae243
2017-03-31 16:52:35 -04:00
Mark McClain 8d0a6b09a0 Remove external dependency on jsonrpclib
Remove the external dependency on jsonrpclib to better align with the
upstream OpenStack requirements.  This change introduces a new
EAPIClient class for the L3 agent. In the future, the ML2 driver will be
refactored to use shared EAPI code.

Change-Id: Ia7cae6a9ae091f2ec306bd64ef1617236cfd6d83
2017-03-21 14:01:39 -04:00
Mark McClain c22dd944bc Replace jsonrpclib with jsonrpc_requests module
The jsonrpclib library module is not python 3 compatible and not
actively maintained. jsonrpc-requests is newer, python compatible and
based upon the underlying requests library already in use.

Change-Id: I04878c7a56c4afea595bd85e65b54ce6193f3fb4
2017-03-09 14:39:58 -05:00
Nader Lahouti 3dc3d51740 Correction for importing context module
Change-Id: Icfe6c8ee5acc9b34a43eea2ba5af80ada229c4b9
2017-03-08 17:32:25 -08:00
Gary Kotton fa0159ad02 neutron-lib: use L3 constant from neutron-lib
Ensure that the plugin uses the constant defined in neutron-lib.
L3_ROUTER_NAT will be dropped in favor of this. This change is in

Partially-implements: blueprint neutron-lib

Change-Id: I6f569d8f914a92c27d97a2f82c8f693157222e16
2016-12-26 15:24:49 +02:00
Mitchell Jameson 8c570d3846 Migrated neutron constants to neutron-lib for l3 plugin.
Change-Id: I45828811e612cfcef6777d7f0568986abdeb4fbe
2016-11-15 00:25:51 +00:00
Doug Wiegley e749b9a9fa Remove reference to neutron.i18n
Partially-implements: bp neutron-lib

Change-Id: I213c83951c7c61b2365da96da1bc8251eed9d0c2
2016-11-10 12:21:41 -05:00
Sukhdev Kapur 716c1a13f4 Updating L3 plugin to accomodate upstream changes
Some of router functions (i.e. update, delete, etc) have been updated
to invoke ML2 fuctions which are executed in the session's context.
Arista L3 Plugin was invoking router base class funtions in context
as well. This now causes the problem because of upstream changes.
This patch removes those calls from the session's context.

Change-Id: Ifa859f3076f73528b36c6395001ff4b9f6958bce
2016-10-03 15:52:16 -07:00
Sukhdev Kapur 0945bdd2b0 Adding Ironic Support
This patch adds Ironic support to Arista ML2 driver.
This patch also adds support for Security Groups for
baremetal instances

Change-Id: I7449f511d172678a77e1b5f087f1b182a78948c0
2016-06-21 10:33:44 -07:00
Sukhdev Kapur d47cd7ab86 Fixing L3 Plugin to match with upstream change
A fix was pushed in neutron upstream which broke this plugin.
This patch fixes this.

Change-Id: I286e96db2b58a92e69edeb1b85bb1e3f9cf22e6f
2016-04-19 15:24:16 -07:00
Sukhdev Kapur 22c90b733d Fix L3 plugin to match with upstream
An upstream code was changed to get the tenant_id for router.
This patch fixes L3 plugin to match with the upstream fix

Change-Id: I20ba82d014cbe8fabae59cfeded53dd1f8af88f2
2016-03-29 15:34:22 -07:00
Mitchell Jameson 0dae28df08 Fixed typos in
Added missing 'r' to AristaServicePluginConfigError in a few places

Change-Id: I38b8db68fd7503ab565beb6cd2561d315618b569
Closes-Bug: #1552963
2016-03-03 15:47:06 -08:00
Zhao Lei 4a1f122c1b Fix a spelling typo in error message
occured -> occurred

Also fixed following spelling typo in comments:
authentification -> authentication
genric -> generic
vaild -> valid
infromation -> information

Change-Id: Ic4b7c5a990a8de7576334a9715dd78ddba63a539
Signed-off-by: Zhao Lei <>
2015-09-24 18:18:01 +08:00
Sukhdev Kapur 926ede02ab Migration of Arista drivers from neutron to here
This patch moves all of remaining Arista code
from neutron repo to openstack/networking-arista

Change-Id: Ifeb5986a45acebf2e53e4769706d9d2e46b62f50
Closes-Bug: 1479937
2015-07-31 20:38:32 -07:00
Mark Goddard e8df407d54 Fix unit tests
Fixes three unit tests which have been broken since the network
type check was added. Adds the network_type field to the network
context dummy object.

Change-Id: I5dbc325fd941fad0d436510361f62a5024034812
Closes-bug: 1475735
2015-07-21 10:24:04 +01:00
Sukhdev 836ab188ae Arista L3 Service Plugin decomposition
Moving back-end drivers for Arista's L3
Service Plugin from Neutron tree to

Change-Id: Ie394c31ae317a71f00be7195e15e05dc56df0ad0
Closes-bug: 1428904
2015-03-13 21:34:41 -07:00