From cd30202e48ceedb3119d9d17b721840c54d0eb42 Mon Sep 17 00:00:00 2001 From: Yifei Xue Date: Tue, 6 Feb 2018 11:46:09 +0800 Subject: Update the odl_sfc plugin to use the latest version JIRA: - We have upgraded odl version to nitrogen SR1. So this patch we are going to update the odl_sfc plugin to satisfy the latest odl version. Change-Id: I7342fad58c0ae21f918e27e9d72deae214c2af4e Signed-off-by: Yifei Xue --- .../roles/setup-odl-sfc/files/opendaylight.service | 2 +- plugins/odl_sfc/roles/setup-odl-sfc/files/sfc.conf | 2 +- .../roles/setup-odl-sfc/tasks/control-agents-1.yml | 2 +- .../roles/setup-odl-sfc/tasks/control-agents-2.yml | 8 ++++---- .../roles/setup-odl-sfc/tasks/control-repos-1.yml | 4 ++-- .../roles/setup-odl-sfc/tasks/control-servers-1.yml | 4 ++-- .../roles/setup-odl-sfc/tasks/control-servers-2.yml | 2 +- .../roles/setup-odl-sfc/tasks/control-servers-3.yml | 6 +++--- .../roles/setup-odl-sfc/tasks/control-tacker-1.yml | 3 +-- .../roles/setup-odl-sfc/templates/odl_pkg.sh.j2 | 19 +++++++++++++++++++ .../templates/org.apache.karaf.features.cfg | 6 +++--- plugins/odl_sfc/roles/setup-odl-sfc/vars/main.yml | 19 ++++++------------- 12 files changed, 44 insertions(+), 33 deletions(-) create mode 100755 plugins/odl_sfc/roles/setup-odl-sfc/templates/odl_pkg.sh.j2 (limited to 'plugins/odl_sfc/roles/setup-odl-sfc') diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/files/opendaylight.service b/plugins/odl_sfc/roles/setup-odl-sfc/files/opendaylight.service index a6966d82..fe125ccf 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/files/opendaylight.service +++ b/plugins/odl_sfc/roles/setup-odl-sfc/files/opendaylight.service @@ -10,7 +10,7 @@ Type=simple WorkingDirectory=/opt/opendaylight PermissionsStartOnly=true ExecStartPre= -ExecStart=/usr/lib/jvm/java-8-oracle/bin/java -Djava.security.properties=/opt/opendaylight/etc/odl.java.security -server -Xms128M -Xmx2048m -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -XX:+HeapDumpOnOutOfMemoryError -Dcom.sun.management.jmxremote -Djava.security.egd=file:/dev/./urandom -Djava.endorsed.dirs=/usr/lib/jvm/java-8-oracle/jre/lib/endorsed:/usr/lib/jvm/java-8-oracle/lib/endorsed:/opt/opendaylight/lib/endorsed -Djava.ext.dirs=/usr/lib/jvm/java-8-oracle/jre/lib/ext:/usr/lib/jvm/java-8-oracle/lib/ext:/opt/opendaylight/lib/ext -Dkaraf.instances=/opt/opendaylight/instances -Dkaraf.home=/opt/opendaylight -Dkaraf.base=/opt/opendaylight -Dkaraf.data=/opt/opendaylight/data -Dkaraf.etc=/opt/opendaylight/etc -Dkaraf.restart.jvm.supported=true -Djava.io.tmpdir=/opt/opendaylight/data/tmp -Djava.util.logging.config.file=/opt/opendaylight/etc/java.util.logging.properties -Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true -classpath /opt/opendaylight/lib/boot/org.apache.karaf.diagnostic.boot-4.0.9.jar:/opt/opendaylight/lib/boot/org.apache.karaf.jaas.boot-4.0.9.jar:/opt/opendaylight/lib/boot/org.apache.karaf.main-4.0.9.jar:/opt/opendaylight/lib/boot/org.osgi.core-6.0.0.jar org.apache.karaf.main.Main +ExecStart=/usr/lib/jvm/java-8-oracle/bin/java -Djava.security.properties=/opt/opendaylight/etc/odl.java.security -server -Xms128M -Xmx2048m -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -XX:+HeapDumpOnOutOfMemoryError -Dcom.sun.management.jmxremote -Djava.security.egd=file:/dev/./urandom -Djava.endorsed.dirs=/usr/lib/jvm/java-8-oracle/jre/lib/endorsed:/usr/lib/jvm/java-8-oracle/lib/endorsed:/opt/opendaylight/lib/endorsed -Djava.ext.dirs=/usr/lib/jvm/java-8-oracle/jre/lib/ext:/usr/lib/jvm/java-8-oracle/lib/ext:/opt/opendaylight/lib/ext -Dkaraf.instances=/opt/opendaylight/instances -Dkaraf.home=/opt/opendaylight -Dkaraf.base=/opt/opendaylight -Dkaraf.data=/opt/opendaylight/data -Dkaraf.etc=/opt/opendaylight/etc -Dkaraf.restart.jvm.supported=true -Djava.io.tmpdir=/opt/opendaylight/data/tmp -Djava.util.logging.config.file=/opt/opendaylight/etc/java.util.logging.properties -Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true -classpath /opt/opendaylight/lib/boot/org.apache.karaf.diagnostic.boot-4.0.10.jar:/opt/opendaylight/lib/boot/org.apache.karaf.jaas.boot-4.0.10.jar:/opt/opendaylight/lib/boot/org.apache.karaf.main-4.0.10.jar:/opt/opendaylight/lib/boot/org.osgi.core-6.0.0.jar org.apache.karaf.main.Main Restart=on-failure LimitNOFILE=65535 TimeoutStopSec=15 diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/files/sfc.conf b/plugins/odl_sfc/roles/setup-odl-sfc/files/sfc.conf index acf2e2f4..6621a212 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/files/sfc.conf +++ b/plugins/odl_sfc/roles/setup-odl-sfc/files/sfc.conf @@ -1,6 +1,6 @@ [DEFAULT] -service_plugins = odl-router,metering,networking_sfc.services.sfc.plugin.SfcPlugin,networking_sfc.services.flowclassifier.plugin.FlowClassifierPlugin +service_plugins = odl-router_v2,metering,trunk,networking_sfc.services.sfc.plugin.SfcPlugin,networking_sfc.services.flowclassifier.plugin.FlowClassifierPlugin [sfc] drivers = odl diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-agents-1.yml b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-agents-1.yml index 684f314c..13b4c571 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-agents-1.yml +++ b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-agents-1.yml @@ -8,7 +8,7 @@ - name: install networking-odl pip: name: networking-odl - virtualenv: /openstack/venvs/neutron-15.1.4 + virtualenv: /openstack/venvs/neutron-{{ os_ver }} - name: configure vsctl for dhcp agent shell: | diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-agents-2.yml b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-agents-2.yml index 82a26005..39b501db 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-agents-2.yml +++ b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-agents-2.yml @@ -70,7 +70,7 @@ - name: Set host OVS configurations command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-odl-ovs-hostconfig \ + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-odl-ovs-hostconfig \ --datapath_type=system --bridge_mappings={{ contr_l2_mappings }} when: - inventory_hostname not in groups['nova_compute'] @@ -78,7 +78,7 @@ - name: Set host OVS configurations command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-odl-ovs-hostconfig \ + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-odl-ovs-hostconfig \ --datapath_type=system --bridge_mappings={{ contr_l3_mappings }} when: - inventory_hostname not in groups['nova_compute'] @@ -86,14 +86,14 @@ - name: Set host OVS configurations command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-odl-ovs-hostconfig --datapath_type=system + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-odl-ovs-hostconfig --datapath_type=system when: - inventory_hostname in groups['nova_compute'] - odl_l3_agent == "Disable" - name: Set host OVS configurations command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-odl-ovs-hostconfig + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-odl-ovs-hostconfig --datapath_type=system --bridge_mappings={{ compu_l3_mappings }} when: - inventory_hostname in groups['nova_compute'] diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-repos-1.yml b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-repos-1.yml index 7b699a35..0eacde6e 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-repos-1.yml +++ b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-repos-1.yml @@ -1,7 +1,7 @@ --- - name: copy download script - copy: - src: odl_pkg.sh + template: + src: odl_pkg.sh.j2 dest: /opt/odl_pkg.sh mode: 0777 diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-1.yml b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-1.yml index 40149346..0269bb37 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-1.yml +++ b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-1.yml @@ -8,12 +8,12 @@ - name: install networking-odl pip: name: networking-odl - virtualenv: /openstack/venvs/neutron-15.1.4 # Todo: hardcode, need to modify + virtualenv: /openstack/venvs/neutron-{{ os_ver }} - name: install networking-sfc pip: name: networking-sfc - virtualenv: /openstack/venvs/neutron-15.1.4 + virtualenv: /openstack/venvs/neutron-{{ os_ver }} when: odl_sfc == "Enable" - name: turn off neutron-server on control node diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-2.yml b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-2.yml index d8bcf154..be45567a 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-2.yml +++ b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-2.yml @@ -3,7 +3,7 @@ - name: configure odl l3 driver shell: | crudini --set /etc/neutron/neutron.conf DEFAULT service_plugins \ - odl-router,metering; + odl-router_v2,metering,trunk; when: odl_l3_agent == "Enable" - name: configure opendaylight -> ml2 diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-3.yml b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-3.yml index 0c11e36f..c4451ca2 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-3.yml +++ b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-3.yml @@ -2,7 +2,7 @@ - name: Perform a Neutron DB online upgrade command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade --expand @@ -11,7 +11,7 @@ - name: Perform a Neutron DB offline upgrade command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade --contract @@ -20,7 +20,7 @@ - name: SFC DB upgrade command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-db-manage --subproject networking-sfc upgrade head become: "yes" diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-tacker-1.yml b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-tacker-1.yml index c43b6dcc..8fd1109f 100644 --- a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-tacker-1.yml +++ b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-tacker-1.yml @@ -3,6 +3,5 @@ - name: upgrade networking-sfc pip: name: networking-sfc - extra_args: -U - virtualenv: /openstack/venvs/tacker-15.1.4 + virtualenv: /openstack/venvs/tacker-{{ os_ver }} when: odl_sfc == "Enable" diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/templates/odl_pkg.sh.j2 b/plugins/odl_sfc/roles/setup-odl-sfc/templates/odl_pkg.sh.j2 new file mode 100755 index 00000000..f8882b23 --- /dev/null +++ b/plugins/odl_sfc/roles/setup-odl-sfc/templates/odl_pkg.sh.j2 @@ -0,0 +1,19 @@ +#!/bin/bash + +rm -rf /home/networking +rm -rf /home/tmp + +mkdir -p /home/networking +mkdir -p /home/tmp + +cd /home/networking + +git clone https://github.com/openstack/networking-odl.git -b stable/{{ os_name }} +git clone https://github.com/openstack/networking-sfc.git -b stable/{{ os_name }} + +pip wheel /home/networking/networking-odl/ -w /home/tmp/ +pip wheel /home/networking/networking-sfc/ -w /home/tmp/ + +cp /home/tmp/networking* /var/www/repo/os-releases/{{ os_ver }}/ubuntu-16.04-x86_64/ + +sleep 30 diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/templates/org.apache.karaf.features.cfg b/plugins/odl_sfc/roles/setup-odl-sfc/templates/org.apache.karaf.features.cfg index afb7e6b5..05f7a7cd 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/templates/org.apache.karaf.features.cfg +++ b/plugins/odl_sfc/roles/setup-odl-sfc/templates/org.apache.karaf.features.cfg @@ -37,9 +37,9 @@ # Comma separated list of features repositories to register by default # featuresRepositories = \ - mvn:org.opendaylight.integration/features-index/0.7.0/xml/features, \ - mvn:org.apache.karaf.features/framework/4.0.9/xml/features, \ - mvn:org.apache.karaf.features/standard/4.0.9/xml/features + mvn:org.opendaylight.integration/features-index/0.7.1/xml/features, \ + mvn:org.apache.karaf.features/framework/4.0.10/xml/features, \ + mvn:org.apache.karaf.features/standard/4.0.10/xml/features # # Comma separated list of features to install at startup diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/vars/main.yml b/plugins/odl_sfc/roles/setup-odl-sfc/vars/main.yml index b3d71edb..014fc5b8 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/vars/main.yml +++ b/plugins/odl_sfc/roles/setup-odl-sfc/vars/main.yml @@ -9,6 +9,9 @@ --- openstack_passwd_file: /etc/openstack_deploy/user_secrets.yml +os_ver: 16.0.5 +os_name: pike + odl_username: admin odl_password: admin odl_api_port: 8181 @@ -18,8 +21,8 @@ sfc_plugins: src: sfc.conf dst: /opt/sfc.conf -odl_pkg_url: karaf-0.7.0.tar.gz -odl_pkg_name: karaf-0.7.0.tar.gz +odl_pkg_url: karaf-0.7.1.tar.gz +odl_pkg_name: karaf-0.7.1.tar.gz odl_home: "/opt/opendaylight/" odl_base_features: - config @@ -49,19 +52,9 @@ odl_extra_features: odl_features: "{{ odl_base_features + odl_extra_features }}" -sdn_package: http://artifacts.opnfv.org/compass4nfv/packages/master/sdn_package.tar.gz - -# yamllint disable rule:line-length -networking_odl_url: https://launchpad.net/networking-odl/4.0-ocata/4.0.0/+download/networking-odl-4.0.0.tar.gz -# yamllint enable rule:line-length +sdn_package: http://artifacts.opnfv.org/compass4nfv/package/master/sdn_package.tar.gz jdk8_pkg_name: jdk-8u51-linux-x64.tar.gz jdk8_script_name: install_jdk8.tar common_packages_noarch: [] - -odl_pip: networking-odl-3.2.0 - -networking_odl_version: 4.0.0 - -networking_odl_pkg_name: networking-odl-3.2.0.tar.gz -- cgit 1.2.3-korg