From 1678b55dcecf8d8fb4bb3e523a2047d3db7b9dee Mon Sep 17 00:00:00 2001 From: Angela Smith Date: Tue, 10 Feb 2015 15:38:37 -0800 Subject: [PATCH] Add ML2 VLAN mechanism driver for Brocade MLX and ICX switches. This thin driver will introduce VLAN support on Brocade MLX and ICX switches. Vendor specific driver implementation will reside in a separate repository. Partial-Bug: 1420045 Change-Id: Ia5af6c2e9b52129749c17db53d1d3891d42ec7f1 --- .../plugins/ml2/ml2_conf_brocade_fi_ni.ini | 33 ++++++++++++ .../ml2/drivers/brocade/fi_ni/__init__.py | 0 .../brocade/fi_ni/mechanism_brocade_fi_ni.py | 53 +++++++++++++++++++ setup.cfg | 2 + 4 files changed, 88 insertions(+) create mode 100644 etc/neutron/plugins/ml2/ml2_conf_brocade_fi_ni.ini create mode 100644 neutron/plugins/ml2/drivers/brocade/fi_ni/__init__.py create mode 100644 neutron/plugins/ml2/drivers/brocade/fi_ni/mechanism_brocade_fi_ni.py diff --git a/etc/neutron/plugins/ml2/ml2_conf_brocade_fi_ni.ini b/etc/neutron/plugins/ml2/ml2_conf_brocade_fi_ni.ini new file mode 100644 index 000000000..887ccf5ab --- /dev/null +++ b/etc/neutron/plugins/ml2/ml2_conf_brocade_fi_ni.ini @@ -0,0 +1,33 @@ +[ml2_brocade_fi_ni] +# switch_names = Comma separated names of switch to be configured +# Example: +# switch_names = icx-1, icx-2 + +# [switch-name-1] +# address = The address of the host to SSH to +# username = The username to use to connect to device +# password = The password to use to connect to device +# physical_networks = Allowed physical networks +# ports = Ports on the switch which needs to tagged to VLAN. Multiple ports can be separated by a comma. +# transport = Protocol to use for device connection(SSH or Telnet). Default is SSH. This is an optional parameter +# ostype = Optional parameter, which will identify the firmware version(FI/NI) +# +# Example: +# [icx-1] +# address = 10.24.20.22 +# username = admin +# password = password +# physical_networks = physnet1 +# ports = 1/1/1, 1/1/2 +# transport = SSH +# ostype = FI + +# Example: +# [mlx] +# address = 10.24.20.21 +# username = admin +# password = password +# physical_networks = physnet1 +# ports = 3/3, 3/9 +# transport = SSH +# ostype = NI diff --git a/neutron/plugins/ml2/drivers/brocade/fi_ni/__init__.py b/neutron/plugins/ml2/drivers/brocade/fi_ni/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/neutron/plugins/ml2/drivers/brocade/fi_ni/mechanism_brocade_fi_ni.py b/neutron/plugins/ml2/drivers/brocade/fi_ni/mechanism_brocade_fi_ni.py new file mode 100644 index 000000000..d8c7dc4d7 --- /dev/null +++ b/neutron/plugins/ml2/drivers/brocade/fi_ni/mechanism_brocade_fi_ni.py @@ -0,0 +1,53 @@ +# 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 ML2 Mechanism driver for ICX and MLX.""" + +from networking_brocade.mlx.ml2.fi_ni import mechanism_brocade_fi_ni +from oslo_config import cfg + +SWITCHES = [ + cfg.StrOpt( + 'switch_names', + default='', + help=('Switches connected to the compute nodes'))] + +ML2_BROCADE = [cfg.StrOpt('address', default='', + help=('The address of the host to SSH to')), + cfg.StrOpt('username', default='admin', + help=('The SSH username to use')), + cfg.StrOpt('password', default='password', secret=True, + help=('The SSH password to use')), + cfg.StrOpt('physical_networks', default='', + help=('Allowed physical networks')), + cfg.StrOpt('ports', default='', + help=('Ports')), + cfg.StrOpt('transport', default='SSH', + choices=('SSH', 'TELNET'), + help=('Protocol used to communicate with Switch')), + cfg.StrOpt('ostype', default='NI', choices=('NI', 'FI'), + help=('OS type of the device.')), + ] +cfg.CONF.register_opts(SWITCHES, 'ml2_brocade_fi_ni') + + +class BrocadeFiNiMechanism(mechanism_brocade_fi_ni.BrocadeFiNiMechanism): + + def __init__(self): + self._switch_names = cfg.CONF.ml2_brocade_fi_ni.switch_names + switches = [x.strip() for x in self._switch_names.split(',')] + for switch in switches: + cfg.CONF.register_opts(ML2_BROCADE, switch) + super(BrocadeFiNiMechanism, self).__init__() diff --git a/setup.cfg b/setup.cfg index 02be68223..74cd70a5c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -63,6 +63,7 @@ data_files = etc/neutron/plugins/ml2/ml2_conf.ini etc/neutron/plugins/ml2/ml2_conf_arista.ini etc/neutron/plugins/ml2/ml2_conf_brocade.ini + etc/neutron/plugins/ml2/ml2_conf_brocade_fi_ni.ini etc/neutron/plugins/ml2/ml2_conf_cisco.ini etc/neutron/plugins/ml2/ml2_conf_mlnx.ini etc/neutron/plugins/ml2/ml2_conf_ncs.ini @@ -179,6 +180,7 @@ neutron.ml2.mechanism_drivers = ofagent = neutron.plugins.ml2.drivers.ofagent.driver:OfagentMechanismDriver mlnx = neutron.plugins.ml2.drivers.mlnx.mech_mlnx:MlnxMechanismDriver brocade = networking_brocade.vdx.ml2driver.mechanism_brocade:BrocadeMechanism + brocade_fi_ni = neutron.plugins.ml2.drivers.brocade.fi_ni.mechanism_brocade_fi_ni:BrocadeFiNiMechanism fslsdn = neutron.plugins.ml2.drivers.freescale.mechanism_fslsdn:FslsdnMechanismDriver sriovnicswitch = neutron.plugins.ml2.drivers.mech_sriov.mech_driver:SriovNicSwitchMechanismDriver nuage = neutron.plugins.ml2.drivers.mech_nuage.driver:NuageMechanismDriver -- 2.45.2