09b56b1c31
OpenDaylight OpenDaylight needs to know the physical network mapping used with vlan tenant isolation. This is similar to how the bridge_mappings cofig is used to map the physical network to the bridge, i.e. bridge_mappings=physnet1:br-eth1,physnet2:br-eth2. OpenDaylight needs the physical network device itself: provider_mappings=physnet1:eth1,physnet2:eth2. OpenDaylight needs the mapping because the device port is used when pushing flows. The neutron API's provide the physical provider network value for example as physnet1. DocImpact: Use of VLANs with ML2 and the OpenDaylight mechanism driver requires OpenDaylight Helium or newer to be installed. Closes-Bug: #1315492 Change-Id: If7af9ce5735b01c35315a54c79355ca87b72c4b4
75 lines
2.2 KiB
Bash
75 lines
2.2 KiB
Bash
# opendaylight.sh - DevStack extras script
|
|
|
|
if is_service_enabled odl-server odl-compute; then
|
|
# Initial source
|
|
[[ "$1" == "source" ]] && source $TOP_DIR/lib/opendaylight
|
|
fi
|
|
|
|
if is_service_enabled odl-server; then
|
|
if [[ "$1" == "source" ]]; then
|
|
# no-op
|
|
:
|
|
elif [[ "$1" == "stack" && "$2" == "install" ]]; then
|
|
install_opendaylight
|
|
configure_opendaylight
|
|
init_opendaylight
|
|
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
|
|
configure_ml2_odl
|
|
# This has to start before Neutron
|
|
start_opendaylight
|
|
elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then
|
|
# no-op
|
|
:
|
|
fi
|
|
|
|
if [[ "$1" == "unstack" ]]; then
|
|
stop_opendaylight
|
|
cleanup_opendaylight
|
|
fi
|
|
|
|
if [[ "$1" == "clean" ]]; then
|
|
# no-op
|
|
:
|
|
fi
|
|
fi
|
|
|
|
if is_service_enabled odl-compute; then
|
|
if [[ "$1" == "source" ]]; then
|
|
# no-op
|
|
:
|
|
elif [[ "$1" == "stack" && "$2" == "install" ]]; then
|
|
install_opendaylight-compute
|
|
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
|
|
create_nova_conf_neutron
|
|
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
|
|
echo_summary "Initializing OpenDaylight"
|
|
ODL_LOCAL_IP=${ODL_LOCAL_IP:-$HOST_IP}
|
|
ODL_MGR_PORT=${ODL_MGR_PORT:-6640}
|
|
read ovstbl <<< $(sudo ovs-vsctl get Open_vSwitch . _uuid)
|
|
sudo ovs-vsctl set-manager tcp:$ODL_MGR_IP:$ODL_MGR_PORT
|
|
if [[ -n "$ODL_PROVIDER_MAPPINGS" ]] && [[ "$ENABLE_TENANT_VLANS" == "True" ]]; then
|
|
sudo ovs-vsctl set Open_vSwitch $ovstbl \
|
|
other_config:provider_mappings=$ODL_PROVIDER_MAPPINGS
|
|
fi
|
|
sudo ovs-vsctl set Open_vSwitch $ovstbl other_config:local_ip=$ODL_LOCAL_IP
|
|
elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then
|
|
# no-op
|
|
:
|
|
fi
|
|
|
|
if [[ "$1" == "unstack" ]]; then
|
|
sudo ovs-vsctl del-manager
|
|
BRIDGES=$(sudo ovs-vsctl list-br)
|
|
for bridge in $BRIDGES ; do
|
|
sudo ovs-vsctl del-controller $bridge
|
|
done
|
|
|
|
stop_opendaylight-compute
|
|
fi
|
|
|
|
if [[ "$1" == "clean" ]]; then
|
|
# no-op
|
|
:
|
|
fi
|
|
fi
|