From 5818eafe60d4fe6b080280b8ce16884ee57f49bb Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Tue, 10 Oct 2017 17:11:00 +0200 Subject: [PATCH] Provide support for SFC deployments This patch allows to deploy SFC capable deployments when deploying OSA with ODL. It does the following: - Installs the neutron networking-sfc project - Adds SFC to the features which ODL activates - Incorporates SFC options to neutron.conf In order to use it, you need to have ODL running and you should add the next items to the neutron_plugin_base when executing it: networking_sfc.services.flowclassifier.plugin.FlowClassifierPlugin networking_sfc.services.sfc.plugin.SfcPlugin Depends-On: I49c01fb63054e45bae5ae45a89cce986579959de Change-Id: I6bf2be1aef1bb612640f5d8cc101136f618fabd8 --- defaults/main.yml | 2 ++ doc/source/app-opendaylight.rst | 18 ++++++++++ tasks/providers/opendaylight_config.yml | 11 +++++- templates/neutron.conf.j2 | 9 +++++ tests/neutron-overrides-odl-sfc.yml | 45 +++++++++++++++++++++++++ tox.ini | 12 +++++++ vars/main.yml | 12 ++++++- zuul.d/jobs.yaml | 8 +++++ zuul.d/project.yaml | 1 + 9 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 tests/neutron-overrides-odl-sfc.yml diff --git a/defaults/main.yml b/defaults/main.yml index 4d1724d1..554d3790 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -52,6 +52,8 @@ dragonflow_git_repo: https://git.openstack.org/openstack/dragonflow dragonflow_git_install_branch: master networking_odl_git_repo: https://git.openstack.org/openstack/networking-odl networking_odl_git_install_branch: master +networking_sfc_git_repo: https://git.openstack.org/openstack/networking-sfc +networking_sfc_git_install_branch: master # Developer mode neutron_developer_mode: false diff --git a/doc/source/app-opendaylight.rst b/doc/source/app-opendaylight.rst index de18210b..f8866227 100644 --- a/doc/source/app-opendaylight.rst +++ b/doc/source/app-opendaylight.rst @@ -103,6 +103,24 @@ 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. +SFC configuration +~~~~~~~~~~~~~~~~~ + +It is possible to have an openstack-ansible deployment with SFC capabilities. +The following config needs to be added to the above described +``/etc/openstack_deploy/user_variables.yml`` : + +.. code-block:: yaml + + neutron_plugin_base: + - router + - metering + - networking_sfc.services.flowclassifier.plugin.FlowClassifierPlugin + - networking_sfc.services.sfc.plugin.SfcPlugin + +When using this configuration, networking-sfc will be deployed and SFC features +will be activated in ODL. A SFC topology could be then set up through the +networking-sfc API or through an orchestrator like tacker (if deployed). Security information ~~~~~~~~~~~~~~~~~~~~ diff --git a/tasks/providers/opendaylight_config.yml b/tasks/providers/opendaylight_config.yml index eab3d4dc..fb5faec6 100644 --- a/tasks/providers/opendaylight_config.yml +++ b/tasks/providers/opendaylight_config.yml @@ -13,9 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. +- name: Set the packages to install + set_fact: + neutron_optional_combined_pip_packages: |- + {% set packages = neutron_optional_opendaylight_pip_packages %} + {% if 'networking_sfc.services.sfc.plugin.SfcPlugin' in neutron_plugin_base %} + {% set _ = packages.extend(neutron_optional_opendaylight_sfc_pip_packages) %} + {% endif %} + {{ packages }} + - name: Install OpenDaylight pip packages pip: - name: "{{ neutron_optional_opendaylight_pip_packages }}" + name: "{{ neutron_optional_combined_pip_packages }}" state: "{{ neutron_pip_package_state }}" virtualenv: "{{ neutron_bin | dirname }}" virtualenv_site_packages: "no" diff --git a/templates/neutron.conf.j2 b/templates/neutron.conf.j2 index 836c3943..2cb3bfaf 100644 --- a/templates/neutron.conf.j2 +++ b/templates/neutron.conf.j2 @@ -271,3 +271,12 @@ transport_url = rabbit://{% for host in neutron_rabbitmq_telemetry_servers.split # Concurrency (locking mechanisms) [oslo_concurrency] lock_path = {{ neutron_lock_path }} + +{% if neutron_services['neutron-server']['group'] in group_names and 'networking_sfc.services.sfc.plugin.SfcPlugin' in neutron_plugin_base %} +# ODL-SFC +[sfc] +drivers = odl + +[flowclassifier] +drivers = odl +{% endif %} diff --git a/tests/neutron-overrides-odl-sfc.yml b/tests/neutron-overrides-odl-sfc.yml new file mode 100644 index 00000000..ec0958e0 --- /dev/null +++ b/tests/neutron-overrides-odl-sfc.yml @@ -0,0 +1,45 @@ +--- +# Copyright 2017, Intracom-Telecom +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +### Use OvS with NSH support +ovs_nsh_support: True + +### Use OpenDaylight SDN Controller +neutron_plugin_type: "ml2.opendaylight" +odl_ip: "{{ hostvars[groups['opendaylight'][0]]['ansible_default_ipv4']['address'] }}" +neutron_opendaylight_conf_ini_overrides: + ml2_odl: + url: "http://{{ odl_ip }}:8180/controller/nb/v2/neutron" + username: admin + password: admin + +neutron_plugin_base: + - router + - metering + - networking_sfc.services.flowclassifier.plugin.FlowClassifierPlugin + - networking_sfc.services.sfc.plugin.SfcPlugin + +tempest_run: yes + +tempest_plugins: + - name: neutron + repo: https://git.openstack.org/openstack/neutron + branch: master + - name: neutron-plugins + repo: https://git.openstack.org/openstack/neutron-tempest-plugin + branch: master + +tempest_test_whitelist: + - "neutron_tempest_plugin.api.test_networks*" diff --git a/tox.ini b/tox.ini index b7d32d9f..7d8da2c5 100644 --- a/tox.ini +++ b/tox.ini @@ -171,6 +171,18 @@ commands = bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" +[testenv:odl-sfc] +deps = + {[testenv:ansible]deps} +setenv = + {[testenv]setenv} + ANSIBLE_INVENTORY={toxinidir}/tests/opendaylight_inventory + ANSIBLE_OVERRIDES={toxinidir}/tests/neutron-overrides-odl-sfc.yml +commands = + bash -c "{toxinidir}/tests/tests-repo-clone.sh" + bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" + + [testenv:ssl] deps = {[testenv:ansible]deps} diff --git a/vars/main.yml b/vars/main.yml index 6881abce..e2154863 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -100,6 +100,9 @@ neutron_optional_dragonflow_pip_packages: neutron_optional_opendaylight_pip_packages: - networking-odl +neutron_optional_opendaylight_sfc_pip_packages: + - networking-sfc + neutron_proprietary_nuage_pip_packages: - nuage-openstack-neutron - nuage-openstack-neutronclient @@ -114,6 +117,7 @@ neutron_developer_constraints: - "git+{{ networking_calico_git_repo }}@{{ networking_calico_git_install_branch }}#egg=networking-calico" - "git+{{ dragonflow_git_repo }}@{{ dragonflow_git_install_branch }}#egg=dragonflow" - "git+{{ networking_odl_git_repo }}@{{ networking_odl_git_install_branch }}#egg=networking-odl" + - "git+{{ networking_sfc_git_repo }}@{{ networking_sfc_git_install_branch }}#egg=networking-sfc" neutron_bin: "/openstack/venvs/neutron-{{ neutron_venv_tag }}/bin" @@ -242,7 +246,13 @@ _neutron_non_tunnel_types: neutron_tunnel_types: "{{ neutron_ml2_drivers_type.split(',') | difference(_neutron_non_tunnel_types) | join(',') }}" # OpenDaylight -opendaylight_extra_features: ['odl-netvirt-openstack'] +opendaylight_extra_features: |- + {%- set features = ['odl-netvirt-openstack'] -%} + {%- if 'networking_sfc.services.sfc.plugin.SfcPlugin' in neutron_plugin_base -%} + {%- set features = ['odl-netvirt-sfc'] -%} + {%- endif -%} + {{ features }} + opendaylight_install_method: "{{ (ansible_os_family=='Debian') | ternary('deb_repo', 'rpm_repo') }}" ovs_manager_list: |- diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index c123a75e..86046320 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -54,3 +54,11 @@ voting: false vars: tox_env: ssl + + +- job: + name: openstack-ansible-odl-sfc-ubuntu-xenial + parent: openstack-ansible-functional-ubuntu-xenial + voting: false + vars: + tox_env: odl-sfc diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index c287023d..33d662da 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -28,6 +28,7 @@ - openstack-ansible-opendaylight-ubuntu-xenial-nv - openstack-ansible-ovs-nsh-ubuntu-xenial - openstack-ansible-neutron-ssl-nv + - openstack-ansible-odl-sfc-ubuntu-xenial experimental: jobs: - openstack-ansible-integrated-deploy-aio