devstack/lib/quantum_thirdparty/ryu

74 lines
1.9 KiB
Plaintext

# Ryu OpenFlow Controller
# -----------------------
# Save trace setting
MY_XTRACE=$(set +o | grep xtrace)
set +o xtrace
RYU_DIR=$DEST/ryu
# Ryu API Host
RYU_API_HOST=${RYU_API_HOST:-127.0.0.1}
# Ryu API Port
RYU_API_PORT=${RYU_API_PORT:-8080}
# Ryu OFP Host
RYU_OFP_HOST=${RYU_OFP_HOST:-127.0.0.1}
# Ryu OFP Port
RYU_OFP_PORT=${RYU_OFP_PORT:-6633}
# Ryu Applications
RYU_APPS=${RYU_APPS:-ryu.app.simple_isolation,ryu.app.rest}
# Ryu configuration
RYU_CONF_CONTENTS=${RYU_CONF_CONTENTS:-"
--app_lists=$RYU_APPS
--wsapi_host=$RYU_API_HOST
--wsapi_port=$RYU_API_PORT
--ofp_listen_host=$RYU_OFP_HOST
--ofp_tcp_listen_port=$RYU_OFP_PORT
--quantum_url=http://$Q_HOST:$Q_PORT
--quantum_admin_username=$Q_ADMIN_USERNAME
--quantum_admin_password=$SERVICE_PASSWORD
--quantum_admin_tenant_name=$SERVICE_TENANT_NAME
--quantum_admin_auth_url=$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_AUTH_PORT/v2.0
--quantum_auth_strategy=$Q_AUTH_STRATEGY
--quantum_controller_addr=tcp:$RYU_OFP_HOST:$RYU_OFP_PORT
"}
function configure_ryu() {
setup_develop $RYU_DIR
}
function init_ryu() {
RYU_CONF_DIR=/etc/ryu
if [[ ! -d $RYU_CONF_DIR ]]; then
sudo mkdir -p $RYU_CONF_DIR
fi
sudo chown $STACK_USER $RYU_CONF_DIR
RYU_CONF=$RYU_CONF_DIR/ryu.conf
sudo rm -rf $RYU_CONF
echo "${RYU_CONF_CONTENTS}" > $RYU_CONF
}
# install_ryu can be called multiple times as quantum_pluing/ryu may call
# this function for quantum-ryu-agent
# Make this function idempotent and avoid cloning same repo many times
# with RECLONE=yes
_RYU_INSTALLED=${_RYU_INSTALLED:-False}
function install_ryu() {
if [[ "$_RYU_INSTALLED" == "False" ]]; then
git_clone $RYU_REPO $RYU_DIR $RYU_BRANCH
_RYU_INSTALLED=True
fi
}
function start_ryu() {
screen_it ryu "cd $RYU_DIR && $RYU_DIR/bin/ryu-manager --flagfile $RYU_CONF"
}
function stop_ryu() {
:
}
# Restore xtrace
$MY_XTRACE