Merge next branch
This commit is contained in:
commit
1311062402
@ -89,6 +89,11 @@ options:
|
|||||||
gre
|
gre
|
||||||
vxlan
|
vxlan
|
||||||
.
|
.
|
||||||
|
vlan-ranges:
|
||||||
|
type: string
|
||||||
|
default: "physnet1:1000:2000"
|
||||||
|
description: |
|
||||||
|
Space-delimited list of network provider vlan id ranges.
|
||||||
# Quota configuration settings
|
# Quota configuration settings
|
||||||
quota-security-group:
|
quota-security-group:
|
||||||
default: 10
|
default: 10
|
||||||
|
@ -13,6 +13,9 @@ from charmhelpers.contrib.hahelpers.cluster import (
|
|||||||
from charmhelpers.contrib.openstack.utils import (
|
from charmhelpers.contrib.openstack.utils import (
|
||||||
os_release,
|
os_release,
|
||||||
)
|
)
|
||||||
|
from charmhelpers.contrib.openstack.neutron import (
|
||||||
|
parse_vlan_range_mappings,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_l2population():
|
def get_l2population():
|
||||||
@ -126,6 +129,25 @@ class NeutronCCContext(context.NeutronContext):
|
|||||||
def _save_flag_file(self):
|
def _save_flag_file(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def get_neutron_api_rel_settings(self):
|
||||||
|
settings = {}
|
||||||
|
for rid in relation_ids('neutron-api'):
|
||||||
|
for unit in related_units(rid):
|
||||||
|
rdata = relation_get(rid=rid, unit=unit)
|
||||||
|
cell_type = rdata.get('cell_type')
|
||||||
|
settings['nova_url'] = rdata.get('nova_url')
|
||||||
|
settings['restart_trigger'] = rdata.get('restart_trigger')
|
||||||
|
# If there are multiple nova-cloud-controllers joined to this
|
||||||
|
# service in a cell deployment then ignore the non-api cell
|
||||||
|
# ones
|
||||||
|
if cell_type and not cell_type == "api":
|
||||||
|
continue
|
||||||
|
|
||||||
|
if settings['nova_url']:
|
||||||
|
return settings
|
||||||
|
|
||||||
|
return settings
|
||||||
|
|
||||||
def __call__(self):
|
def __call__(self):
|
||||||
from neutron_api_utils import api_port
|
from neutron_api_utils import api_port
|
||||||
ctxt = super(NeutronCCContext, self).__call__()
|
ctxt = super(NeutronCCContext, self).__call__()
|
||||||
@ -167,19 +189,17 @@ class NeutronCCContext(context.NeutronContext):
|
|||||||
ctxt['quota_router'] = config('quota-router')
|
ctxt['quota_router'] = config('quota-router')
|
||||||
ctxt['quota_floatingip'] = config('quota-floatingip')
|
ctxt['quota_floatingip'] = config('quota-floatingip')
|
||||||
|
|
||||||
for rid in relation_ids('neutron-api'):
|
n_api_settings = self.get_neutron_api_rel_settings()
|
||||||
for unit in related_units(rid):
|
if n_api_settings:
|
||||||
rdata = relation_get(rid=rid, unit=unit)
|
ctxt.update(n_api_settings)
|
||||||
cell_type = rdata.get('cell_type')
|
|
||||||
ctxt['nova_url'] = rdata.get('nova_url')
|
vlan_ranges = config('vlan-ranges')
|
||||||
ctxt['restart_trigger'] = rdata.get('restart_trigger')
|
vlan_range_mappings = parse_vlan_range_mappings(vlan_ranges)
|
||||||
# If there are multiple nova-cloud-controllers joined to this
|
if vlan_range_mappings:
|
||||||
# service in a cell deployment then ignore the non-api cell
|
providers = sorted(vlan_range_mappings.keys())
|
||||||
# ones
|
ctxt['network_providers'] = ','.join(providers)
|
||||||
if cell_type and not cell_type == "api":
|
ctxt['vlan_ranges'] = ','.join(vlan_ranges.split())
|
||||||
continue
|
|
||||||
if ctxt['nova_url']:
|
|
||||||
return ctxt
|
|
||||||
return ctxt
|
return ctxt
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,10 +15,10 @@ tunnel_id_ranges = 1:1000
|
|||||||
vni_ranges = 1001:2000
|
vni_ranges = 1001:2000
|
||||||
|
|
||||||
[ml2_type_vlan]
|
[ml2_type_vlan]
|
||||||
network_vlan_ranges = physnet1:1000:2000
|
network_vlan_ranges = {{ vlan_ranges }}
|
||||||
|
|
||||||
[ml2_type_flat]
|
[ml2_type_flat]
|
||||||
flat_networks = physnet1
|
flat_networks = {{ network_providers }}
|
||||||
|
|
||||||
[ovs]
|
[ovs]
|
||||||
enable_tunneling = True
|
enable_tunneling = True
|
||||||
|
36
templates/kilo/ml2_conf.ini
Normal file
36
templates/kilo/ml2_conf.ini
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# kilo
|
||||||
|
###############################################################################
|
||||||
|
# [ WARNING ]
|
||||||
|
# Configuration file maintained by Juju. Local changes may be overwritten.
|
||||||
|
###############################################################################
|
||||||
|
[ml2]
|
||||||
|
type_drivers = gre,vxlan,vlan,flat
|
||||||
|
tenant_network_types = gre,vxlan,vlan,flat
|
||||||
|
mechanism_drivers = openvswitch,l2population
|
||||||
|
|
||||||
|
[ml2_type_gre]
|
||||||
|
tunnel_id_ranges = 1:1000
|
||||||
|
|
||||||
|
[ml2_type_vxlan]
|
||||||
|
vni_ranges = 1001:2000
|
||||||
|
|
||||||
|
[ml2_type_vlan]
|
||||||
|
network_vlan_ranges = {{ vlan_ranges }}
|
||||||
|
|
||||||
|
[ml2_type_flat]
|
||||||
|
flat_networks = {{ network_providers }}
|
||||||
|
|
||||||
|
[ovs]
|
||||||
|
enable_tunneling = True
|
||||||
|
local_ip = {{ local_ip }}
|
||||||
|
|
||||||
|
[agent]
|
||||||
|
tunnel_types = {{ overlay_network_type }}
|
||||||
|
|
||||||
|
[securitygroup]
|
||||||
|
{% if neutron_security_groups -%}
|
||||||
|
enable_security_group = True
|
||||||
|
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
|
||||||
|
{% else -%}
|
||||||
|
enable_security_group = False
|
||||||
|
{% endif -%}
|
@ -286,6 +286,8 @@ class NeutronCCContextTest(CharmTestCase):
|
|||||||
'quota_security_group_rule': 100,
|
'quota_security_group_rule': 100,
|
||||||
'quota_subnet': 10,
|
'quota_subnet': 10,
|
||||||
'quota_vip': 10,
|
'quota_vip': 10,
|
||||||
|
'vlan_ranges': 'physnet1:1000:2000',
|
||||||
|
'network_providers': 'physnet1',
|
||||||
}
|
}
|
||||||
napi_ctxt = context.NeutronCCContext()
|
napi_ctxt = context.NeutronCCContext()
|
||||||
with patch.object(napi_ctxt, '_ensure_packages'):
|
with patch.object(napi_ctxt, '_ensure_packages'):
|
||||||
@ -317,6 +319,8 @@ class NeutronCCContextTest(CharmTestCase):
|
|||||||
'quota_security_group_rule': 100,
|
'quota_security_group_rule': 100,
|
||||||
'quota_subnet': 10,
|
'quota_subnet': 10,
|
||||||
'quota_vip': 10,
|
'quota_vip': 10,
|
||||||
|
'vlan_ranges': 'physnet1:1000:2000',
|
||||||
|
'network_providers': 'physnet1',
|
||||||
}
|
}
|
||||||
napi_ctxt = context.NeutronCCContext()
|
napi_ctxt = context.NeutronCCContext()
|
||||||
with patch.object(napi_ctxt, '_ensure_packages'):
|
with patch.object(napi_ctxt, '_ensure_packages'):
|
||||||
@ -354,6 +358,8 @@ class NeutronCCContextTest(CharmTestCase):
|
|||||||
'quota_security_group_rule': 100,
|
'quota_security_group_rule': 100,
|
||||||
'quota_subnet': 10,
|
'quota_subnet': 10,
|
||||||
'quota_vip': 10,
|
'quota_vip': 10,
|
||||||
|
'vlan_ranges': 'physnet1:1000:2000',
|
||||||
|
'network_providers': 'physnet1',
|
||||||
}
|
}
|
||||||
napi_ctxt = context.NeutronCCContext()
|
napi_ctxt = context.NeutronCCContext()
|
||||||
with patch.object(napi_ctxt, '_ensure_packages'):
|
with patch.object(napi_ctxt, '_ensure_packages'):
|
||||||
|
Loading…
Reference in New Issue
Block a user