From 5b44f48ff384d60833c0fadcea78f35ce98d6f11 Mon Sep 17 00:00:00 2001 From: Angela Smith Date: Wed, 4 Mar 2015 15:59:23 -0800 Subject: [PATCH] Add L3 router plugin shim for Brocade MLX Change-Id: I4eba6a3fb8ce2b22e0d142643d753ee2314425b8 Closes-Bug: #1428316 --- etc/neutron/plugins/brocade/brocade_mlx.ini | 19 +++++++ .../l3_router/brocade/mlx/__init__.py | 0 .../l3_router/brocade/mlx/l3_router_plugin.py | 50 +++++++++++++++++++ setup.cfg | 5 +- 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 etc/neutron/plugins/brocade/brocade_mlx.ini create mode 100644 neutron/services/l3_router/brocade/mlx/__init__.py create mode 100644 neutron/services/l3_router/brocade/mlx/l3_router_plugin.py diff --git a/etc/neutron/plugins/brocade/brocade_mlx.ini b/etc/neutron/plugins/brocade/brocade_mlx.ini new file mode 100644 index 00000000000..54d54142276 --- /dev/null +++ b/etc/neutron/plugins/brocade/brocade_mlx.ini @@ -0,0 +1,19 @@ +[l3_brocade_mlx] +# switch_names = Comma separated list of names of MLX switches to be configured +# Example: +# switch_names = mlx + +# [EXAMPLE_SWITCH] +# address = The IP address of the MLX switch +# username = The SSH username to use to connect to device +# password = The SSH password to use to connect to device +# physical_networks = Allowed physical networks for VLAN configuration +# ports = Comma separated list of ports on the switch which needs to be tagged to VLAN +# +# Example: +# [mlx] +# address = 10.24.20.21 +# username = admin +# password = password +# physical_networks = physnet1 +# ports = 3/3, 3/9 diff --git a/neutron/services/l3_router/brocade/mlx/__init__.py b/neutron/services/l3_router/brocade/mlx/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/neutron/services/l3_router/brocade/mlx/l3_router_plugin.py b/neutron/services/l3_router/brocade/mlx/l3_router_plugin.py new file mode 100644 index 00000000000..87f1e59c29f --- /dev/null +++ b/neutron/services/l3_router/brocade/mlx/l3_router_plugin.py @@ -0,0 +1,50 @@ +# Copyright 2015 Brocade Communications Systems, Inc. +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +"""Implementation of Brocade L3RouterPlugin for MLX switches.""" + +from networking_brocade.mlx.services.l3_router.brocade import ( + l3_router_plugin as plugin) +from oslo_config import cfg + +SWITCHES = [ + cfg.StrOpt( + 'switch_names', + default='', + help=('Switches connected to the compute nodes'))] + +L3_BROCADE = [cfg.StrOpt('address', default='', + help=('The IP address of the MLX switch')), + cfg.StrOpt('username', default='admin', + help=('The SSH username of the switch')), + cfg.StrOpt('password', default='password', secret=True, + help=('The SSH password of the switch')), + cfg.StrOpt('physical_networks', default='', + help=('Allowed physical networks where VLAN can ' + 'be configured on this switch')), + cfg.StrOpt('ports', default='', + help=('Ports to be tagged in the VLAN being ' + 'configured on the switch')), + ] +cfg.CONF.register_opts(SWITCHES, 'l3_brocade_mlx') + + +class BrocadeRouterPlugin(plugin.BrocadeRouterPlugin): + def __init__(self): + self._switch_names = cfg.CONF.l3_brocade_mlx.switch_names + switches = [x.strip() for x in self._switch_names.split(',')] + for switch in switches: + cfg.CONF.register_opts(L3_BROCADE, switch) + super(BrocadeRouterPlugin, self).__init__() diff --git a/setup.cfg b/setup.cfg index 4f8588a4b29..d668033c8ff 100644 --- a/setup.cfg +++ b/setup.cfg @@ -46,7 +46,9 @@ data_files = etc/neutron/plugins/bigswitch/ssl/ca_certs/README etc/neutron/plugins/bigswitch/ssl/host_certs = etc/neutron/plugins/bigswitch/ssl/host_certs/README - etc/neutron/plugins/brocade = etc/neutron/plugins/brocade/brocade.ini + etc/neutron/plugins/brocade = + etc/neutron/plugins/brocade/brocade.ini + etc/neutron/plugins/brocade/brocade_mlx.ini etc/neutron/plugins/brocade/vyatta = etc/neutron/plugins/brocade/vyatta/vrouter.ini etc/neutron/plugins/cisco = etc/neutron/plugins/cisco/cisco_cfg_agent.ini @@ -132,6 +134,7 @@ neutron.service_plugins = router = neutron.services.l3_router.l3_router_plugin:L3RouterPlugin bigswitch_l3 = neutron.plugins.bigswitch.l3_router_plugin:L3RestProxy brocade_vyatta_l3 = neutron.services.l3_router.brocade.vyatta.vrouter_neutron_plugin.VyattaVRouterPlugin + brocade_mlx_l3 = neutron.services.l3_router.brocade.mlx.l3_router_plugin:BrocadeRouterPlugin firewall = neutron_fwaas.services.firewall.fwaas_plugin:FirewallPlugin fsl_firewall = neutron_fwaas.services.firewall.freescale.fwaas_plugin:FirewallPlugin lbaas = neutron_lbaas.services.loadbalancer.plugin:LoadBalancerPlugin