Add dvr support
This commit is contained in:
@@ -213,3 +213,8 @@ options:
|
||||
juju-myservice-0
|
||||
If you're running multiple environments with the same services in them
|
||||
this allows you to differentiate between them.
|
||||
enable-dvr:
|
||||
default: False
|
||||
type: boolean
|
||||
description: |
|
||||
Enable Distributed Virtual Routing (juno and above).
|
||||
|
||||
@@ -3,12 +3,16 @@ from charmhelpers.core.hookenv import (
|
||||
relation_ids,
|
||||
related_units,
|
||||
relation_get,
|
||||
log,
|
||||
)
|
||||
from charmhelpers.contrib.openstack import context
|
||||
from charmhelpers.contrib.hahelpers.cluster import (
|
||||
determine_api_port,
|
||||
determine_apache_port,
|
||||
)
|
||||
from charmhelpers.contrib.openstack.utils import (
|
||||
os_release,
|
||||
)
|
||||
|
||||
|
||||
def get_l2population():
|
||||
@@ -23,6 +27,23 @@ def get_overlay_network_type():
|
||||
return overlay_net
|
||||
|
||||
|
||||
def get_dvr():
|
||||
if config('enable-dvr'):
|
||||
if os_release('neutron-server') < 'juno':
|
||||
log('Disabling DVR, enable_dvr is not valid before Juno')
|
||||
return False
|
||||
if config('overlay-network-type') != 'vxlan':
|
||||
log('Disabling DVR, enable_dvr requires the use of the vxlan'
|
||||
'overlay network')
|
||||
return False
|
||||
if not get_l2population():
|
||||
log('Disabling DVR, l2-population must be enabled to use dvr')
|
||||
return False
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
class ApacheSSLContext(context.ApacheSSLContext):
|
||||
|
||||
interfaces = ['https']
|
||||
@@ -69,6 +90,10 @@ class NeutronCCContext(context.NeutronContext):
|
||||
def neutron_overlay_network_type(self):
|
||||
return get_overlay_network_type()
|
||||
|
||||
@property
|
||||
def neutron_dvr(self):
|
||||
return get_dvr()
|
||||
|
||||
# Do not need the plugin agent installed on the api server
|
||||
def _ensure_packages(self):
|
||||
pass
|
||||
@@ -91,6 +116,7 @@ class NeutronCCContext(context.NeutronContext):
|
||||
ctxt['nsx_controllers_list'] = \
|
||||
config('nsx-controllers').split()
|
||||
ctxt['l2_population'] = self.neutron_l2_population
|
||||
ctxt['enable_dvr'] = self.neutron_dvr
|
||||
ctxt['overlay_network_type'] = self.neutron_overlay_network_type
|
||||
ctxt['external_network'] = config('neutron-external-network')
|
||||
ctxt['verbose'] = config('verbose')
|
||||
|
||||
@@ -49,6 +49,7 @@ from neutron_api_utils import (
|
||||
setup_ipv6
|
||||
)
|
||||
from neutron_api_context import (
|
||||
get_dvr,
|
||||
get_l2population,
|
||||
get_overlay_network_type,
|
||||
)
|
||||
@@ -281,6 +282,7 @@ def neutron_plugin_api_relation_joined(rid=None):
|
||||
relation_data = {
|
||||
'neutron-security-groups': config('neutron-security-groups'),
|
||||
'l2-population': get_l2population(),
|
||||
'enable-dvr': get_dvr(),
|
||||
'overlay-network-type': get_overlay_network_type(),
|
||||
}
|
||||
relation_set(relation_id=rid, **relation_data)
|
||||
|
||||
79
templates/juno/neutron.conf
Normal file
79
templates/juno/neutron.conf
Normal file
@@ -0,0 +1,79 @@
|
||||
###############################################################################
|
||||
# [ WARNING ]
|
||||
# Configuration file maintained by Juju. Local changes may be overwritten.
|
||||
## Restart trigger {{ restart_trigger }}
|
||||
###############################################################################
|
||||
[DEFAULT]
|
||||
verbose = {{ verbose }}
|
||||
debug = {{ debug }}
|
||||
use_syslog = {{ use_syslog }}
|
||||
state_path = /var/lib/neutron
|
||||
lock_path = $state_path/lock
|
||||
bind_host = {{ bind_host }}
|
||||
auth_strategy = keystone
|
||||
notification_driver = neutron.openstack.common.notifier.rpc_notifier
|
||||
api_workers = {{ workers }}
|
||||
rpc_workers = {{ workers }}
|
||||
|
||||
router_distributed = {{ enable_dvr }}
|
||||
|
||||
{% if neutron_bind_port -%}
|
||||
bind_port = {{ neutron_bind_port }}
|
||||
{% else -%}
|
||||
bind_port = 9696
|
||||
{% endif -%}
|
||||
|
||||
{% if core_plugin -%}
|
||||
core_plugin = {{ core_plugin }}
|
||||
{% if neutron_plugin in ['ovs', 'ml2'] -%}
|
||||
service_plugins = neutron.services.l3_router.l3_router_plugin.L3RouterPlugin,neutron.services.firewall.fwaas_plugin.FirewallPlugin,neutron.services.loadbalancer.plugin.LoadBalancerPlugin,neutron.services.vpn.plugin.VPNDriverPlugin,neutron.services.metering.metering_plugin.MeteringPlugin
|
||||
{% endif -%}
|
||||
{% endif -%}
|
||||
|
||||
{% if neutron_security_groups -%}
|
||||
allow_overlapping_ips = True
|
||||
neutron_firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
|
||||
{% endif -%}
|
||||
|
||||
{% include "parts/rabbitmq" %}
|
||||
|
||||
notify_nova_on_port_status_changes = True
|
||||
notify_nova_on_port_data_changes = True
|
||||
nova_url = {{ nova_url }}
|
||||
nova_region_name = {{ region }}
|
||||
{% if auth_host -%}
|
||||
nova_admin_username = {{ admin_user }}
|
||||
nova_admin_tenant_id = {{ admin_tenant_id }}
|
||||
nova_admin_password = {{ admin_password }}
|
||||
nova_admin_auth_url = {{ auth_protocol }}://{{ auth_host }}:{{ auth_port }}/v2.0
|
||||
{% endif -%}
|
||||
|
||||
[quotas]
|
||||
quota_driver = neutron.db.quota_db.DbQuotaDriver
|
||||
{% if neutron_security_groups -%}
|
||||
quota_items = network,subnet,port,security_group,security_group_rule
|
||||
{% endif -%}
|
||||
|
||||
[agent]
|
||||
root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
|
||||
|
||||
[keystone_authtoken]
|
||||
signing_dir = /var/lib/neutron/keystone-signing
|
||||
{% if service_host -%}
|
||||
service_protocol = {{ service_protocol }}
|
||||
service_host = {{ service_host }}
|
||||
service_port = {{ service_port }}
|
||||
auth_host = {{ auth_host }}
|
||||
auth_port = {{ auth_port }}
|
||||
auth_protocol = {{ auth_protocol }}
|
||||
admin_tenant_name = {{ admin_tenant_name }}
|
||||
admin_user = {{ admin_user }}
|
||||
admin_password = {{ admin_password }}
|
||||
{% endif -%}
|
||||
|
||||
{% include "parts/section-database" %}
|
||||
|
||||
[service_providers]
|
||||
service_provider=LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
|
||||
service_provider=VPN:openswan:neutron.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default
|
||||
service_provider=FIREWALL:Iptables:neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver:default
|
||||
Reference in New Issue
Block a user