blob: b673777e3af06f6c60bbf179db5e7bc22060ac32 [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
Flavio Fernandes51783cc2014-06-16 00:36:03 -040043 if is_service_enabled nova; then
44 create_nova_conf_neutron
45 fi
Kyle Mesteryd44517d2014-01-28 20:29:18 +000046 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 Hague09b56b12014-05-05 10:30:09 -040052 if [[ -n "$ODL_PROVIDER_MAPPINGS" ]] && [[ "$ENABLE_TENANT_VLANS" == "True" ]]; then
Sam Hague408efd22014-04-23 09:59:49 -040053 sudo ovs-vsctl set Open_vSwitch $ovstbl \
Sam Hague09b56b12014-05-05 10:30:09 -040054 other_config:provider_mappings=$ODL_PROVIDER_MAPPINGS
Sam Hague408efd22014-04-23 09:59:49 -040055 fi
56 sudo ovs-vsctl set Open_vSwitch $ovstbl other_config:local_ip=$ODL_LOCAL_IP
Kyle Mesteryd44517d2014-01-28 20:29:18 +000057 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
76fi