Skip to content

Commit ac00c84

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Add support for specifying an alternate Quantum host/port"
2 parents e625d69 + f1f3a8f commit ac00c84

1 file changed

Lines changed: 21 additions & 16 deletions

File tree

stack.sh

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ QUANTUM_DIR=$DEST/quantum
154154

155155
# Default Quantum Plugin
156156
Q_PLUGIN=${Q_PLUGIN:-openvswitch}
157+
# Default Quantum Port
158+
Q_PORT=${Q_PORT:-9696}
159+
# Default Quantum Host
160+
Q_HOST=${Q_HOST:-localhost}
157161

158162
# Specify which services to launch. These generally correspond to screen tabs
159163
ENABLED_SERVICES=${ENABLED_SERVICES:-g-api,g-reg,key,n-api,n-cpu,n-net,n-sch,n-vnc,horizon,mysql,rabbit,openstackx}
@@ -281,8 +285,9 @@ FLAT_INTERFACE=${FLAT_INTERFACE:-eth0}
281285

282286
# Using Quantum networking:
283287
#
284-
# Make sure that q-svc is enabled in ENABLED_SERVICES. If it is the network
285-
# manager will be set to the QuantumManager.
288+
# Make sure that quantum is enabled in ENABLED_SERVICES. If it is the network
289+
# manager will be set to the QuantumManager. If you want to run Quantum on
290+
# this host, make sure that q-svc is also in ENABLED_SERVICES.
286291
#
287292
# If you're planning to use the Quantum openvswitch plugin, set Q_PLUGIN to
288293
# "openvswitch" and make sure the q-agt service is enabled in
@@ -532,7 +537,7 @@ if [[ "$ENABLED_SERVICES" =~ "openstackx" ]]; then
532537
# that is *deprecated*. The code is being moved into python-novaclient & nova.
533538
git_clone $OPENSTACKX_REPO $OPENSTACKX_DIR $OPENSTACKX_BRANCH
534539
fi
535-
if [[ "$ENABLED_SERVICES" =~ "quantum" ]]; then
540+
if [[ "$ENABLED_SERVICES" =~ "q-svc" ]]; then
536541
# quantum
537542
git_clone $QUANTUM_REPO $QUANTUM_DIR $QUANTUM_BRANCH
538543
fi
@@ -566,7 +571,7 @@ if [[ "$ENABLED_SERVICES" =~ "horizon" ]]; then
566571
cd $HORIZON_DIR/horizon; sudo python setup.py develop
567572
cd $HORIZON_DIR/openstack-dashboard; sudo python setup.py develop
568573
fi
569-
if [[ "$ENABLED_SERVICES" =~ "quantum" ]]; then
574+
if [[ "$ENABLED_SERVICES" =~ "q-svc" ]]; then
570575
cd $QUANTUM_DIR; sudo python setup.py develop
571576
fi
572577

@@ -985,9 +990,11 @@ add_nova_flag "--allow_admin_api"
985990
add_nova_flag "--scheduler_driver=$SCHEDULER"
986991
add_nova_flag "--dhcpbridge_flagfile=$NOVA_DIR/bin/nova.conf"
987992
add_nova_flag "--fixed_range=$FIXED_RANGE"
988-
if [[ "$ENABLED_SERVICES" =~ "q-svc" ]]; then
993+
if [[ "$ENABLED_SERVICES" =~ "quantum" ]]; then
989994
add_nova_flag "--network_manager=nova.network.quantum.manager.QuantumManager"
990-
if [[ "$Q_PLUGIN" = "openvswitch" ]]; then
995+
add_nova_flag "--quantum_connection_host=$Q_HOST"
996+
add_nova_flag "--quantum_connection_port=$Q_PORT"
997+
if [[ "$ENABLED_SERVICES" =~ "q-svc" && "$Q_PLUGIN" = "openvswitch" ]]; then
991998
add_nova_flag "--libvirt_vif_type=ethernet"
992999
add_nova_flag "--libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtOpenVswitchDriver"
9931000
add_nova_flag "--linuxnet_interface_driver=nova.network.linux_net.LinuxOVSInterfaceDriver"
@@ -1175,25 +1182,23 @@ if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then
11751182
fi
11761183
fi
11771184

1178-
# Quantum
1185+
# Quantum service
11791186
if [[ "$ENABLED_SERVICES" =~ "q-svc" ]]; then
1180-
# Install deps
1181-
# FIXME add to files/apts/quantum, but don't install if not needed!
1182-
apt_get install openvswitch-switch openvswitch-datapath-dkms
1183-
1184-
# Create database for the plugin/agent
11851187
if [[ "$Q_PLUGIN" = "openvswitch" ]]; then
1188+
# Install deps
1189+
# FIXME add to files/apts/quantum, but don't install if not needed!
1190+
apt_get install openvswitch-switch openvswitch-datapath-dkms
1191+
# Create database for the plugin/agent
11861192
if [[ "$ENABLED_SERVICES" =~ "mysql" ]]; then
11871193
mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'CREATE DATABASE IF NOT EXISTS ovs_quantum;'
11881194
else
11891195
echo "mysql must be enabled in order to use the $Q_PLUGIN Quantum plugin."
11901196
exit 1
11911197
fi
1198+
QUANTUM_PLUGIN_INI_FILE=$QUANTUM_DIR/etc/plugins.ini
1199+
# Make sure we're using the openvswitch plugin
1200+
sed -i -e "s/^provider =.*$/provider = quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPlugin/g" $QUANTUM_PLUGIN_INI_FILE
11921201
fi
1193-
1194-
QUANTUM_PLUGIN_INI_FILE=$QUANTUM_DIR/etc/plugins.ini
1195-
# Make sure we're using the openvswitch plugin
1196-
sed -i -e "s/^provider =.*$/provider = quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPlugin/g" $QUANTUM_PLUGIN_INI_FILE
11971202
screen_it q-svc "cd $QUANTUM_DIR && PYTHONPATH=.:$PYTHONPATH python $QUANTUM_DIR/bin/quantum-server $QUANTUM_DIR/etc/quantum.conf"
11981203
fi
11991204

0 commit comments

Comments
 (0)