From c783f0851e7088ba6c763a319c9edc36de83af11 Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Thu, 24 Aug 2017 16:56:58 +0200 Subject: [PATCH] L3 Support for ODL deployments The current ODL deployment does not correctly support L3 when ODL implements the L3 logic (instead of using neutron-L3-agent) Note that the neutron_plugin_base variable is a list with the neutron plugins to be used and it is read by neutron.conf to list them. If this variable has odl-router or odl-router_v2, neutron will delegate the routing logic to ODL and will not start neutron-L3-agent. Change-Id: I819e566c192ab1a00736f0aa9d7d04939f84f66d --- doc/source/app-opendaylight.rst | 26 ++++++++++++++++++++++++- tasks/providers/opendaylight_config.yml | 8 +++++++- templates/plugins/ml2/ml2_conf.ini.j2 | 4 ++++ 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/doc/source/app-opendaylight.rst b/doc/source/app-opendaylight.rst index f8a9e741..86e0ba03 100644 --- a/doc/source/app-opendaylight.rst +++ b/doc/source/app-opendaylight.rst @@ -18,7 +18,7 @@ reading that scenario to get some background. It is also recommended to be familiar with OpenDaylight and networking-odl projects and their configuration. * `Scenario: Open vSwitch `_ - * `OpenDaylight SDN Controller `_ + * `OpenDaylight SDN Controller `_ * `Networking-odl `_ Prerequisites @@ -80,6 +80,30 @@ of feature names in the ``opendaylight_extra_features`` variable. For more information, see OpenDaylight Ansible role documentation. +L3 configuration +~~~~~~~~~~~~~~~~ + +L3 services are by default provided by the neutron-l3-agent. ODL is capable of +providing L3 services too and if ODL is deployed, it is actually recommended to +use them instead of neutron. Remember that L3 services allow, among other +things, to give VMs connectivity to the internet. + +To activate the ODL L3 services, you should add to the above explained +variables: + +.. code-block:: yaml + + # Activate the L3 capabilities of ODL + neutron_plugin_base: + - odl-router_v2 + - metering + +If you want to use the L3 capabilities, you will need to define a external +Neutron network and set a gateway. Note that the br-vlan interface of the nodes +could be a perfect interface for that gateway, although it depends on your +network topology. + + Security information ~~~~~~~~~~~~~~~~~~~~ diff --git a/tasks/providers/opendaylight_config.yml b/tasks/providers/opendaylight_config.yml index 90edba58..25b22059 100644 --- a/tasks/providers/opendaylight_config.yml +++ b/tasks/providers/opendaylight_config.yml @@ -47,7 +47,7 @@ when: ovs_manager.stdout == "" - name: Configure hosts for networking-odl, force kernel datapath - command: "{{ neutron_bin }}/neutron-odl-ovs-hostconfig --noovs_dpdk" + command: "{{ neutron_bin }}/neutron-odl-ovs-hostconfig --noovs_dpdk {% if 'odl-router' in neutron_plugin_base %}--datapath_type=system --bridge_mappings={{ neutron_provider_networks.network_mappings }}" when: ovs_manager.stdout == "" - name: Retrieve current OvS local ip @@ -59,3 +59,9 @@ - name: Set local ip for OpenvSwitch command: "ovs-vsctl set Open_vSwitch . other_config:local_ip={{ neutron_local_ip }}" when: ovs_local_ip.rc != 0 + +- name: Set the bridge mappings + command: "ovs-vsctl set Open_vSwitch . other_config:provider_mappings={{ neutron_provider_networks.network_mappings }}" + when: + - neutron_provider_networks.network_mappings is defined + - (neutron_plugin_base == 'odl-router' or neutron_plugin_base == 'odl-router_v2') diff --git a/templates/plugins/ml2/ml2_conf.ini.j2 b/templates/plugins/ml2/ml2_conf.ini.j2 index 3e33debe..a7265635 100644 --- a/templates/plugins/ml2/ml2_conf.ini.j2 +++ b/templates/plugins/ml2/ml2_conf.ini.j2 @@ -7,6 +7,10 @@ tenant_network_types = {{ neutron_provider_networks.network_types if neutron_pro mechanism_drivers = {{ neutron_ml2_mechanism_drivers }} extension_drivers = port_security{% if 'qos' in neutron_plugin_base %},qos{% endif %}{% if 'dns' in neutron_plugin_base %},dns{% endif %} +{% if neutron_plugin_type == 'ml2.opendaylight' and 'odl-router' in neutron_plugin_base %} +bridge_mappings = {{ neutron_provider_networks.network_mappings }} +{% endif %} + {% if neutron_provider_networks.network_flat_networks is defined %} # ML2 flat networks