Add L3 flat overlay config in startup.cfg 91/56191/1
authorShakib Ahmed <sheikahm@cisco.com>
Thu, 27 Apr 2017 17:20:58 +0000 (10:20 -0700)
committerShakib Ahmed <sheikahm@cisco.com>
Thu, 27 Apr 2017 17:20:58 +0000 (10:20 -0700)
A new config is being added to decide whether to use vxlan tunnel to
for L2 or should we just create a flat L3 and eliminate the L2
boardcast domain and communication should be done by L3.

Change-Id: I1d78df38dab9f84dfdb8e5a7c3d709a2b2ee7fd3
Signed-off-by: Shakib Ahmed <sheikahm@cisco.com>
renderers/vpp/src/main/java/org/opendaylight/groupbasedpolicy/renderer/vpp/config/ConfigUtil.java
renderers/vpp/src/main/java/org/opendaylight/groupbasedpolicy/renderer/vpp/config/ConfigurationService.java
renderers/vpp/src/main/resources/startup.cfg

index fe2209da4c337e74fa1a753fb2d3d99888ca49fc..76532393d55631adb25777b5d52a3aa3beea0c1b 100644 (file)
@@ -21,14 +21,18 @@ public class ConfigUtil {
 
     private static boolean DEFAULT_LISP_OVERLAY_ENABLED = false;
     private static boolean DEFAULT_LISP_MAPREGISTER_ENABLED = true;
+    private static boolean DEFAULT_L3_FLAT_ENABLED = false;
 
     private IpAddress odlTenantIp;
     private boolean lispOverlayEnabled = DEFAULT_LISP_OVERLAY_ENABLED;
     private boolean lispMapRegisterEnbled = DEFAULT_LISP_MAPREGISTER_ENABLED;
+    private boolean l3FlatEnabled = DEFAULT_L3_FLAT_ENABLED;
+
 
     public static String ODL_TENANT_IP = "odl.ip.tenant";
     public static String LISP_OVERLAY_ENABLED = "gbp.lisp.enabled";
     public static String LISP_MAPREGISTER_ENABLED = "vpp.lisp.mapregister.enabled";
+    public static String L3_FLAT_ENABLED = "vpp.l3.flat.enabled";
 
     private static ConfigUtil INSTANCE = new ConfigUtil();
 
@@ -96,6 +100,22 @@ public class ConfigUtil {
         }
     }
 
+    public void configL3FlatEnabled(String configStr) {
+        if (configStr == null) {
+            l3FlatEnabled = DEFAULT_L3_FLAT_ENABLED;
+            LOG.debug("Configuration variable {} is being unset. Setting the variable to {}",
+                    L3_FLAT_ENABLED, DEFAULT_L3_FLAT_ENABLED);
+        }
+
+        configStr = configStr.trim();
+
+        if (configStr.equalsIgnoreCase("true")) {
+            l3FlatEnabled = true;
+        } else {
+            l3FlatEnabled = false;
+        }
+    }
+
     public IpAddress getOdlTenantIp() {
         return odlTenantIp;
     }
@@ -111,4 +131,8 @@ public class ConfigUtil {
     public boolean isLispMapRegisterEnbled() {
         return lispMapRegisterEnbled;
     }
+
+    public boolean isL3FlatEnabled() {
+        return l3FlatEnabled;
+    }
 }
index 4041a9459553190988fb4f66c73f976207901885..14977b45ce5206164640d81c4ad76d7b224bb470 100644 (file)
@@ -77,5 +77,7 @@ public class ConfigurationService implements ManagedService{
                 mrConfig -> configUtil.configureMapRegister((String) mrConfig));
         configMethods.put(ConfigUtil.LISP_OVERLAY_ENABLED,
                 overlayConfig -> configUtil.configureLispOverlayEnabled((String) overlayConfig));
+        configMethods.put(ConfigUtil.L3_FLAT_ENABLED,
+                l3FlatConfig -> configUtil.configL3FlatEnabled((String) l3FlatConfig));
     }
 }
index b58f5597bbced1a10464db660bacb4cf7d291e35..5ebd8d87430e6e0716fc873d2a6c9fcb71fd1bd2 100644 (file)
@@ -25,4 +25,13 @@ gbp.lisp.enabled = true
 # Valid config: true/false
 # Required config: gbp.lisp.enabled is set to be true.
 # Default value: true
-vpp.lisp.mapregister.enabled = true
\ No newline at end of file
+vpp.lisp.mapregister.enabled = true
+
+# This property determines whether a flat l3 overlay will created.
+# If true, there will not be any vxlan involved for L2. There will
+# not be any L2 broadcast domain. All VMs will communicate via L3
+# only.
+# Valid config: true/false
+# Required config: gbp.lisp.enabled is set to be true.
+# Default value: true
+vpp.l3.flat.enabled = true
\ No newline at end of file