Kyle Mestery | d44517d | 2014-01-28 20:29:18 +0000 | [diff] [blame] | 1 | # opendaylight.sh - DevStack extras script |
| 2 | |
| 3 | # Need this first to get the is_***_enabled for ODL |
| 4 | source $TOP_DIR/lib/opendaylight |
| 5 | |
| 6 | if is_service_enabled odl-server; then |
| 7 | if [[ "$1" == "source" ]]; then |
| 8 | # no-op |
| 9 | : |
| 10 | elif [[ "$1" == "stack" && "$2" == "install" ]]; then |
| 11 | install_opendaylight |
| 12 | configure_opendaylight |
| 13 | init_opendaylight |
| 14 | elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then |
| 15 | # This has to start before Neutron |
| 16 | start_opendaylight |
| 17 | elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then |
| 18 | # no-op |
| 19 | : |
| 20 | fi |
| 21 | |
| 22 | if [[ "$1" == "unstack" ]]; then |
| 23 | stop_opendaylight |
| 24 | cleanup_opendaylight |
| 25 | fi |
| 26 | |
| 27 | if [[ "$1" == "clean" ]]; then |
| 28 | # no-op |
| 29 | : |
| 30 | fi |
| 31 | fi |
| 32 | |
| 33 | if is_service_enabled odl-compute; then |
| 34 | if [[ "$1" == "source" ]]; then |
| 35 | # no-op |
| 36 | : |
| 37 | elif [[ "$1" == "stack" && "$2" == "install" ]]; then |
| 38 | install_opendaylight-compute |
| 39 | elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then |
| 40 | create_nova_conf_neutron |
| 41 | elif [[ "$1" == "stack" && "$2" == "extra" ]]; then |
| 42 | echo_summary "Initializing OpenDaylight" |
| 43 | ODL_LOCAL_IP=${ODL_LOCAL_IP:-$HOST_IP} |
| 44 | ODL_MGR_PORT=${ODL_MGR_PORT:-6640} |
| 45 | read ovstbl <<< $(sudo ovs-vsctl get Open_vSwitch . _uuid) |
| 46 | sudo ovs-vsctl set-manager tcp:$ODL_MGR_IP:$ODL_MGR_PORT |
| 47 | sudo ovs-vsctl set Open_vSwitch $ovstbl other_config={"local_ip"="$ODL_LOCAL_IP"} |
| 48 | elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then |
| 49 | # no-op |
| 50 | : |
| 51 | fi |
| 52 | |
| 53 | if [[ "$1" == "unstack" ]]; then |
| 54 | sudo ovs-vsctl del-manager |
| 55 | BRIDGES=$(sudo ovs-vsctl list-br) |
| 56 | for bridge in $BRIDGES ; do |
| 57 | sudo ovs-vsctl del-controller $bridge |
| 58 | done |
| 59 | |
| 60 | stop_opendaylight-compute |
| 61 | fi |
| 62 | |
| 63 | if [[ "$1" == "clean" ]]; then |
| 64 | # no-op |
| 65 | : |
| 66 | fi |
| 67 | fi |