]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Brocade Vyatta vrouter shim plugin for vendor decomposition
authorSripriya <sseetha@brocade.com>
Wed, 25 Feb 2015 09:51:04 +0000 (01:51 -0800)
committerSripriya <sseetha@brocade.com>
Tue, 17 Mar 2015 15:32:24 +0000 (08:32 -0700)
Vendor plugin code is available at:
https://github.com/stackforge/networking-brocade/tree/master/networking_brocade/vyatta

DocImpact
Partially-implements: blueprint core-vendor-decomposition
Closes-bug: #1414733

Change-Id: I2503560795567a77df855b5137f4231dea3520ad

etc/neutron/plugins/brocade/vyatta/vrouter.ini [new file with mode: 0644]
neutron/services/l3_router/brocade/requirements.txt [new file with mode: 0644]
neutron/services/l3_router/brocade/vyatta/__init__.py [new file with mode: 0644]
neutron/services/l3_router/brocade/vyatta/vrouter_neutron_plugin.py [new file with mode: 0644]
setup.cfg

diff --git a/etc/neutron/plugins/brocade/vyatta/vrouter.ini b/etc/neutron/plugins/brocade/vyatta/vrouter.ini
new file mode 100644 (file)
index 0000000..fdcffd6
--- /dev/null
@@ -0,0 +1,21 @@
+# Brocade Vyatta vRouter L3 Plugin Configuration File
+[vrouter]
+# Tenant admin name
+# tenant_admin_name = admin
+
+# Tenant admin password
+# tenant_admin_password = devstack
+
+# Service VM Admin Tenant id
+# tenant_id =
+# Example: tenant_id = 2bde406aa6ba424d80a9eb658a02178c
+
+# Vyatta vRouter Image id. Image should be imported using Glance.
+# image_id =
+# Example: image_id = 527b9c5a-b297-4a09-8785-c492465c8461
+
+# VM Flavor for vRouter
+# flavor = 2
+
+# vRouter Management network name
+# management_network = management
diff --git a/neutron/services/l3_router/brocade/requirements.txt b/neutron/services/l3_router/brocade/requirements.txt
new file mode 100644 (file)
index 0000000..15f03ff
--- /dev/null
@@ -0,0 +1 @@
+networking-brocade
diff --git a/neutron/services/l3_router/brocade/vyatta/__init__.py b/neutron/services/l3_router/brocade/vyatta/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/neutron/services/l3_router/brocade/vyatta/vrouter_neutron_plugin.py b/neutron/services/l3_router/brocade/vyatta/vrouter_neutron_plugin.py
new file mode 100644 (file)
index 0000000..9863e94
--- /dev/null
@@ -0,0 +1,71 @@
+# Copyright 2015 OpenStack Foundation.
+# 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.
+
+from networking_brocade.vyatta.vrouter import neutron_plugin as vrouter_plugin
+from oslo_config import cfg
+
+from neutron.common import constants as l3_constants
+
+vrouter_opts = [
+    cfg.StrOpt('tenant_admin_name', help=_('Name of tenant admin user.')),
+    cfg.StrOpt('tenant_admin_password', secret=True,
+               help=_('Tenant admin password.')),
+    cfg.StrOpt('tenant_id',
+               help=_('UUID of tenant that holds Vyatta vRouter instances.')),
+    cfg.StrOpt('image_id',
+               help=_('Nova image id for instances of Vyatta vRouter.')),
+    cfg.StrOpt('flavor', default=2,
+               help=_('Nova VM flavor for instances of Vyatta vRouter.')),
+    cfg.StrOpt('management_network_id',
+               help=_('Vyatta vRouter management network id.')),
+    cfg.StrOpt('vrouter_credentials', default="vyatta:vyatta",
+               help=_('Vyatta vRouter login credentials')),
+    cfg.IntOpt('nova_poll_interval', default=5,
+               help=_('Number of seconds between consecutive Nova queries '
+                      'when waiting for router instance status change.')),
+    cfg.IntOpt('nova_spawn_timeout', default=300,
+               help=_('Number of seconds to wait for Nova to activate '
+                      'instance before setting resource to error state.')),
+    cfg.IntOpt('vrouter_poll_interval', default=5,
+               help=_('Number of seconds between consecutive Vyatta vRouter '
+                      'queries when waiting for router instance boot.')),
+    cfg.IntOpt('vrouter_boot_timeout', default=300,
+               help=_('Number of seconds to wait for Vyatta vRouter to boot '
+                      'before setting resource to error state.')),
+    cfg.StrOpt('keystone_url', help=_('Keystone URL.'))
+]
+
+cfg.CONF.register_opts(vrouter_opts, "VROUTER")
+
+
+class VyattaVRouterPlugin(vrouter_plugin.VyattaVRouterMixin):
+    """Brocade Neutron L3 Plugin for Vyatta vRouter.
+
+    Supports CRUD operations on vRouter, add/remove interfaces from vRouter
+    and floating IPs for VMs.It performs vRouter VM lifecyle management by
+    calling Nova APIs during the Create and Delete Router calls.
+    Once the vRouter VM is up, L3 plugin uses REST API to perform the
+    configurations. L3 plugin supports add/remove router interfaces by
+    attaching the neutron ports to vRouter VM using Nova API.
+    RPC notifications will be used by the firewall agent that is coupled
+    with l3-agent. This is needed for our firewall plugin.
+    """
+
+    supported_extension_aliases = [
+        "router", "ext-gw-mode", "extraroute",
+        l3_constants.L3_AGENT_SCHEDULER_EXT_ALIAS]
+
+    def __init__(self):
+        super(VyattaVRouterPlugin, self).__init__()
index a446c015e00c1eabd013d77998968d704c9dc0ab..ea25ad9a338123a63f4ec2e11173f3b42152b123 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -47,6 +47,7 @@ data_files =
     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/vyatta = etc/neutron/plugins/brocade/vyatta/vrouter.ini
     etc/neutron/plugins/cisco =
         etc/neutron/plugins/cisco/cisco_cfg_agent.ini
         etc/neutron/plugins/cisco/cisco_plugins.ini
@@ -129,6 +130,7 @@ neutron.service_plugins =
     dummy = neutron.tests.unit.dummy_plugin:DummyServicePlugin
     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
     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