| ... | ... |
@@ -1,4 +1,5 @@ |
| 1 | 1 |
#!/usr/bin/env bash |
| 2 |
+ |
|
| 2 | 3 |
# Configurable params |
| 3 | 4 |
BRIDGE=${BRIDGE:-br0}
|
| 4 | 5 |
CONTAINER=${CONTAINER:-STACK}
|
| ... | ... |
@@ -49,9 +50,13 @@ if [ -d /cgroup/$CONTAINER ]; then |
| 49 | 49 |
cgdelete -r cpu,net_cls:$CONTAINER |
| 50 | 50 |
fi |
| 51 | 51 |
|
| 52 |
+ |
|
| 52 | 53 |
# Warm the base image on first install |
| 53 | 54 |
CACHEDIR=/var/cache/lxc/natty/rootfs-amd64 |
| 54 | 55 |
if [ ! -d $CACHEDIR ]; then |
| 56 |
+ # by deleting the container, we force lxc-create to re-bootstrap (lxc is |
|
| 57 |
+ # lazy and doesn't do anything if a container already exists) |
|
| 58 |
+ lxc-destroy -n $CONTAINER |
|
| 55 | 59 |
# trigger the initial debootstrap |
| 56 | 60 |
lxc-create -n $CONTAINER -t natty -f $LXC_CONF |
| 57 | 61 |
chroot $CACHEDIR apt-get update |
| ... | ... |
@@ -61,14 +61,8 @@ QUANTUM_PORT = '9696' |
| 61 | 61 |
QUANTUM_TENANT = '1234' |
| 62 | 62 |
QUANTUM_CLIENT_VERSION='0.1' |
| 63 | 63 |
|
| 64 |
-# If you have external monitoring links |
|
| 65 |
-EXTERNAL_MONITORING = [ |
|
| 66 |
- ['Nagios','http://foo.com'], |
|
| 67 |
- ['Ganglia','http://bar.com'], |
|
| 68 |
-] |
|
| 69 |
- |
|
| 70 |
-# If you do not have external monitoring links |
|
| 71 |
-# EXTERNAL_MONITORING = [] |
|
| 64 |
+# We use nixon to embed instead of external monitoring links |
|
| 65 |
+EXTERNAL_MONITORING = [] |
|
| 72 | 66 |
|
| 73 | 67 |
# Uncomment the following segment to silence most logging |
| 74 | 68 |
# django.db and boto DEBUG logging is extremely verbose. |
| ... | ... |
@@ -293,7 +293,7 @@ if [[ "$ENABLED_SERVICES" =~ "n-cpu" ]]; then |
| 293 | 293 |
# qcow images) and kvm (hardware based virtualization). If unable to |
| 294 | 294 |
# load kvm, set the libvirt type to qemu. |
| 295 | 295 |
sudo modprobe nbd || true |
| 296 |
- if ! sudo modprobe kvm; then |
|
| 296 |
+ if ! -e /dev/kvm; then |
|
| 297 | 297 |
LIBVIRT_TYPE=qemu |
| 298 | 298 |
fi |
| 299 | 299 |
# User needs to be member of libvirtd group for nova-compute to use libvirt. |
| ... | ... |
@@ -408,10 +408,33 @@ function screen_it {
|
| 408 | 408 |
screen -d -m -S nova -t nova |
| 409 | 409 |
sleep 1 |
| 410 | 410 |
|
| 411 |
-screen_it g-api "cd $GLANCE_DIR; bin/glance-api --config-file=etc/glance-api.conf" |
|
| 412 |
-screen_it g-reg "cd $GLANCE_DIR; bin/glance-registry --config-file=etc/glance-registry.conf" |
|
| 413 |
-screen_it key "$KEYSTONE_DIR/bin/keystone --config-file $KEYSTONE_CONF" |
|
| 414 |
-screen_it n-api "$NOVA_DIR/bin/nova-api" |
|
| 411 |
+if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then |
|
| 412 |
+ screen_it g-reg "cd $GLANCE_DIR; bin/glance-registry --config-file=etc/glance-registry.conf" |
|
| 413 |
+fi |
|
| 414 |
+ |
|
| 415 |
+if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then |
|
| 416 |
+ screen_it g-api "cd $GLANCE_DIR; bin/glance-api --config-file=etc/glance-api.conf" |
|
| 417 |
+ while ! wget -q -O- http://$GLANCE_HOSTPORT; do |
|
| 418 |
+ echo "Waiting for g-api ($GLANCE_HOSTPORT) to start..." |
|
| 419 |
+ sleep 1 |
|
| 420 |
+ done |
|
| 421 |
+fi |
|
| 422 |
+ |
|
| 423 |
+if [[ "$ENABLED_SERVICES" =~ "key" ]]; then |
|
| 424 |
+ screen_it key "$KEYSTONE_DIR/bin/keystone --config-file $KEYSTONE_CONF" |
|
| 425 |
+ while ! wget -q -O- http://127.0.0.1:5000; do |
|
| 426 |
+ echo "Waiting for keystone to start..." |
|
| 427 |
+ sleep 1 |
|
| 428 |
+ done |
|
| 429 |
+fi |
|
| 430 |
+ |
|
| 431 |
+if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then |
|
| 432 |
+ screen_it n-api "$NOVA_DIR/bin/nova-api" |
|
| 433 |
+ while ! wget -q -O- http://127.0.0.1:8774; do |
|
| 434 |
+ echo "Waiting for nova-api to start..." |
|
| 435 |
+ sleep 1 |
|
| 436 |
+ done |
|
| 437 |
+fi |
|
| 415 | 438 |
# Launching nova-compute should be as simple as running ``nova-compute`` but |
| 416 | 439 |
# have to do a little more than that in our script. Since we add the group |
| 417 | 440 |
# ``libvirtd`` to our user in this script, when nova-compute is run it is |