Kyle Mestery | d44517d | 2014-01-28 20:29:18 +0000 | [diff] [blame] | 1 | # opendaylight.sh - DevStack extras script |
| 2 | |
Roey Chen | 11b36c9 | 2014-03-10 11:25:50 +0200 | [diff] [blame] | 3 | if is_service_enabled odl-server odl-compute; then |
| 4 | # Initial source |
| 5 | [[ "$1" == "source" ]] && source $TOP_DIR/lib/opendaylight |
| 6 | fi |
Kyle Mestery | d44517d | 2014-01-28 20:29:18 +0000 | [diff] [blame] | 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 |
Simon Pasquier | cfc9ebb | 2014-04-08 09:34:44 +0200 | [diff] [blame] | 17 | configure_ml2_odl |
Kyle Mestery | d44517d | 2014-01-28 20:29:18 +0000 | [diff] [blame] | 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 |
Flavio Fernandes | 51783cc | 2014-06-16 00:36:03 -0400 | [diff] [blame] | 43 | if is_service_enabled nova; then |
| 44 | create_nova_conf_neutron |
| 45 | fi |
Kyle Mestery | d44517d | 2014-01-28 20:29:18 +0000 | [diff] [blame] | 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 |
Sam Hague | 09b56b1 | 2014-05-05 10:30:09 -0400 | [diff] [blame] | 52 | if [[ -n "$ODL_PROVIDER_MAPPINGS" ]] && [[ "$ENABLE_TENANT_VLANS" == "True" ]]; then |
Sam Hague | 408efd2 | 2014-04-23 09:59:49 -0400 | [diff] [blame] | 53 | sudo ovs-vsctl set Open_vSwitch $ovstbl \ |
Sam Hague | 09b56b1 | 2014-05-05 10:30:09 -0400 | [diff] [blame] | 54 | other_config:provider_mappings=$ODL_PROVIDER_MAPPINGS |
Sam Hague | 408efd2 | 2014-04-23 09:59:49 -0400 | [diff] [blame] | 55 | fi |
| 56 | sudo ovs-vsctl set Open_vSwitch $ovstbl other_config:local_ip=$ODL_LOCAL_IP |
Kyle Mestery | d44517d | 2014-01-28 20:29:18 +0000 | [diff] [blame] | 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 |