blob: c3c85fc963ffd86770b7b2034c65bfd213a752ee [file] [log] [blame]
Kyle Mesteryd44517d2014-01-28 20:29:18 +00001# opendaylight.sh - DevStack extras script
2
Roey Chen11b36c92014-03-10 11:25:50 +02003if is_service_enabled odl-server odl-compute; then
4 # Initial source
5 [[ "$1" == "source" ]] && source $TOP_DIR/lib/opendaylight
6fi
Kyle Mesteryd44517d2014-01-28 20:29:18 +00007
8if 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 Pasquiercfc9ebb2014-04-08 09:34:44 +020017 configure_ml2_odl
Kyle Mesteryd44517d2014-01-28 20:29:18 +000018 # 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
34fi
35
36if 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 create_nova_conf_neutron
44 elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
45 echo_summary "Initializing OpenDaylight"
46 ODL_LOCAL_IP=${ODL_LOCAL_IP:-$HOST_IP}
47 ODL_MGR_PORT=${ODL_MGR_PORT:-6640}
48 read ovstbl <<< $(sudo ovs-vsctl get Open_vSwitch . _uuid)
49 sudo ovs-vsctl set-manager tcp:$ODL_MGR_IP:$ODL_MGR_PORT
50 sudo ovs-vsctl set Open_vSwitch $ovstbl other_config={"local_ip"="$ODL_LOCAL_IP"}
51 elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then
52 # no-op
53 :
54 fi
55
56 if [[ "$1" == "unstack" ]]; then
57 sudo ovs-vsctl del-manager
58 BRIDGES=$(sudo ovs-vsctl list-br)
59 for bridge in $BRIDGES ; do
60 sudo ovs-vsctl del-controller $bridge
61 done
62
63 stop_opendaylight-compute
64 fi
65
66 if [[ "$1" == "clean" ]]; then
67 # no-op
68 :
69 fi
70fi