From db404dc4c880430d2a173dbe6cb65ad0eb4cc62b Mon Sep 17 00:00:00 2001 From: Dimitrios Markou Date: Thu, 2 Nov 2017 12:28:50 +0200 Subject: [PATCH] Add OvS-NSH support To be able to perform SFC through NSH protocol special Openvswitch packages are needed. Blueprint: https://review.openstack.org/#/c/476121/ Change-Id: Id0e22067ac5d2a33aa2150dd65ac3fb9ae7c7542 Signed-off-by: Dimitrios Markou --- defaults/main.yml | 6 ++++ meta/main.yml | 5 ++- ...nvswitch-nsh-support-a9f86a929e072cea.yaml | 6 ++++ tests/neutron-overrides-ovs-nsh.yml | 36 +++++++++++++++++++ tox.ini | 11 ++++++ vars/main.yml | 6 ++++ vars/ubuntu-16.04.yml | 5 +++ zuul.d/jobs.yaml | 7 ++++ zuul.d/project.yaml | 1 + 9 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/openvswitch-nsh-support-a9f86a929e072cea.yaml create mode 100644 tests/neutron-overrides-ovs-nsh.yml diff --git a/defaults/main.yml b/defaults/main.yml index ea8aab9c..514105fb 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -394,3 +394,9 @@ dragonflow_ex_peer_patch_port: patch-int dragonflow_int_peer_patch_port: patch-ex dragonflow_external_network_bridge: br-ex dragonflow_publisher_bind_address: "*" + +# Install Openvswitch without NSH support +ovs_nsh_support: False + +# Set higher priority to mardim PPA when ovs_nsh_support is True +ovs_nsh_apt_pinned_packages: [{ package: "*", release: "LP-PPA-mardim-mardim-ppa"}] diff --git a/meta/main.yml b/meta/main.yml index 4e35a31c..e5edca91 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -39,7 +39,10 @@ galaxy_info: - openstack dependencies: - pip_install - - apt_package_pinning + - role: apt_package_pinning + apt_pinned_packages: "{{ ovs_nsh_support | ternary(ovs_nsh_apt_pinned_packages, omit) }}" + when: + - ansible_pkg_mgr == 'apt' - galera_client - openstack_openrc - role: etcd diff --git a/releasenotes/notes/openvswitch-nsh-support-a9f86a929e072cea.yaml b/releasenotes/notes/openvswitch-nsh-support-a9f86a929e072cea.yaml new file mode 100644 index 00000000..9a1749cd --- /dev/null +++ b/releasenotes/notes/openvswitch-nsh-support-a9f86a929e072cea.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Open vSwitch dataplane with NSH support has been implemented. + This feature may be activated by setting ``ovs_nsh_support: True`` + in ``/etc/openstack_deploy/user_variables.yml``. diff --git a/tests/neutron-overrides-ovs-nsh.yml b/tests/neutron-overrides-ovs-nsh.yml new file mode 100644 index 00000000..f7e6a22e --- /dev/null +++ b/tests/neutron-overrides-ovs-nsh.yml @@ -0,0 +1,36 @@ +--- +# 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 }}:8080/controller/nb/v2/neutron" + username: admin + password: admin + +tempest_run: yes + +tempest_plugins: + - name: neutron + repo: https://git.openstack.org/openstack/neutron + branch: master + +tempest_test_whitelist: + - neutron.tests.tempest.api.test_networks* diff --git a/tox.ini b/tox.ini index 410f1f7e..307dc328 100644 --- a/tox.ini +++ b/tox.ini @@ -159,6 +159,17 @@ commands = bash -c "{toxinidir}/tests/tests-repo-clone.sh" bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" +[testenv:ovs-nsh] +deps = + {[testenv:ansible]deps} +setenv = + {[testenv]setenv} + ANSIBLE_INVENTORY={toxinidir}/tests/opendaylight_inventory + ANSIBLE_OVERRIDES={toxinidir}/tests/neutron-overrides-ovs-nsh.yml +commands = + bash -c "{toxinidir}/tests/tests-repo-clone.sh" + bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" + [testenv:linters] deps = {[testenv:ansible]deps} diff --git a/vars/main.yml b/vars/main.yml index 4a594993..c588a81b 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -28,8 +28,12 @@ neutron_package_list: |- or (neutron_services['dragonflow-controller-agent']['group'] in group_names and neutron_services['dragonflow-controller-agent'].service_en | bool) or (neutron_services['dragonflow-l3-agent']['group'] in group_names and neutron_services['dragonflow-l3-agent'].service_en | bool) or ((neutron_services['neutron-server']['group'] not in group_names) and neutron_plugin_type == 'ml2.opendaylight') %} + {% if (ovs_nsh_support and ansible_distribution == 'Ubuntu') %} + {% set _ = packages.extend(neutron_ovs_nsh_required_packages) %} + {% else %} {% set _ = packages.extend(neutron_ovs_distro_packages) %} {% endif %} + {% endif %} {% if neutron_services['neutron-linuxbridge-agent']['group'] in group_names and neutron_services['neutron-linuxbridge-agent'].service_en | bool %} {% set _ = packages.extend(neutron_lxb_distro_packages) %} {% endif %} @@ -44,6 +48,8 @@ neutron_package_list: |- {% endif %} {{ packages }} +neutron_ovs_nsh_distro_packages: [] + # Set the Calico Felix agent executable destination path calico_felix_bin: /usr/local/bin/calico-felix diff --git a/vars/ubuntu-16.04.yml b/vars/ubuntu-16.04.yml index d89dff3c..b7a34910 100644 --- a/vars/ubuntu-16.04.yml +++ b/vars/ubuntu-16.04.yml @@ -21,6 +21,11 @@ neutron_ovs_distro_packages: neutron_ovs_service_name: openvswitch-switch +neutron_ovs_nsh_required_packages: + - openvswitch-common + - openvswitch-switch + - python-openvswitch + ## APT Cache options cache_timeout: 600 diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index b8ad2ba8..87de4032 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -40,3 +40,10 @@ voting: false vars: tox_env: opendaylight + +- job: + name: openstack-ansible-ovs-nsh-ubuntu-xenial + parent: openstack-ansible-functional-ubuntu-xenial + voting: false + vars: + tox_env: ovs-nsh diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index c7cb0056..a5a639a0 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -26,6 +26,7 @@ - openstack-ansible-calico-ubuntu-xenial-nv - openstack-ansible-dragonflow-ubuntu-xenial-nv - openstack-ansible-opendaylight-ubuntu-xenial-nv + - openstack-ansible-ovs-nsh-ubuntu-xenial gate: jobs: - openstack-ansible-linters