Change-Id: I3961a007b10aed5ef47422bcf0eedd43d35a2cff
Jason Kölker authored on 2012/01/24 02:17:27... | ... |
@@ -184,6 +184,8 @@ SWIFT_DIR=$DEST/swift |
184 | 184 |
SWIFT_KEYSTONE_DIR=$DEST/swift-keystone2 |
185 | 185 |
QUANTUM_DIR=$DEST/quantum |
186 | 186 |
QUANTUM_CLIENT_DIR=$DEST/python-quantumclient |
187 |
+MELANGE_DIR=$DEST/melange |
|
188 |
+MELANGECLIENT_DIR=$DEST/python-melangeclient |
|
187 | 189 |
|
188 | 190 |
# Default Quantum Plugin |
189 | 191 |
Q_PLUGIN=${Q_PLUGIN:-openvswitch} |
... | ... |
@@ -192,6 +194,13 @@ Q_PORT=${Q_PORT:-9696} |
192 | 192 |
# Default Quantum Host |
193 | 193 |
Q_HOST=${Q_HOST:-localhost} |
194 | 194 |
|
195 |
+# Default Melange Port |
|
196 |
+M_PORT=${M_PORT:-9898} |
|
197 |
+# Default Melange Host |
|
198 |
+M_HOST=${M_HOST:-localhost} |
|
199 |
+# Melange MAC Address Range |
|
200 |
+M_MAC_RANGE=${M_MAC_RANGE:-404040/24} |
|
201 |
+ |
|
195 | 202 |
# Specify which services to launch. These generally correspond to screen tabs |
196 | 203 |
ENABLED_SERVICES=${ENABLED_SERVICES:-g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-sch,n-novnc,n-xvnc,n-cauth,horizon,mysql,rabbit} |
197 | 204 |
|
... | ... |
@@ -330,6 +339,13 @@ FLAT_INTERFACE=${FLAT_INTERFACE:-eth0} |
330 | 330 |
# |
331 | 331 |
# With Quantum networking the NET_MAN variable is ignored. |
332 | 332 |
|
333 |
+# Using Melange IPAM: |
|
334 |
+# |
|
335 |
+# Make sure that quantum and melange are enabled in ENABLED_SERVICES. |
|
336 |
+# If they are then the melange IPAM lib will be set in the QuantumManager. |
|
337 |
+# Adding m-svc to ENABLED_SERVICES will start the melange service on this |
|
338 |
+# host. |
|
339 |
+ |
|
333 | 340 |
|
334 | 341 |
# MySQL & RabbitMQ |
335 | 342 |
# ---------------- |
... | ... |
@@ -622,6 +638,15 @@ if [[ "$ENABLED_SERVICES" =~ "q-svc" ]]; then |
622 | 622 |
git_clone $QUANTUM_CLIENT_REPO $QUANTUM_CLIENT_DIR $QUANTUM_CLIENT_BRANCH |
623 | 623 |
fi |
624 | 624 |
|
625 |
+if [[ "$ENABLED_SERVICES" =~ "m-svc" ]]; then |
|
626 |
+ # melange |
|
627 |
+ git_clone $MELANGE_REPO $MELANGE_DIR $MELANGE_BRANCH |
|
628 |
+fi |
|
629 |
+ |
|
630 |
+if [[ "$ENABLED_SERVICES" =~ "melange" ]]; then |
|
631 |
+ git_clone $MELANGECLIENT_REPO $MELANGECLIENT_DIR $MELANGECLIENT_BRANCH |
|
632 |
+fi |
|
633 |
+ |
|
625 | 634 |
# Initialization |
626 | 635 |
# ============== |
627 | 636 |
|
... | ... |
@@ -652,6 +677,12 @@ fi |
652 | 652 |
if [[ "$ENABLED_SERVICES" =~ "q-svc" ]]; then |
653 | 653 |
cd $QUANTUM_DIR; sudo python setup.py develop |
654 | 654 |
fi |
655 |
+if [[ "$ENABLED_SERVICES" =~ "m-svc" ]]; then |
|
656 |
+ cd $MELANGE_DIR; sudo python setup.py develop |
|
657 |
+fi |
|
658 |
+if [[ "$ENABLED_SERVICES" =~ "melange" ]]; then |
|
659 |
+ cd $MELANGECLIENT_DIR; sudo python setup.py develop |
|
660 |
+fi |
|
655 | 661 |
|
656 | 662 |
# Syslog |
657 | 663 |
# --------- |
... | ... |
@@ -1153,6 +1184,13 @@ if [[ "$ENABLED_SERVICES" =~ "quantum" ]]; then |
1153 | 1153 |
add_nova_flag "--network_manager=nova.network.quantum.manager.QuantumManager" |
1154 | 1154 |
add_nova_flag "--quantum_connection_host=$Q_HOST" |
1155 | 1155 |
add_nova_flag "--quantum_connection_port=$Q_PORT" |
1156 |
+ |
|
1157 |
+ if [[ "$ENABLED_SERVICES" =~ "melange" ]]; then |
|
1158 |
+ add_nova_flag "--quantum_ipam_lib=nova.network.quantum.melange_ipam_lib" |
|
1159 |
+ add_nova_flag "--use_melange_mac_generation" |
|
1160 |
+ add_nova_flag "--melange_host=$M_HOST" |
|
1161 |
+ add_nova_flag "--melange_port=$M_PORT" |
|
1162 |
+ fi |
|
1156 | 1163 |
if [[ "$ENABLED_SERVICES" =~ "q-svc" && "$Q_PLUGIN" = "openvswitch" ]]; then |
1157 | 1164 |
add_nova_flag "--libvirt_vif_type=ethernet" |
1158 | 1165 |
add_nova_flag "--libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtOpenVswitchDriver" |
... | ... |
@@ -1408,6 +1446,28 @@ if [[ "$ENABLED_SERVICES" =~ "q-agt" ]]; then |
1408 | 1408 |
|
1409 | 1409 |
fi |
1410 | 1410 |
|
1411 |
+# Melange service |
|
1412 |
+if [[ "$ENABLED_SERVICES" =~ "m-svc" ]]; then |
|
1413 |
+ if [[ "$ENABLED_SERVICES" =~ "mysql" ]]; then |
|
1414 |
+ mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'DROP DATABASE IF EXISTS melange;' |
|
1415 |
+ mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'CREATE DATABASE melange;' |
|
1416 |
+ else |
|
1417 |
+ echo "mysql must be enabled in order to use the $Q_PLUGIN Quantum plugin." |
|
1418 |
+ exit 1 |
|
1419 |
+ fi |
|
1420 |
+ MELANGE_CONFIG_FILE=$MELANGE_DIR/etc/melange/melange.conf |
|
1421 |
+ cp $MELANGE_CONFIG_FILE.sample $MELANGE_CONFIG_FILE |
|
1422 |
+ sed -i -e "s/^sql_connection =.*$/sql_connection = mysql:\/\/$MYSQL_USER:$MYSQL_PASSWORD@$MYSQL_HOST\/melange/g" $MELANGE_CONFIG_FILE |
|
1423 |
+ cd $MELANGE_DIR && PYTHONPATH=.:$PYTHONPATH python $MELANGE_DIR/bin/melange-manage --config-file=$MELANGE_CONFIG_FILE db_sync |
|
1424 |
+ screen_it m-svc "cd $MELANGE_DIR && PYTHONPATH=.:$PYTHONPATH python $MELANGE_DIR/bin/melange-server --config-file=$MELANGE_CONFIG_FILE" |
|
1425 |
+ echo "Waiting for melange to start..." |
|
1426 |
+ if ! timeout $SERVICE_TIMEOUT sh -c "while ! http_proxy= wget -q -O- http://127.0.0.1:9898; do sleep 1; done"; then |
|
1427 |
+ echo "melange-server did not start" |
|
1428 |
+ exit 1 |
|
1429 |
+ fi |
|
1430 |
+ melange mac_address_range create cidr=$M_MAC_RANGE |
|
1431 |
+fi |
|
1432 |
+ |
|
1411 | 1433 |
# If we're using Quantum (i.e. q-svc is enabled), network creation has to |
1412 | 1434 |
# happen after we've started the Quantum service. |
1413 | 1435 |
if [[ "$ENABLED_SERVICES" =~ "mysql" ]]; then |
... | ... |
@@ -1425,6 +1485,7 @@ if [[ "$ENABLED_SERVICES" =~ "mysql" ]]; then |
1425 | 1425 |
fi |
1426 | 1426 |
fi |
1427 | 1427 |
|
1428 |
+ |
|
1428 | 1429 |
# Launching nova-compute should be as simple as running ``nova-compute`` but |
1429 | 1430 |
# have to do a little more than that in our script. Since we add the group |
1430 | 1431 |
# ``libvirtd`` to our user in this script, when nova-compute is run it is |
... | ... |
@@ -46,6 +46,14 @@ QUANTUM_CLIENT_BRANCH=master |
46 | 46 |
TEMPEST_REPO=https://github.com/openstack/tempest.git |
47 | 47 |
TEMPEST_BRANCH=master |
48 | 48 |
|
49 |
+# melange service |
|
50 |
+MELANGE_REPO=https://github.com/openstack/melange.git |
|
51 |
+MELANGE_BRANCH=master |
|
52 |
+ |
|
53 |
+# python melange client library |
|
54 |
+MELANGECLIENT_REPO=https://github.com/openstack/python-melangeclient.git |
|
55 |
+MELANGECLIENT_BRANCH=master |
|
56 |
+ |
|
49 | 57 |
# Specify a comma-separated list of uec images to download and install into glance. |
50 | 58 |
# supported urls here are: |
51 | 59 |
# * "uec-style" images: |
... | ... |
@@ -56,7 +64,7 @@ TEMPEST_BRANCH=master |
56 | 56 |
# * disk image (*.img,*.img.gz) |
57 | 57 |
# if file ends in .img, then it will be uploaded and registered as a to |
58 | 58 |
# glance as a disk image. If it ends in .gz, it is uncompressed first. |
59 |
-# example: |
|
59 |
+# example: |
|
60 | 60 |
# http://cloud-images.ubuntu.com/releases/oneiric/release/ubuntu-11.10-server-cloudimg-armel-disk1.img |
61 | 61 |
# http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-rootfs.img.gz |
62 | 62 |
#IMAGE_URLS="http://smoser.brickies.net/ubuntu/ttylinux-uec/ttylinux-uec-amd64-11.2_2.6.35-15_1.tar.gz" # old ttylinux-uec image |