@@ -342,6 +342,18 @@ Q_USE_ROOTWRAP=${Q_USE_ROOTWRAP=:-True}
342342# Meta data IP
343343Q_META_DATA_IP=${Q_META_DATA_IP:- $HOST_IP }
344344
345+ RYU_DIR=$DEST /ryu
346+ # Ryu API Host
347+ RYU_API_HOST=${RYU_API_HOST:- 127.0.0.1}
348+ # Ryu API Port
349+ RYU_API_PORT=${RYU_API_PORT:- 8080}
350+ # Ryu OFP Host
351+ RYU_OFP_HOST=${RYU_OFP_HOST:- 127.0.0.1}
352+ # Ryu OFP Port
353+ RYU_OFP_PORT=${RYU_OFP_PORT:- 6633}
354+ # Ryu Applications
355+ RYU_APPS=${RYU_APPS:- ryu.app.simple_isolation,ryu.app.rest}
356+
345357# Name of the LVM volume group to use/create for iscsi volumes
346358VOLUME_GROUP=${VOLUME_GROUP:- stack-volumes}
347359VOLUME_NAME_PREFIX=${VOLUME_NAME_PREFIX:- volume-}
@@ -773,7 +785,7 @@ if is_service_enabled horizon; then
773785fi
774786
775787if is_service_enabled q-agt; then
776- if [[ " $Q_PLUGIN " = " openvswitch " ]] ; then
788+ if is_quantum_ovs_base_plugin " $Q_PLUGIN " ; then
777789 # Install deps
778790 # FIXME add to files/apts/quantum, but don't install if not needed!
779791 if [[ " $os_PACKAGE " = " deb" ]]; then
875887if is_service_enabled tempest; then
876888 install_tempest
877889fi
878-
890+ if is_service_enabled ryu || (is_service_enabled quantum && [[ " $Q_PLUGIN " = " ryu" ]]); then
891+ git_clone $RYU_REPO $RYU_DIR $RYU_BRANCH
892+ fi
879893
880894# Initialization
881895# ==============
924938if is_service_enabled tempest; then
925939 configure_tempest
926940fi
941+ if is_service_enabled ryu || (is_service_enabled quantum && [[ " $Q_PLUGIN " = " ryu" ]]); then
942+ setup_develop $RYU_DIR
943+ fi
927944
928945if [[ $TRACK_DEPENDS = True ]] ; then
929946 $DEST /.venv/bin/pip freeze > $DEST /requires-post-pip
@@ -1132,6 +1149,31 @@ if is_service_enabled g-reg; then
11321149fi
11331150
11341151
1152+ # Ryu
1153+ # ---
1154+ # Ryu is not a part of OpenStack project. Please ignore following block if
1155+ # you are not interested in Ryu.
1156+ # launch ryu manager
1157+ if is_service_enabled ryu; then
1158+ RYU_CONF_DIR=/etc/ryu
1159+ if [[ ! -d $RYU_CONF_DIR ]]; then
1160+ sudo mkdir -p $RYU_CONF_DIR
1161+ fi
1162+ sudo chown ` whoami` $RYU_CONF_DIR
1163+ RYU_CONF=$RYU_CONF_DIR /ryu.conf
1164+ sudo rm -rf $RYU_CONF
1165+
1166+ cat << EOF > $RYU_CONF
1167+ --app_lists=$RYU_APPS
1168+ --wsapi_host=$RYU_API_HOST
1169+ --wsapi_port=$RYU_API_PORT
1170+ --ofp_listen_host=$RYU_OFP_HOST
1171+ --ofp_tcp_listen_port=$RYU_OFP_PORT
1172+ EOF
1173+ screen_it ryu " cd $RYU_DIR && $RYU_DIR /bin/ryu-manager --flagfile $RYU_CONF "
1174+ fi
1175+
1176+
11351177# Quantum
11361178# -------
11371179
@@ -1219,6 +1261,11 @@ if is_service_enabled quantum; then
12191261 Q_PLUGIN_CONF_FILENAME=linuxbridge_conf.ini
12201262 Q_DB_NAME=" quantum_linux_bridge"
12211263 Q_PLUGIN_CLASS=" quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2"
1264+ elif [[ " $Q_PLUGIN " = " ryu" ]]; then
1265+ Q_PLUGIN_CONF_PATH=etc/quantum/plugins/ryu
1266+ Q_PLUGIN_CONF_FILENAME=ryu.ini
1267+ Q_DB_NAME=" ovs_quantum"
1268+ Q_PLUGIN_CLASS=" quantum.plugins.ryu.ryu_quantum_plugin.RyuQuantumPluginV2"
12221269 else
12231270 echo " Unknown Quantum plugin '$Q_PLUGIN '.. exiting"
12241271 exit 1
@@ -1314,6 +1361,9 @@ if is_service_enabled q-svc; then
13141361 if [[ " $LB_VLAN_RANGES " != " " ]]; then
13151362 iniset /$Q_PLUGIN_CONF_FILE VLANS network_vlan_ranges $LB_VLAN_RANGES
13161363 fi
1364+ elif [[ " $Q_PLUGIN " = " ryu" ]]; then
1365+ iniset /$Q_PLUGIN_CONF_FILE OVS openflow_controller $RYU_OFP_HOST :$RYU_OFP_PORT
1366+ iniset /$Q_PLUGIN_CONF_FILE OVS openflow_rest_api $RYU_API_HOST :$RYU_API_PORT
13171367 fi
13181368fi
13191369
@@ -1363,6 +1413,14 @@ if is_service_enabled q-agt; then
13631413 iniset /$Q_PLUGIN_CONF_FILE LINUX_BRIDGE physical_interface_mappings $LB_INTERFACE_MAPPINGS
13641414 fi
13651415 AGENT_BINARY=" $QUANTUM_DIR /bin/quantum-linuxbridge-agent"
1416+ elif [[ " $Q_PLUGIN " = " ryu" ]]; then
1417+ # Set up integration bridge
1418+ OVS_BRIDGE=${OVS_BRIDGE:- br-int}
1419+ quantum_setup_ovs_bridge $OVS_BRIDGE
1420+ if [ -n " $RYU_INTERNAL_INTERFACE " ]; then
1421+ sudo ovs-vsctl --no-wait -- --may-exist add-port $OVS_BRIDGE $RYU_INTERNAL_INTERFACE
1422+ fi
1423+ AGENT_BINARY=" $QUANTUM_DIR /quantum/plugins/ryu/agent/ryu_quantum_agent.py"
13661424 fi
13671425 # Update config w/rootwrap
13681426 iniset /$Q_PLUGIN_CONF_FILE AGENT root_helper " $Q_RR_COMMAND "
@@ -1391,6 +1449,9 @@ if is_service_enabled q-dhcp; then
13911449 iniset $Q_DHCP_CONF_FILE DEFAULT interface_driver quantum.agent.linux.interface.OVSInterfaceDriver
13921450 elif [[ " $Q_PLUGIN " = " linuxbridge" ]]; then
13931451 iniset $Q_DHCP_CONF_FILE DEFAULT interface_driver quantum.agent.linux.interface.BridgeInterfaceDriver
1452+ elif [[ " $Q_PLUGIN " = " ryu" ]]; then
1453+ iniset $Q_DHCP_CONF_FILE DEFAULT interface_driver quantum.agent.linux.interface.RyuInterfaceDriver
1454+ iniset $Q_DHCP_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST :$RYU_API_PORT
13941455 fi
13951456fi
13961457
@@ -1417,21 +1478,16 @@ if is_service_enabled q-l3; then
14171478 iniset $Q_L3_CONF_FILE DEFAULT interface_driver quantum.agent.linux.interface.OVSInterfaceDriver
14181479 iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge $PUBLIC_BRIDGE
14191480 # Set up external bridge
1420- # Create it if it does not exist
1421- sudo ovs-vsctl --no-wait -- --may-exist add-br $PUBLIC_BRIDGE
1422- # remove internal ports
1423- for PORT in ` sudo ovs-vsctl --no-wait list-ports $PUBLIC_BRIDGE ` ; do
1424- TYPE=$( sudo ovs-vsctl get interface $PORT type)
1425- if [[ " $TYPE " == " internal" ]]; then
1426- echo ` sudo ip link delete $PORT ` > /dev/null
1427- sudo ovs-vsctl --no-wait del-port $bridge $PORT
1428- fi
1429- done
1430- # ensure no IP is configured on the public bridge
1431- sudo ip addr flush dev $PUBLIC_BRIDGE
1481+ quantum_setup_external_bridge $PUBLIC_BRIDGE
14321482 elif [[ " $Q_PLUGIN " = " linuxbridge" ]]; then
14331483 iniset $Q_L3_CONF_FILE DEFAULT interface_driver quantum.agent.linux.interface.BridgeInterfaceDriver
14341484 iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge ' '
1485+ elif [[ " $Q_PLUGIN " = " ryu" ]]; then
1486+ iniset $Q_L3_CONF_FILE DEFAULT interface_driver quantum.agent.linux.interface.RyuInterfaceDriver
1487+ iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge $PUBLIC_BRIDGE
1488+ iniset $Q_L3_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST :$RYU_API_PORT
1489+ # Set up external bridge
1490+ quantum_setup_external_bridge $PUBLIC_BRIDGE
14351491 fi
14361492fi
14371493
@@ -1599,8 +1655,8 @@ if is_service_enabled swift; then
15991655 iniuncomment ${SWIFT_CONFIG_PROXY_SERVER} filter:keystoneauth operator_roles
16001656 iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:keystoneauth operator_roles " Member, admin"
16011657
1602- if is_service_enabled swift3; then
1603- cat << EOF>>${SWIFT_CONFIG_PROXY_SERVER}
1658+ if is_service_enabled swift3; then
1659+ cat << EOF >>${SWIFT_CONFIG_PROXY_SERVER}
16041660# NOTE(chmou): s3token middleware is not updated yet to use only
16051661# username and password.
16061662[filter:s3token]
@@ -1753,6 +1809,11 @@ if is_service_enabled quantum; then
17531809 NOVA_VIF_DRIVER=" nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver"
17541810 elif [[ " $Q_PLUGIN " = " linuxbridge" ]]; then
17551811 NOVA_VIF_DRIVER=" nova.virt.libvirt.vif.QuantumLinuxBridgeVIFDriver"
1812+ elif [[ " $Q_PLUGIN " = " ryu" ]]; then
1813+ NOVA_VIF_DRIVER=" quantum.plugins.ryu.nova.vif.LibvirtOpenVswitchOFPRyuDriver"
1814+ add_nova_opt " libvirt_ovs_integration_bridge=$OVS_BRIDGE "
1815+ add_nova_opt " linuxnet_ovs_ryu_api_host=$RYU_API_HOST :$RYU_API_PORT "
1816+ add_nova_opt " libvirt_ovs_ryu_api_host=$RYU_API_HOST :$RYU_API_PORT "
17561817 fi
17571818 add_nova_opt " libvirt_vif_driver=$NOVA_VIF_DRIVER "
17581819 add_nova_opt " linuxnet_interface_driver=$LINUXNET_VIF_DRIVER "
@@ -1899,7 +1960,7 @@ if is_service_enabled q-svc; then
18991960 EXT_NET_ID=$( quantum net-create ext_net -- --router:external=True | grep ' id ' | get_field 2)
19001961 EXT_GW_IP=$( quantum subnet-create --ip_version 4 $EXT_NET_ID $FLOATING_RANGE -- --enable_dhcp=False | grep ' gateway_ip' | get_field 2)
19011962 quantum router-gateway-set $ROUTER_ID $EXT_NET_ID
1902- if [[ "$Q_PLUGIN " = "openvswitch" ]] && [[ "$Q_USE_NAMESPACE " = "True" ]]; then
1963+ if is_quantum_ovs_base_plugin " $Q_PLUGIN " && [[ " $Q_USE_NAMESPACE " = " True" ]]; then
19031964 CIDR_LEN=${FLOATING_RANGE#*/ }
19041965 sudo ip addr add $EXT_GW_IP /$CIDR_LEN dev $PUBLIC_BRIDGE
19051966 sudo ip link set $PUBLIC_BRIDGE up
0 commit comments