]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Add ML2 VLAN mechanism driver for Brocade MLX and ICX switches.
authorAngela Smith <aallen@brocade.com>
Tue, 10 Feb 2015 23:38:37 +0000 (15:38 -0800)
committerAngela Smith <aallen@brocade.com>
Wed, 18 Mar 2015 01:42:34 +0000 (18:42 -0700)
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

etc/neutron/plugins/ml2/ml2_conf_brocade_fi_ni.ini [new file with mode: 0644]
neutron/plugins/ml2/drivers/brocade/fi_ni/__init__.py [new file with mode: 0644]
neutron/plugins/ml2/drivers/brocade/fi_ni/mechanism_brocade_fi_ni.py [new file with mode: 0644]
setup.cfg

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 (file)
index 0000000..887ccf5
--- /dev/null
@@ -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 (file)
index 0000000..e69de29
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 (file)
index 0000000..d8c7dc4
--- /dev/null
@@ -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__()
index 02be682235ac5d930cf5ad263378a492238985a6..74cd70a5cb75af5e755898b44b966efc03b22c1f 100644 (file)
--- 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