blob: bf99866f92d1f7474f46c385e7870cc27747af2e [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
Sam Hague408efd22014-04-23 09:59:49 -040050 if [[ -n "$OVS_BRIDGE_MAPPINGS" ]] && [[ "$ENABLE_TENANT_VLANS" == "True" ]]; then
51 sudo ovs-vsctl set Open_vSwitch $ovstbl \
52 other_config:bridge_mappings=$OVS_BRIDGE_MAPPINGS
53 fi
54 sudo ovs-vsctl set Open_vSwitch $ovstbl other_config:local_ip=$ODL_LOCAL_IP
Kyle Mesteryd44517d2014-01-28 20:29:18 +000055 elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then
56 # no-op
57 :
58 fi
59
60 if [[ "$1" == "unstack" ]]; then
61 sudo ovs-vsctl del-manager
62 BRIDGES=$(sudo ovs-vsctl list-br)
63 for bridge in $BRIDGES ; do
64 sudo ovs-vsctl del-controller $bridge
65 done
66
67 stop_opendaylight-compute
68 fi
69
70 if [[ "$1" == "clean" ]]; then
71 # no-op
72 :
73 fi
74fi