Add ability to configure allowed vlan ranges in deploy configuration 63/23263/3
authorPeng Liu <pliu@redhat.com>
Tue, 20 Sep 2016 20:35:18 +0000 (16:35 -0400)
committerPeng Liu <pliu@redhat.com>
Tue, 18 Oct 2016 01:28:09 +0000 (21:28 -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.

Change-Id: I5c190fb2d5d582d0d5f56d4c18cf32502b758bd8
JIRA: APEX-272
Signed-off-by: Peng Liu <pliu@redhat.com>
config/network/network_settings.yaml
lib/python/apex/network_environment.py

index ab9ed96..ee5537d 100644 (file)
@@ -89,6 +89,7 @@ networks:                            # Network configurations
     mtu: 64000                       # Tenant network MTU
     overlay_id_range: 2,65535        # Tenant network Overlay segmentation ID range:
                                      # VNI, VLAN-ID, etc.
+    vlan_id_range: 1,1000            # Tenant physical network VLAN-ID range
     segmentation_type: vxlan         # Tenant network segmentation type:
                                      # vlan, vxlan, gre
     nic_mapping:                     # Mapping of network configuration for Overcloud Nodes
index 5cb2d0c..bbe8ee6 100644 (file)
@@ -116,6 +116,12 @@ class NetworkEnvironment(dict):
                   'end': str(tenant_range[1])}]
             tenant_cidr = nets[TENANT_NETWORK]['cidr']
             self[param_def]['TenantNetCidr'] = str(tenant_cidr)
+            if 'vlan_id_range' in nets[TENANT_NETWORK].keys():
+                tenant_vlan_range = \
+                    nets[TENANT_NETWORK]['vlan_id_range'].split(',')
+                self[param_def]['NeutronNetworkVLANRanges'] = \
+                    "datacentre:" + tenant_vlan_range[0] + ':' \
+                    + tenant_vlan_range[1]
             if tenant_cidr.version == 6:
                 postfix = '/tenant_v6.yaml'
             else: