From cbbf718fa96569dc5216c7b8c0023bbd6da7a0f0 Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Fri, 16 Sep 2011 00:28:23 -0700 Subject: [PATCH] wait for head node to start before starting compute hosts --- build_lxc_multi.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build_lxc_multi.sh b/build_lxc_multi.sh index b26cabf..5a37845 100755 --- a/build_lxc_multi.sh +++ b/build_lxc_multi.sh @@ -19,6 +19,13 @@ function run_lxc { # Launch the head node - headnode uses a non-ip domain name, # because rabbit won't launch with an ip addr hostname :( run_lxc STACKMASTER $HEAD_HOST "ENABLED_SERVICES=g-api,g-reg,key,n-api,n-sch,n-vnc,dash,mysql,rabbit" + +# Wait till the head node is up +while ! wget -O - http://$HEAD_HOST | grep -q username; do + echo "Waiting for head node ($HEAD_HOST) to start..." + sleep 5 +done + for compute_host in ${COMPUTE_HOSTS//,/ }; do # Launch the compute hosts run_lxc $compute_host $compute_host "ENABLED_SERVICES=n-cpu,n-net,n-api"