From 491e501b062a35722ac8eaa0cc9ef317fd556583 Mon Sep 17 00:00:00 2001 From: Tytus Kurek Date: Fri, 16 Dec 2016 17:45:11 +0100 Subject: [PATCH] Add basic support for "global_physnet_mtu" and "path_mtu" options. I've added basic support for "global_physnet_mtu" and "path_mtu" options by allowing to configure them via charm parameters. Change-Id: Ia95533418ccd4b7d1b96270633193ea34b1edecb Partial-Bug: 1650579 --- config.yaml | 24 ++++++++++++++ hooks/neutron_api_context.py | 8 +++++ templates/mitaka/ml2_conf.ini | 59 +++++++++++++++++++++++++++++++++++ templates/mitaka/neutron.conf | 4 +++ 4 files changed, 95 insertions(+) create mode 100644 templates/mitaka/ml2_conf.ini diff --git a/config.yaml b/config.yaml index c9615b3d..3f3702e5 100755 --- a/config.yaml +++ b/config.yaml @@ -118,6 +118,10 @@ options: The MTU size for interfaces managed by neutron. If unset or set to 0, no value will be applied. This value will be provided to neutron-plugin-api relations. + . + NOTE: This option is deprecated and will be removed in Newton. + Please use the system-wide global-physnet-mtu setting which the + agents will take into account when wiring VIFs. neutron-plugin: default: ovs type: string @@ -623,3 +627,23 @@ options: default: description: | The default type for a tenant network e.g. vxlan, vlan, gre etc + global-physnet-mtu: + type: int + default: 1500 + description: | + MTU of the underlying physical network. Neutron uses this value to + calculate MTU for all virtual network components. For flat and + VLAN networks, neutron uses this value without modification. For + overlay networks such as VXLAN, neutron automatically subtracts + the overlay protocol overhead from this value. + . + NOTE: This options is available starting from Mitaka release. + path-mtu: + type: int + default: + description: | + Maximum size of an IP packet (MTU) that can traverse the + underlying physical network infrastructure without fragmentation + when using an overlay/tunnel protocol. This option allows + specifying a physical network MTU value that differs from the + default global-physnet-mtu value. diff --git a/hooks/neutron_api_context.py b/hooks/neutron_api_context.py index dcfedc3b..503f07ae 100644 --- a/hooks/neutron_api_context.py +++ b/hooks/neutron_api_context.py @@ -300,6 +300,14 @@ class NeutronCCContext(context.NeutronContext): else: ctxt['enable_hyperv'] = False + if release >= 'mitaka': + if config('global-physnet-mtu'): + ctxt['global_physnet_mtu'] = config('global-physnet-mtu') + if config('path-mtu'): + ctxt['path_mtu'] = config('path-mtu') + else: + ctxt['path_mtu'] = config('global-physnet-mtu') + return ctxt diff --git a/templates/mitaka/ml2_conf.ini b/templates/mitaka/ml2_conf.ini new file mode 100644 index 00000000..022b1723 --- /dev/null +++ b/templates/mitaka/ml2_conf.ini @@ -0,0 +1,59 @@ +# mitaka +############################################################################### +# [ WARNING ] +# Configuration file maintained by Juju. Local changes may be overwritten. +############################################################################### +[ml2] +{% if enable_ml2_port_security -%} +extension_drivers=port_security +{% endif -%} + +{% if neutron_plugin == 'Calico' -%} +type_drivers = local,flat +mechanism_drivers = calico +{% else -%} +type_drivers = {{ tenant_network_types }} +tenant_network_types = {{ tenant_network_types }} +{% if enable_sriov %} +mechanism_drivers = openvswitch,l2population,sriovnicswitch +{% elif enable_hyperv %} +mechanism_drivers = openvswitch,hyperv,l2population +{% else %} +mechanism_drivers = openvswitch,l2population +{% endif %} + +{% if path_mtu -%} +path_mtu = {{ path_mtu }} +{% endif -%} + +[ml2_type_gre] +tunnel_id_ranges = 1:1000 + +[ml2_type_vxlan] +vni_ranges = {{ vni_ranges }} + +[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 }} +{% endif -%} + +[securitygroup] +{% if neutron_security_groups -%} +enable_security_group = True +{% if neutron_plugin == 'Calico' -%} +firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver +{% else -%} +firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver +{% endif -%} +{% else -%} +enable_security_group = False +{% endif -%} diff --git a/templates/mitaka/neutron.conf b/templates/mitaka/neutron.conf index 7b12197b..72e9bd24 100644 --- a/templates/mitaka/neutron.conf +++ b/templates/mitaka/neutron.conf @@ -71,6 +71,10 @@ notify_nova_on_port_data_changes = True {% include "section-zeromq" %} +{% if global_physnet_mtu -%} +global_physnet_mtu = {{ global_physnet_mtu }} +{% endif -%} + [quotas] {% if quota_driver -%} quota_driver = {{ quota_driver }}