]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
NVP plugin: configure metadata network only if overlapping IPs are enabled
authorSalvatore Orlando <salv.orlando@gmail.com>
Thu, 7 Mar 2013 13:19:16 +0000 (14:19 +0100)
committerSalvatore Orlando <salv.orlando@gmail.com>
Thu, 7 Mar 2013 13:21:43 +0000 (14:21 +0100)
Bug 1152144

This patch also add a warning emitted in the logs at startup if the
configuration is not correct.

Change-Id: Idbf10c64f068a71ef1ed9c29a6a0c4e736bb975d

quantum/plugins/nicira/nicira_nvp_plugin/QuantumPlugin.py
quantum/plugins/nicira/nicira_nvp_plugin/common/metadata_access.py

index 4d64f3edd42ed5a6cfb2d05b59fb7abbb7d7c1de..5c66047a88088cd7b8563c773566258a79e37f82 100644 (file)
@@ -132,6 +132,11 @@ def parse_config():
         cfg.CONF.set_override(
             'api_extensions_path',
             'quantum/plugins/nicira/nicira_nvp_plugin/extensions')
+    if (cfg.CONF.NVP.enable_metadata_access_network and
+        not cfg.CONF.allow_overlapping_ips):
+        LOG.warn(_("Overlapping IPs must be enabled in order to setup "
+                   "the metadata access network. Metadata access in "
+                   "routed mode will not work with this configuration"))
     return cfg.CONF.NVP, clusters_options
 
 
index f3a07aea73653c1da7315cbd0096701d88199271..81fdf66e54939da27bf0d0d4440c77c591933b29 100644 (file)
@@ -117,6 +117,10 @@ class NvpMetadataAccess(object):
         if not cfg.CONF.NVP.enable_metadata_access_network:
             LOG.debug(_("Metadata access network is disabled"))
             return
+        if not cfg.CONF.allow_overlapping_ips:
+            LOG.warn(_("Overlapping IPs must be enabled in order to setup "
+                       "the metadata access network"))
+            return
         # As we'll use a different device_owner for metadata interface
         # this query will return only 'real' router interfaces
         ctx_elevated = context.elevated()