From 30439c262c1d991a4243a66ea505dd032d4f59a2 Mon Sep 17 00:00:00 2001 From: Travis Truman Date: Wed, 22 Jun 2016 14:18:44 -0400 Subject: [PATCH] Dynamic Neutron OVS agent tunnel_types and local_ip config Both of these configs are now dynamic based on the presence of tunnel type networks in var neutron_ml2_drivers_type Change-Id: I4f03b707b0d171b14133cc9d1723458d9b1b3668 Implements: blueprint support-openvswitch --- defaults/main.yml | 14 +++++++++++--- .../dynamic_tunnel_types-3eb1aa46a0ca9a19.yaml | 12 ++++++++++++ templates/plugins/ml2/openvswitch_agent.ini.j2 | 5 +++-- 3 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 releasenotes/notes/dynamic_tunnel_types-3eb1aa46a0ca9a19.yaml diff --git a/defaults/main.yml b/defaults/main.yml index d920394f..eb033fc3 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -114,7 +114,7 @@ neutron_plugins: driver_interface: neutron.agent.linux.interface.BridgeInterfaceDriver drivers_type: "{{ neutron_ml2_drivers_type }}" l2_population: "{{ neutron_l2_population }}" - mechanisms: "linuxbridge,l2population" + mechanisms: "linuxbridge{% if neutron_l2_population | bool %},l2population{% endif %}" plugin_conf_ini_overrides: "{{ neutron_ml2_conf_ini_overrides }}" plugin_core: neutron.plugins.ml2.plugin.Ml2Plugin plugin_ini: plugins/ml2/ml2_conf.ini @@ -123,7 +123,7 @@ neutron_plugins: driver_interface: neutron.agent.linux.interface.OVSInterfaceDriver drivers_type: "{{ neutron_ml2_drivers_type }}" l2_population: "{{ neutron_l2_population }}" - mechanisms: "openvswitch,l2population" + mechanisms: "openvswitch{% if neutron_l2_population | bool %},l2population{% endif %}" plugin_conf_ini_overrides: "{{ neutron_ml2_conf_ini_overrides }}" plugin_core: neutron.plugins.ml2.plugin.Ml2Plugin plugin_ini: plugins/ml2/ml2_conf.ini @@ -344,9 +344,17 @@ neutron_l3_ha_net_cidr: 169.254.192.0/18 neutron_dhcp_config: log-facility: "/var/log/neutron/neutron-dnsmasq.log" -# Types of networks supported by the ml2 plugin +_neutron_non_tunnel_types: + - flat + - vlan + - local + +# ml2 network type drivers to load neutron_ml2_drivers_type: "flat,vlan,vxlan,local" +# Tunnel network types used by the OVS agent +neutron_tunnel_types: "{{ neutron_ml2_drivers_type.split(',') | difference(_neutron_non_tunnel_types) | join(',') }}" + # Enable or disable L2 Population. neutron_l2_population: "False" diff --git a/releasenotes/notes/dynamic_tunnel_types-3eb1aa46a0ca9a19.yaml b/releasenotes/notes/dynamic_tunnel_types-3eb1aa46a0ca9a19.yaml new file mode 100644 index 00000000..cc687316 --- /dev/null +++ b/releasenotes/notes/dynamic_tunnel_types-3eb1aa46a0ca9a19.yaml @@ -0,0 +1,12 @@ +--- +features: + - The ``os_neutron`` role now determines the default configuration for + openvswitch-agent ``tunnel_types`` and the presence or absence of + ``local_ip`` configuration based on the value of + ``neutron_ml2_drivers_type``. Deployers may directly control this + configuration by overriding the ``neutron_tunnel_types`` variable . + - The ``os_neutron`` role now configures neutron ml2 to load the + ``l2_population`` mechanism driver by default based on the value of + ``neutron_l2_population``. Deployers may directly control the neutron ml2 + mechanism drivers list by overriding the ``mechanisms`` variable in the + ``neutron_plugins`` dictionary. diff --git a/templates/plugins/ml2/openvswitch_agent.ini.j2 b/templates/plugins/ml2/openvswitch_agent.ini.j2 index 83ecb18f..6d1cff19 100644 --- a/templates/plugins/ml2/openvswitch_agent.ini.j2 +++ b/templates/plugins/ml2/openvswitch_agent.ini.j2 @@ -2,15 +2,16 @@ # Linux bridge agent physical interface mappings [ovs] +{% if neutron_tunnel_types | length > 0 %} local_ip = {{ neutron_local_ip }} +{% endif %} {% if neutron_provider_networks.network_mappings is defined %} bridge_mappings = {{ neutron_provider_networks.network_mappings }} {% endif %} [agent] l2_population = {{ neutron_plugins[neutron_plugin_type].l2_population }} -tunnel_types = gre,vxlan - +tunnel_types = {{ neutron_tunnel_types }} # Security groups [securitygroup]