Browse code

wait for head node to start before starting compute hosts

Anthony Young authored on 2011/09/16 16:28:23
Showing 1 changed files
... ...
@@ -19,6 +19,13 @@ function run_lxc {
19 19
 # Launch the head node - headnode uses a non-ip domain name,
20 20
 # because rabbit won't launch with an ip addr hostname :(
21 21
 run_lxc STACKMASTER $HEAD_HOST "ENABLED_SERVICES=g-api,g-reg,key,n-api,n-sch,n-vnc,dash,mysql,rabbit"
22
+
23
+# Wait till the head node is up
24
+while ! wget -O - http://$HEAD_HOST | grep -q username; do
25
+    echo "Waiting for head node ($HEAD_HOST) to start..."
26
+    sleep 5
27
+done
28
+
22 29
 for compute_host in ${COMPUTE_HOSTS//,/ }; do
23 30
     # Launch the compute hosts
24 31
     run_lxc $compute_host $compute_host "ENABLED_SERVICES=n-cpu,n-net,n-api"