Add ext-gw-mode support to ML2

Closes-Bug: #1212772

ML2 doesn't support ext-gw-mode, resulting in L3 agents not
setting-up NAT rules in neutron routers (currently, l3 agents
will assume enable_snat=false if plugin doesn't provide this
parameter as described in bug 1212868)

This patchset adds the support of ext-gw-mode to ML2 plugin.

In order to support ext-gw-mode alembic migration (as well as
other potential migrations on plugin dbs), folsom_initial
migration script is fixed to include ML2 plugin. Otherwise
databases won't be set-up during migration script (but at
plugin startup by sqlalchemy), resulting in migration failures.

Change-Id: I95ec18e0a4f0e5b661f3a5d679c434f18f100fa6
This commit is contained in:
Francois Eleouet 2013-08-16 13:24:20 +02:00
parent 7a79ea4f2f
commit 62040d03b3
4 changed files with 11 additions and 2 deletions

View File

@ -33,6 +33,7 @@ migration_for_plugins = [
'neutron.plugins.hyperv.hyperv_neutron_plugin.HyperVNeutronPlugin',
'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2',
'neutron.plugins.metaplugin.meta_neutron_plugin.MetaPluginV2',
'neutron.plugins.ml2.plugin.Ml2Plugin',
'neutron.plugins.nec.nec_plugin.NECPluginV2',
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',

View File

@ -29,7 +29,7 @@ PLUGINS = {
'cisco': 'neutron.plugins.cisco.network_plugin.PluginV2',
'lbr': 'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2',
'meta': 'neutron.plugins.metaplugin.meta_neutron_plugin.MetaPluginV2',
'ml2': 'neutron.plugins.ml2.ml2_plugin.Ml2Plugin',
'ml2': 'neutron.plugins.ml2.plugin.Ml2Plugin',
'nec': 'neutron.plugins.nec.nec_plugin.NECPluginV2',
'nvp': 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
'ovs': 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',

View File

@ -25,6 +25,7 @@ from neutron.common import topics
from neutron.db import agentschedulers_db
from neutron.db import db_base_plugin_v2
from neutron.db import extraroute_db
from neutron.db import l3_gwmode_db
from neutron.db import portbindings_db
from neutron.db import quota_db # noqa
from neutron.db import securitygroups_rpc_base as sg_db_rpc
@ -51,6 +52,7 @@ TYPE_MULTI_SEGMENT = 'multi-segment'
class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
extraroute_db.ExtraRoute_db_mixin,
l3_gwmode_db.L3_NAT_db_mixin,
sg_db_rpc.SecurityGroupServerRpcMixin,
agentschedulers_db.L3AgentSchedulerDbMixin,
agentschedulers_db.DhcpAgentSchedulerDbMixin,
@ -75,7 +77,7 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
_supported_extension_aliases = ["provider", "router", "extraroute",
"binding", "quotas", "security-group",
"agent", "l3_agent_scheduler",
"dhcp_agent_scheduler"]
"dhcp_agent_scheduler", "ext-gw-mode"]
@property
def supported_extension_aliases(self):

View File

@ -16,6 +16,7 @@
from neutron.plugins.ml2 import config as config
from neutron.tests.unit import _test_extension_portbindings as test_bindings
from neutron.tests.unit import test_db_plugin as test_plugin
from neutron.tests.unit import test_extension_ext_gw_mode
PLUGIN_NAME = 'neutron.plugins.ml2.plugin.Ml2Plugin'
@ -69,3 +70,8 @@ class TestMl2PortsV2(test_plugin.TestPortsV2, Ml2PluginV2TestCase):
class TestMl2PortBindingHost(Ml2PluginV2TestCase,
test_bindings.PortBindingsHostTestCaseMixin):
pass
class TestMl2ExtGwModeSupport(Ml2PluginV2TestCase,
test_extension_ext_gw_mode.ExtGwModeTestCase):
pass