Merge "stack.sh: updates for linuxbridge support"
This commit is contained in:
commit
f845f8d462
33
stack.sh
33
stack.sh
@ -1045,10 +1045,15 @@ if is_service_enabled q-svc; then
|
|||||||
### FIXME(dtroyer): Find RPMs for OpenVSwitch
|
### FIXME(dtroyer): Find RPMs for OpenVSwitch
|
||||||
echo "OpenVSwitch packages need to be located"
|
echo "OpenVSwitch packages need to be located"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
QUANTUM_OVS_CONF_DIR=$QUANTUM_CONF_DIR/plugins/openvswitch
|
||||||
|
QUANTUM_OVS_CONFIG_FILE=$QUANTUM_OVS_CONF_DIR/ovs_quantum_plugin.ini
|
||||||
|
|
||||||
# Create database for the plugin/agent
|
# Create database for the plugin/agent
|
||||||
if is_service_enabled mysql; then
|
if is_service_enabled mysql; then
|
||||||
mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'DROP DATABASE IF EXISTS ovs_quantum;'
|
mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'DROP DATABASE IF EXISTS ovs_quantum;'
|
||||||
mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'CREATE DATABASE IF NOT EXISTS ovs_quantum CHARACTER SET utf8;'
|
mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'CREATE DATABASE IF NOT EXISTS ovs_quantum CHARACTER SET utf8;'
|
||||||
|
sudo sed -i -e "s/^sql_connection =.*$/sql_connection = mysql:\/\/$MYSQL_USER:$MYSQL_PASSWORD@$MYSQL_HOST\/ovs_quantum?charset=utf8/g" $QUANTUM_OVS_CONFIG_FILE
|
||||||
else
|
else
|
||||||
echo "mysql must be enabled in order to use the $Q_PLUGIN Quantum plugin."
|
echo "mysql must be enabled in order to use the $Q_PLUGIN Quantum plugin."
|
||||||
exit 1
|
exit 1
|
||||||
@ -1063,17 +1068,22 @@ if is_service_enabled q-svc; then
|
|||||||
if is_service_enabled mysql; then
|
if is_service_enabled mysql; then
|
||||||
mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'DROP DATABASE IF EXISTS quantum_linux_bridge;'
|
mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'DROP DATABASE IF EXISTS quantum_linux_bridge;'
|
||||||
mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'CREATE DATABASE IF NOT EXISTS quantum_linux_bridge;'
|
mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'CREATE DATABASE IF NOT EXISTS quantum_linux_bridge;'
|
||||||
else
|
if grep -Fxq "user = " $QUANTUM_LB_CONFIG_FILE
|
||||||
echo "mysql must be enabled in order to use the $Q_PLUGIN Quantum plugin."
|
then
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
# Make sure we're using the linuxbridge plugin and set the mysql hostname, username and password in the config file
|
|
||||||
sudo sed -i -e "s/^provider =.*$/provider = quantum.plugins.linuxbridge.LinuxBridgePlugin.LinuxBridgePlugin/g" $QUANTUM_PLUGIN_INI_FILE
|
|
||||||
sudo sed -i -e "s/^connection = sqlite$/#connection = sqlite/g" $QUANTUM_LB_CONFIG_FILE
|
sudo sed -i -e "s/^connection = sqlite$/#connection = sqlite/g" $QUANTUM_LB_CONFIG_FILE
|
||||||
sudo sed -i -e "s/^#connection = mysql$/connection = mysql/g" $QUANTUM_LB_CONFIG_FILE
|
sudo sed -i -e "s/^#connection = mysql$/connection = mysql/g" $QUANTUM_LB_CONFIG_FILE
|
||||||
sudo sed -i -e "s/^user = .*$/user = $MYSQL_USER/g" $QUANTUM_LB_CONFIG_FILE
|
sudo sed -i -e "s/^user = .*$/user = $MYSQL_USER/g" $QUANTUM_LB_CONFIG_FILE
|
||||||
sudo sed -i -e "s/^pass = .*$/pass = $MYSQL_PASSWORD/g" $QUANTUM_LB_CONFIG_FILE
|
sudo sed -i -e "s/^pass = .*$/pass = $MYSQL_PASSWORD/g" $QUANTUM_LB_CONFIG_FILE
|
||||||
sudo sed -i -e "s/^host = .*$/host = $MYSQL_HOST/g" $QUANTUM_LB_CONFIG_FILE
|
sudo sed -i -e "s/^host = .*$/host = $MYSQL_HOST/g" $QUANTUM_LB_CONFIG_FILE
|
||||||
|
else
|
||||||
|
sudo sed -i -e "s/^sql_connection =.*$/sql_connection = mysql:\/\/$MYSQL_USER:$MYSQL_PASSWORD@$MYSQL_HOST\/quantum_linux_bridge?charset=utf8/g" $QUANTUM_LB_CONFIG_FILE
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "mysql must be enabled in order to use the $Q_PLUGIN Quantum plugin."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# Make sure we're using the linuxbridge plugin
|
||||||
|
sudo sed -i -e "s/^provider =.*$/provider = quantum.plugins.linuxbridge.LinuxBridgePlugin.LinuxBridgePlugin/g" $QUANTUM_PLUGIN_INI_FILE
|
||||||
fi
|
fi
|
||||||
if [[ -e $QUANTUM_DIR/etc/quantum.conf ]]; then
|
if [[ -e $QUANTUM_DIR/etc/quantum.conf ]]; then
|
||||||
sudo mv $QUANTUM_DIR/etc/quantum.conf $QUANTUM_CONF_DIR/quantum.conf
|
sudo mv $QUANTUM_DIR/etc/quantum.conf $QUANTUM_CONF_DIR/quantum.conf
|
||||||
@ -1103,6 +1113,17 @@ if is_service_enabled q-agt; then
|
|||||||
# Start up the quantum <-> linuxbridge agent
|
# Start up the quantum <-> linuxbridge agent
|
||||||
install_package bridge-utils
|
install_package bridge-utils
|
||||||
sudo sed -i -e "s/^physical_interface = .*$/physical_interface = $QUANTUM_LB_PRIVATE_INTERFACE/g" $QUANTUM_LB_CONFIG_FILE
|
sudo sed -i -e "s/^physical_interface = .*$/physical_interface = $QUANTUM_LB_PRIVATE_INTERFACE/g" $QUANTUM_LB_CONFIG_FILE
|
||||||
|
if grep -Fxq "user = " $QUANTUM_LB_CONFIG_FILE
|
||||||
|
then
|
||||||
|
sudo sed -i -e "s/^connection = sqlite$/#connection = sqlite/g" $QUANTUM_LB_CONFIG_FILE
|
||||||
|
sudo sed -i -e "s/^#connection = mysql$/connection = mysql/g" $QUANTUM_LB_CONFIG_FILE
|
||||||
|
sudo sed -i -e "s/^user = .*$/user = $MYSQL_USER/g" $QUANTUM_LB_CONFIG_FILE
|
||||||
|
sudo sed -i -e "s/^pass = .*$/pass = $MYSQL_PASSWORD/g" $QUANTUM_LB_CONFIG_FILE
|
||||||
|
sudo sed -i -e "s/^host = .*$/host = $MYSQL_HOST/g" $QUANTUM_LB_CONFIG_FILE
|
||||||
|
else
|
||||||
|
sudo sed -i -e "s/^sql_connection =.*$/sql_connection = mysql:\/\/$MYSQL_USER:$MYSQL_PASSWORD@$MYSQL_HOST\/quantum_linux_bridge?charset=utf8/g" $QUANTUM_LB_CONFIG_FILE
|
||||||
|
fi
|
||||||
|
|
||||||
screen_it q-agt "sleep 4; sudo python $QUANTUM_DIR/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py $QUANTUM_LB_CONFIG_FILE -v"
|
screen_it q-agt "sleep 4; sudo python $QUANTUM_DIR/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py $QUANTUM_LB_CONFIG_FILE -v"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user