Add ability to configure allowed vlan ranges in deploy configuration 39/23439/1
authorPeng Liu <pliu@redhat.com>
Tue, 20 Sep 2016 20:35:18 +0000 (16:35 -0400)
committerPeng Liu <pliu@redhat.com>
Thu, 20 Oct 2016 08:42:04 +0000 (04:42 -0400)
Add a new parameter 'vlan_id_range' for tenant vlan range, which can
set the 'network_vlan_ranges' for 'datacentre' network in ml2.ini on
both compute and controller.

JIRA: APEX-272

Change-Id: I5c190fb2d5d582d0d5f56d4c18cf32502b758bd8
Signed-off-by: Peng Liu <pliu@redhat.com>
(cherry picked from commit 3228f00248cda32671fb0e6a02059bea6ae66c99)

config/network/network_settings.yaml
lib/python/apex/network_environment.py

index f768064..5c9d644 100644 (file)
@@ -57,6 +57,7 @@ private_network:
   cidr: 11.0.0.0/24
   compute_interface: nic2
   controller_interface: nic2
+  vlan_id_range: 1,1000            # Tenant physical network VLAN-ID range
 
 # "public" network is used for external connectivity.
 # The external network provides Internet access for virtual
index d96fa44..61810d8 100644 (file)
@@ -126,6 +126,12 @@ class NetworkEnvironment(dict):
                   }]
             priv_cidr = net_settings[PRIVATE_NETWORK]['cidr']
             self[param_def]['TenantNetCidr'] = str(priv_cidr)
+            if 'vlan_id_range' in net_settings[PRIVATE_NETWORK].keys():
+                tenant_vlan_range = \
+                    net_settings[PRIVATE_NETWORK]['vlan_id_range'].split(',')
+                self[param_def]['NeutronNetworkVLANRanges'] = \
+                    "datacentre:" + tenant_vlan_range[0] + ':' \
+                    + tenant_vlan_range[1]
             if priv_cidr.version == 6:
                 postfix = '/tenant_v6.yaml'
             else: