| 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 | 
|  | 17 | # This has to start before Neutron | 
|  | 18 | start_opendaylight | 
|  | 19 | elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then | 
|  | 20 | # no-op | 
|  | 21 | : | 
|  | 22 | fi | 
|  | 23 |  | 
|  | 24 | if [[ "$1" == "unstack" ]]; then | 
|  | 25 | stop_opendaylight | 
|  | 26 | cleanup_opendaylight | 
|  | 27 | fi | 
|  | 28 |  | 
|  | 29 | if [[ "$1" == "clean" ]]; then | 
|  | 30 | # no-op | 
|  | 31 | : | 
|  | 32 | fi | 
|  | 33 | fi | 
|  | 34 |  | 
|  | 35 | if is_service_enabled odl-compute; then | 
|  | 36 | if [[ "$1" == "source" ]]; then | 
|  | 37 | # no-op | 
|  | 38 | : | 
|  | 39 | elif [[ "$1" == "stack" && "$2" == "install" ]]; then | 
|  | 40 | install_opendaylight-compute | 
|  | 41 | elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then | 
|  | 42 | create_nova_conf_neutron | 
|  | 43 | elif [[ "$1" == "stack" && "$2" == "extra" ]]; then | 
|  | 44 | echo_summary "Initializing OpenDaylight" | 
|  | 45 | ODL_LOCAL_IP=${ODL_LOCAL_IP:-$HOST_IP} | 
|  | 46 | ODL_MGR_PORT=${ODL_MGR_PORT:-6640} | 
|  | 47 | read ovstbl <<< $(sudo ovs-vsctl get Open_vSwitch . _uuid) | 
|  | 48 | sudo ovs-vsctl set-manager tcp:$ODL_MGR_IP:$ODL_MGR_PORT | 
|  | 49 | sudo ovs-vsctl set Open_vSwitch $ovstbl other_config={"local_ip"="$ODL_LOCAL_IP"} | 
|  | 50 | elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then | 
|  | 51 | # no-op | 
|  | 52 | : | 
|  | 53 | fi | 
|  | 54 |  | 
|  | 55 | if [[ "$1" == "unstack" ]]; then | 
|  | 56 | sudo ovs-vsctl del-manager | 
|  | 57 | BRIDGES=$(sudo ovs-vsctl list-br) | 
|  | 58 | for bridge in $BRIDGES ; do | 
|  | 59 | sudo ovs-vsctl del-controller $bridge | 
|  | 60 | done | 
|  | 61 |  | 
|  | 62 | stop_opendaylight-compute | 
|  | 63 | fi | 
|  | 64 |  | 
|  | 65 | if [[ "$1" == "clean" ]]; then | 
|  | 66 | # no-op | 
|  | 67 | : | 
|  | 68 | fi | 
|  | 69 | fi |