diff --git a/etc/quantum/plugins/nicira/nvp.ini b/etc/quantum/plugins/nicira/nvp.ini index 87760e4a46..e46dc195e8 100644 --- a/etc/quantum/plugins/nicira/nvp.ini +++ b/etc/quantum/plugins/nicira/nvp.ini @@ -113,3 +113,6 @@ sql_connection = sqlite:// # This option is only useful if running on a host that does not support # namespaces otherwise access_network should be used. # metadata_mode = access_network + +# The default network transport type to use (stt, gre, bridge, ipsec_gre, or ipsec_stt) +# default_transport_type = stt diff --git a/quantum/plugins/nicira/common/config.py b/quantum/plugins/nicira/common/config.py index cc42f49a87..0376685e38 100644 --- a/quantum/plugins/nicira/common/config.py +++ b/quantum/plugins/nicira/common/config.py @@ -41,6 +41,9 @@ nvp_opts = [ cfg.BoolOpt('enable_metadata_access_network', default=True, help=_("Enables dedicated connection to the metadata proxy " "for metadata server access via Quantum router")), + cfg.StrOpt('default_transport_type', default='stt', + help=_("The default network tranport type to use (stt, gre, " + "bridge, ipsec_gre, or ipsec_stt)")), ] connection_opts = [ diff --git a/quantum/plugins/nicira/nvplib.py b/quantum/plugins/nicira/nvplib.py index 28a9b93e5c..e6f6ff0d6f 100644 --- a/quantum/plugins/nicira/nvplib.py +++ b/quantum/plugins/nicira/nvplib.py @@ -26,6 +26,8 @@ import inspect import json import logging +from oslo.config import cfg + #FIXME(danwent): I'd like this file to get to the point where it has # no quantum-specific logic in it from quantum.common import constants @@ -40,8 +42,6 @@ HTTP_GET = "GET" HTTP_POST = "POST" HTTP_DELETE = "DELETE" HTTP_PUT = "PUT" -# Default transport type for logical switches -DEF_TRANSPORT_TYPE = "stt" # Prefix to be used for all NVP API calls URI_PREFIX = "/ws.v1" # Resources exposed by NVP API @@ -296,10 +296,11 @@ def create_lswitch(cluster, tenant_id, display_name, nvp_binding_type = transport_type if transport_type in ('flat', 'vlan'): nvp_binding_type = 'bridge' - transport_zone_config = {"zone_uuid": (transport_zone_uuid or - cluster.default_tz_uuid), - "transport_type": (nvp_binding_type or - DEF_TRANSPORT_TYPE)} + transport_zone_config = ( + {"zone_uuid": (transport_zone_uuid or + cluster.default_tz_uuid), + "transport_type": (nvp_binding_type or + cfg.CONF.NVP.default_transport_type)}) lswitch_obj = {"display_name": _check_and_truncate_name(display_name), "transport_zones": [transport_zone_config], "tags": [{"tag": tenant_id, "scope": "os_tid"}, diff --git a/quantum/tests/unit/nicira/test_nvpopts.py b/quantum/tests/unit/nicira/test_nvpopts.py index 2f6fc68594..1288bd95f5 100644 --- a/quantum/tests/unit/nicira/test_nvpopts.py +++ b/quantum/tests/unit/nicira/test_nvpopts.py @@ -120,6 +120,7 @@ class ConfigurationTest(testtools.TestCase): self.assertEqual(64, cfg.CONF.NVP.max_lp_per_bridged_ls) self.assertEqual(256, cfg.CONF.NVP.max_lp_per_overlay_ls) self.assertEqual(5, cfg.CONF.NVP.concurrent_connections) + self.assertEqual('stt', cfg.CONF.NVP.default_transport_type) self.assertIsNone(cfg.CONF.default_tz_uuid) self.assertIsNone(cfg.CONF.nvp_cluster_uuid)