| ... | ... |
@@ -163,7 +163,6 @@ Scripts |
| 163 | 163 |
* `lib/ldap <lib/ldap.html>`__ |
| 164 | 164 |
* `lib/neutron <lib/neutron.html>`__ |
| 165 | 165 |
* `lib/nova <lib/nova.html>`__ |
| 166 |
-* `lib/opendaylight <lib/opendaylight.html>`__ |
|
| 167 | 166 |
* `lib/oslo <lib/oslo.html>`__ |
| 168 | 167 |
* `lib/rpc\_backend <lib/rpc_backend.html>`__ |
| 169 | 168 |
* `lib/sahara <lib/sahara.html>`__ |
| ... | ... |
@@ -183,7 +182,6 @@ Scripts |
| 183 | 183 |
* `extras.d/70-trove.sh <extras.d/70-trove.sh.html>`__ |
| 184 | 184 |
* `extras.d/70-tuskar.sh <extras.d/70-tuskar.sh.html>`__ |
| 185 | 185 |
* `extras.d/70-zaqar.sh <extras.d/70-zaqar.sh.html>`__ |
| 186 |
-* `extras.d/80-opendaylight.sh <extras.d/80-opendaylight.sh.html>`__ |
|
| 187 | 186 |
* `extras.d/80-tempest.sh <extras.d/80-tempest.sh.html>`__ |
| 188 | 187 |
|
| 189 | 188 |
Configuration |
| 190 | 189 |
deleted file mode 100644 |
| ... | ... |
@@ -1,76 +0,0 @@ |
| 1 |
-# opendaylight.sh - DevStack extras script |
|
| 2 |
- |
|
| 3 |
-if is_service_enabled odl-server odl-compute; then |
|
| 4 |
- # Initial source |
|
| 5 |
- [[ "$1" == "source" ]] && source $TOP_DIR/lib/opendaylight |
|
| 6 |
-fi |
|
| 7 |
- |
|
| 8 |
-if is_service_enabled odl-server; then |
|
| 9 |
- if [[ "$1" == "source" ]]; then |
|
| 10 |
- # no-op |
|
| 11 |
- : |
|
| 12 |
- elif [[ "$1" == "stack" && "$2" == "install" ]]; then |
|
| 13 |
- install_opendaylight |
|
| 14 |
- configure_opendaylight |
|
| 15 |
- init_opendaylight |
|
| 16 |
- elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then |
|
| 17 |
- configure_ml2_odl |
|
| 18 |
- # This has to start before Neutron |
|
| 19 |
- start_opendaylight |
|
| 20 |
- elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then |
|
| 21 |
- # no-op |
|
| 22 |
- : |
|
| 23 |
- fi |
|
| 24 |
- |
|
| 25 |
- if [[ "$1" == "unstack" ]]; then |
|
| 26 |
- stop_opendaylight |
|
| 27 |
- cleanup_opendaylight |
|
| 28 |
- fi |
|
| 29 |
- |
|
| 30 |
- if [[ "$1" == "clean" ]]; then |
|
| 31 |
- # no-op |
|
| 32 |
- : |
|
| 33 |
- fi |
|
| 34 |
-fi |
|
| 35 |
- |
|
| 36 |
-if is_service_enabled odl-compute; then |
|
| 37 |
- if [[ "$1" == "source" ]]; then |
|
| 38 |
- # no-op |
|
| 39 |
- : |
|
| 40 |
- elif [[ "$1" == "stack" && "$2" == "install" ]]; then |
|
| 41 |
- install_opendaylight-compute |
|
| 42 |
- elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then |
|
| 43 |
- if is_service_enabled nova; then |
|
| 44 |
- create_nova_conf_neutron |
|
| 45 |
- fi |
|
| 46 |
- elif [[ "$1" == "stack" && "$2" == "extra" ]]; then |
|
| 47 |
- echo_summary "Initializing OpenDaylight" |
|
| 48 |
- ODL_LOCAL_IP=${ODL_LOCAL_IP:-$HOST_IP}
|
|
| 49 |
- ODL_MGR_PORT=${ODL_MGR_PORT:-6640}
|
|
| 50 |
- read ovstbl <<< $(sudo ovs-vsctl get Open_vSwitch . _uuid) |
|
| 51 |
- sudo ovs-vsctl set-manager tcp:$ODL_MGR_IP:$ODL_MGR_PORT |
|
| 52 |
- if [[ -n "$ODL_PROVIDER_MAPPINGS" ]] && [[ "$ENABLE_TENANT_VLANS" == "True" ]]; then |
|
| 53 |
- sudo ovs-vsctl set Open_vSwitch $ovstbl \ |
|
| 54 |
- other_config:provider_mappings=$ODL_PROVIDER_MAPPINGS |
|
| 55 |
- fi |
|
| 56 |
- sudo ovs-vsctl set Open_vSwitch $ovstbl other_config:local_ip=$ODL_LOCAL_IP |
|
| 57 |
- elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then |
|
| 58 |
- # no-op |
|
| 59 |
- : |
|
| 60 |
- fi |
|
| 61 |
- |
|
| 62 |
- if [[ "$1" == "unstack" ]]; then |
|
| 63 |
- sudo ovs-vsctl del-manager |
|
| 64 |
- BRIDGES=$(sudo ovs-vsctl list-br) |
|
| 65 |
- for bridge in $BRIDGES ; do |
|
| 66 |
- sudo ovs-vsctl del-controller $bridge |
|
| 67 |
- done |
|
| 68 |
- |
|
| 69 |
- stop_opendaylight-compute |
|
| 70 |
- fi |
|
| 71 |
- |
|
| 72 |
- if [[ "$1" == "clean" ]]; then |
|
| 73 |
- # no-op |
|
| 74 |
- : |
|
| 75 |
- fi |
|
| 76 |
-fi |
| 77 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,215 +0,0 @@ |
| 1 |
-#!/bin/bash |
|
| 2 |
-# |
|
| 3 |
-# lib/opendaylight |
|
| 4 |
-# Functions to control the configuration and operation of the opendaylight service |
|
| 5 |
- |
|
| 6 |
-# Dependencies: |
|
| 7 |
-# |
|
| 8 |
-# ``functions`` file |
|
| 9 |
-# ``DEST`` must be defined |
|
| 10 |
-# ``STACK_USER`` must be defined |
|
| 11 |
- |
|
| 12 |
-# ``stack.sh`` calls the entry points in this order: |
|
| 13 |
-# |
|
| 14 |
-# - is_opendaylight_enabled |
|
| 15 |
-# - is_opendaylight-compute_enabled |
|
| 16 |
-# - install_opendaylight |
|
| 17 |
-# - install_opendaylight-compute |
|
| 18 |
-# - configure_opendaylight |
|
| 19 |
-# - init_opendaylight |
|
| 20 |
-# - start_opendaylight |
|
| 21 |
-# - stop_opendaylight-compute |
|
| 22 |
-# - stop_opendaylight |
|
| 23 |
-# - cleanup_opendaylight |
|
| 24 |
- |
|
| 25 |
-# Save trace setting |
|
| 26 |
-XTRACE=$(set +o | grep xtrace) |
|
| 27 |
-set +o xtrace |
|
| 28 |
- |
|
| 29 |
- |
|
| 30 |
-# For OVS_BRIDGE and PUBLIC_BRIDGE |
|
| 31 |
-source $TOP_DIR/lib/neutron_plugins/ovs_base |
|
| 32 |
- |
|
| 33 |
-# Defaults |
|
| 34 |
-# -------- |
|
| 35 |
- |
|
| 36 |
-# The IP address of ODL. Set this in local.conf. |
|
| 37 |
-# ODL_MGR_IP= |
|
| 38 |
-ODL_MGR_IP=${ODL_MGR_IP:-$SERVICE_HOST}
|
|
| 39 |
- |
|
| 40 |
-# The ODL endpoint URL |
|
| 41 |
-ODL_ENDPOINT=${ODL_ENDPOINT:-http://${ODL_MGR_IP}:8080/controller/nb/v2/neutron}
|
|
| 42 |
- |
|
| 43 |
-# The ODL username |
|
| 44 |
-ODL_USERNAME=${ODL_USERNAME:-admin}
|
|
| 45 |
- |
|
| 46 |
-# The ODL password |
|
| 47 |
-ODL_PASSWORD=${ODL_PASSWORD:-admin}
|
|
| 48 |
- |
|
| 49 |
-# Short name of ODL package |
|
| 50 |
-ODL_NAME=${ODL_NAME:-distribution-karaf-0.2.1-Helium-SR1.1}
|
|
| 51 |
- |
|
| 52 |
-# <define global variables here that belong to this project> |
|
| 53 |
-ODL_DIR=$DEST/opendaylight |
|
| 54 |
- |
|
| 55 |
-# The OpenDaylight Package, currently using 'Hydrogen' release |
|
| 56 |
-ODL_PKG=${ODL_PKG:-distribution-karaf-0.2.1-Helium-SR1.1.zip}
|
|
| 57 |
- |
|
| 58 |
-# The OpenDaylight URL |
|
| 59 |
-ODL_URL=${ODL_URL:-https://nexus.opendaylight.org/content/repositories/public/org/opendaylight/integration/distribution-karaf/0.2.1-Helium-SR1.1/}
|
|
| 60 |
- |
|
| 61 |
-# Default arguments for OpenDaylight. This is typically used to set |
|
| 62 |
-# Java memory options. |
|
| 63 |
-# ``ODL_ARGS=Xmx1024m -XX:MaxPermSize=512m`` |
|
| 64 |
-ODL_ARGS=${ODL_ARGS:-"-XX:MaxPermSize=384m"}
|
|
| 65 |
- |
|
| 66 |
-# How long to pause after ODL starts to let it complete booting |
|
| 67 |
-ODL_BOOT_WAIT=${ODL_BOOT_WAIT:-20}
|
|
| 68 |
- |
|
| 69 |
-# The physical provider network to device mapping |
|
| 70 |
-ODL_PROVIDER_MAPPINGS=${ODL_PROVIDER_MAPPINGS:-physnet1:eth1}
|
|
| 71 |
- |
|
| 72 |
-# Enable OpenDaylight l3 forwarding |
|
| 73 |
-ODL_L3=${ODL_L3:-False}
|
|
| 74 |
- |
|
| 75 |
-# Enable debug logs for odl ovsdb |
|
| 76 |
-ODL_NETVIRT_DEBUG_LOGS=${ODL_NETVIRT_DEBUG_LOGS:-False}
|
|
| 77 |
- |
|
| 78 |
-# The logging config file in ODL |
|
| 79 |
-ODL_LOGGING_CONFIG=${ODL_LOGGING_CONFIG:-${ODL_DIR}/${ODL_NAME}/etc/org.ops4j.pax.logging.cfg}
|
|
| 80 |
- |
|
| 81 |
-# Entry Points |
|
| 82 |
-# ------------ |
|
| 83 |
- |
|
| 84 |
-# Test if OpenDaylight is enabled |
|
| 85 |
-# is_opendaylight_enabled |
|
| 86 |
-function is_opendaylight_enabled {
|
|
| 87 |
- [[ ,${ENABLED_SERVICES} =~ ,"odl-" ]] && return 0
|
|
| 88 |
- return 1 |
|
| 89 |
-} |
|
| 90 |
- |
|
| 91 |
-# cleanup_opendaylight() - Remove residual data files, anything left over from previous |
|
| 92 |
-# runs that a clean run would need to clean up |
|
| 93 |
-function cleanup_opendaylight {
|
|
| 94 |
- : |
|
| 95 |
-} |
|
| 96 |
- |
|
| 97 |
-# configure_opendaylight() - Set config files, create data dirs, etc |
|
| 98 |
-function configure_opendaylight {
|
|
| 99 |
- # Add odl-ovsdb-openstack if it's not already there |
|
| 100 |
- local ODLOVSDB=$(cat $ODL_DIR/$ODL_NAME/etc/org.apache.karaf.features.cfg | grep featuresBoot= | grep odl) |
|
| 101 |
- if [ "$ODLOVSDB" == "" ]; then |
|
| 102 |
- sed -i '/^featuresBoot=/ s/$/,odl-ovsdb-openstack/' $ODL_DIR/$ODL_NAME/etc/org.apache.karaf.features.cfg |
|
| 103 |
- fi |
|
| 104 |
- |
|
| 105 |
- # Configure OpenFlow 1.3 if it's not there |
|
| 106 |
- local OFLOW13=$(cat $ODL_DIR/$ODL_NAME/etc/custom.properties | grep ^of.version) |
|
| 107 |
- if [ "$OFLOW13" == "" ]; then |
|
| 108 |
- echo "ovsdb.of.version=1.3" >> $ODL_DIR/$ODL_NAME/etc/custom.properties |
|
| 109 |
- fi |
|
| 110 |
- |
|
| 111 |
- # Configure L3 if the user wants it |
|
| 112 |
- if [ "${ODL_L3}" == "True" ]; then
|
|
| 113 |
- # Configure L3 FWD if it's not there |
|
| 114 |
- local L3FWD=$(cat $ODL_DIR/$ODL_NAME/etc/custom.properties | grep ^ovsdb.l3.fwd.enabled) |
|
| 115 |
- if [ "$L3FWD" == "" ]; then |
|
| 116 |
- echo "ovsdb.l3.fwd.enabled=yes" >> $ODL_DIR/$ODL_NAME/etc/custom.properties |
|
| 117 |
- fi |
|
| 118 |
- fi |
|
| 119 |
- |
|
| 120 |
- # Configure DEBUG logs for network virtualization in odl, if the user wants it |
|
| 121 |
- if [ "${ODL_NETVIRT_DEBUG_LOGS}" == "True" ]; then
|
|
| 122 |
- local OVSDB_DEBUG_LOGS=$(cat $ODL_LOGGING_CONFIG | grep ^log4j.logger.org.opendaylight.ovsdb) |
|
| 123 |
- if [ "${OVSDB_DEBUG_LOGS}" == "" ]; then
|
|
| 124 |
- echo 'log4j.logger.org.opendaylight.ovsdb = TRACE' >> $ODL_LOGGING_CONFIG |
|
| 125 |
- echo 'log4j.logger.org.opendaylight.ovsdb.lib = INFO' >> $ODL_LOGGING_CONFIG |
|
| 126 |
- echo 'log4j.logger.org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter = DEBUG' >> $ODL_LOGGING_CONFIG |
|
| 127 |
- echo 'log4j.logger.org.opendaylight.ovsdb.openstack.netvirt.impl.TenantNetworkManagerImpl = DEBUG' >> $ODL_LOGGING_CONFIG |
|
| 128 |
- echo 'log4j.logger.org.opendaylight.ovsdb.plugin.md.OvsdbInventoryManager = INFO' >> $ODL_LOGGING_CONFIG |
|
| 129 |
- fi |
|
| 130 |
- local ODL_NEUTRON_DEBUG_LOGS=$(cat $ODL_LOGGING_CONFIG | grep ^log4j.logger.org.opendaylight.controller.networkconfig.neutron) |
|
| 131 |
- if [ "${ODL_NEUTRON_DEBUG_LOGS}" == "" ]; then
|
|
| 132 |
- echo 'log4j.logger.org.opendaylight.controller.networkconfig.neutron = TRACE' >> $ODL_LOGGING_CONFIG |
|
| 133 |
- fi |
|
| 134 |
- fi |
|
| 135 |
-} |
|
| 136 |
- |
|
| 137 |
-function configure_ml2_odl {
|
|
| 138 |
- populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2_odl url=$ODL_ENDPOINT |
|
| 139 |
- populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2_odl username=$ODL_USERNAME |
|
| 140 |
- populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2_odl password=$ODL_PASSWORD |
|
| 141 |
-} |
|
| 142 |
- |
|
| 143 |
-# init_opendaylight() - Initialize databases, etc. |
|
| 144 |
-function init_opendaylight {
|
|
| 145 |
- # clean up from previous (possibly aborted) runs |
|
| 146 |
- # create required data files |
|
| 147 |
- : |
|
| 148 |
-} |
|
| 149 |
- |
|
| 150 |
-# install_opendaylight() - Collect source and prepare |
|
| 151 |
-function install_opendaylight {
|
|
| 152 |
- local _pwd=$(pwd) |
|
| 153 |
- |
|
| 154 |
- if is_ubuntu; then |
|
| 155 |
- install_package maven openjdk-7-jre openjdk-7-jdk |
|
| 156 |
- else |
|
| 157 |
- yum_install maven java-1.7.0-openjdk |
|
| 158 |
- fi |
|
| 159 |
- |
|
| 160 |
- # Download OpenDaylight |
|
| 161 |
- mkdir -p $ODL_DIR |
|
| 162 |
- cd $ODL_DIR |
|
| 163 |
- wget -N $ODL_URL/$ODL_PKG |
|
| 164 |
- unzip -u $ODL_PKG |
|
| 165 |
-} |
|
| 166 |
- |
|
| 167 |
-# install_opendaylight-compute - Make sure OVS is installed |
|
| 168 |
-function install_opendaylight-compute {
|
|
| 169 |
- # packages are the same as for Neutron OVS agent |
|
| 170 |
- _neutron_ovs_base_install_agent_packages |
|
| 171 |
-} |
|
| 172 |
- |
|
| 173 |
-# start_opendaylight() - Start running processes, including screen |
|
| 174 |
-function start_opendaylight {
|
|
| 175 |
- if is_ubuntu; then |
|
| 176 |
- JHOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64 |
|
| 177 |
- else |
|
| 178 |
- JHOME=/usr/lib/jvm/java-1.7.0-openjdk |
|
| 179 |
- fi |
|
| 180 |
- |
|
| 181 |
- # The flags to ODL have the following meaning: |
|
| 182 |
- # -of13: runs ODL using OpenFlow 1.3 protocol support. |
|
| 183 |
- # -virt ovsdb: Runs ODL in "virtualization" mode with OVSDB support |
|
| 184 |
- |
|
| 185 |
- run_process odl-server "cd $ODL_DIR/$ODL_NAME && JAVA_HOME=$JHOME bin/karaf" |
|
| 186 |
- |
|
| 187 |
- # Sleep a bit to let OpenDaylight finish starting up |
|
| 188 |
- sleep $ODL_BOOT_WAIT |
|
| 189 |
-} |
|
| 190 |
- |
|
| 191 |
-# stop_opendaylight() - Stop running processes (non-screen) |
|
| 192 |
-function stop_opendaylight {
|
|
| 193 |
- stop_process odl-server |
|
| 194 |
-} |
|
| 195 |
- |
|
| 196 |
-# stop_opendaylight-compute() - Remove OVS bridges |
|
| 197 |
-function stop_opendaylight-compute {
|
|
| 198 |
- # remove all OVS ports that look like Neutron created ports |
|
| 199 |
- for port in $(sudo ovs-vsctl list port | grep -o -e tap[0-9a-f\-]* -e q[rg]-[0-9a-f\-]*); do |
|
| 200 |
- sudo ovs-vsctl del-port ${port}
|
|
| 201 |
- done |
|
| 202 |
- |
|
| 203 |
- # remove all OVS bridges created by Neutron |
|
| 204 |
- for bridge in $(sudo ovs-vsctl list-br | grep -o -e ${OVS_BRIDGE} -e ${PUBLIC_BRIDGE}); do
|
|
| 205 |
- sudo ovs-vsctl del-br ${bridge}
|
|
| 206 |
- done |
|
| 207 |
-} |
|
| 208 |
- |
|
| 209 |
-# Restore xtrace |
|
| 210 |
-$XTRACE |
|
| 211 |
- |
|
| 212 |
-# Tell emacs to use shell-script-mode |
|
| 213 |
-## Local variables: |
|
| 214 |
-## mode: shell-script |
|
| 215 |
-## End: |