| 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 | 
| Simon Pasquier | cfc9ebb | 2014-04-08 09:34:44 +0200 | [diff] [blame] | 17 | configure_ml2_odl | 
| Kyle Mestery | d44517d | 2014-01-28 20:29:18 +0000 | [diff] [blame] | 18 | # 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 | 
|  | 34 | fi | 
|  | 35 |  | 
|  | 36 | if 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 Hague | 408efd2 | 2014-04-23 09:59:49 -0400 | [diff] [blame] | 50 | 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 Mestery | d44517d | 2014-01-28 20:29:18 +0000 | [diff] [blame] | 55 | 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 | 
|  | 74 | fi |