Add vni-ranges option for supporting vxlan

Add vni-ranges option for supporting editable vxlan range

Change-Id: I6988aa64ca179c28093da6e6263dc00b35e972fd
Closes-Bug: 1545886
This commit is contained in:
Seyeong Kim 2016-03-03 15:08:15 +09:00
parent f832bc319f
commit 74c22adc03
5 changed files with 15 additions and 2 deletions

View File

@ -127,6 +127,11 @@ options:
<physical_network> specifying physical_network names usable for VLAN
provider and tenant networks, as well as ranges of VLAN tags on each
available for allocation to tenant networks.
vni-ranges:
type: string
default: "1001:2000"
description: |
Space-delimited list of <vxlan_min>:<vxlan_max> for VXLAN provider.
# Quota configuration settings
quota-security-group:
default: 10

View File

@ -233,6 +233,10 @@ class NeutronCCContext(context.NeutronContext):
if vlan_ranges:
ctxt['vlan_ranges'] = ','.join(vlan_ranges.split())
vni_ranges = config('vni-ranges')
if vni_ranges:
ctxt['vni_ranges'] = ','.join(vni_ranges.split())
ctxt['enable_ml2_port_security'] = config('enable-ml2-port-security')
return ctxt

View File

@ -16,7 +16,7 @@ mechanism_drivers = openvswitch,hyperv,l2population
tunnel_id_ranges = 1:1000
[ml2_type_vxlan]
vni_ranges = 1001:2000
vni_ranges = {{ vni_ranges }}
[ml2_type_vlan]
network_vlan_ranges = {{ vlan_ranges }}

View File

@ -20,7 +20,7 @@ mechanism_drivers = openvswitch,l2population
tunnel_id_ranges = 1:1000
[ml2_type_vxlan]
vni_ranges = 1001:2000
vni_ranges = {{ vni_ranges }}
[ml2_type_vlan]
network_vlan_ranges = {{ vlan_ranges }}

View File

@ -319,6 +319,7 @@ class NeutronCCContextTest(CharmTestCase):
'quota_subnet': 10,
'quota_vip': 10,
'vlan_ranges': 'physnet1:1000:2000',
'vni_ranges': '1001:2000',
'enable_ml2_port_security': True
}
napi_ctxt = context.NeutronCCContext()
@ -332,6 +333,7 @@ class NeutronCCContextTest(CharmTestCase):
plugin.return_value = None
self.test_config.set('flat-network-providers', 'physnet2 physnet3')
self.test_config.set('overlay-network-type', 'vxlan')
self.test_config.set('vni-ranges', '1001:2000 3001:4000')
ctxt_data = {
'debug': True,
'enable_dvr': False,
@ -354,6 +356,7 @@ class NeutronCCContextTest(CharmTestCase):
'quota_subnet': 10,
'quota_vip': 10,
'vlan_ranges': 'physnet1:1000:2000',
'vni_ranges': '1001:2000,3001:4000',
'network_providers': 'physnet2,physnet3',
'enable_ml2_port_security': True
}
@ -395,6 +398,7 @@ class NeutronCCContextTest(CharmTestCase):
'quota_subnet': 10,
'quota_vip': 10,
'vlan_ranges': 'physnet1:1000:2000',
'vni_ranges': '1001:2000',
'enable_ml2_port_security': True
}
napi_ctxt = context.NeutronCCContext()