diff --git a/functions b/functions index 6f2164a777..d55cd74609 100644 --- a/functions +++ b/functions @@ -407,6 +407,26 @@ EOF return $rval } +function wait_for_compute { + local timeout=$1 + local rval=0 + time_start "wait_for_service" + timeout $timeout bash -x < 30 seconds + # happen between here and the script ending. However, in multinode + # tests this can very often not be the case. So ensure that the + # compute is up before we move on. + if is_service_enabled n-cell; then + # cells v1 can't complete the check below because it munges + # hostnames with cell information (grumble grumble). + return + fi + # TODO(sdague): honestly, this probably should be a plug point for + # an external system. + if [[ "$VIRT_DRIVER" == 'xenserver' ]]; then + # xenserver encodes information in the hostname of the compute + # because of the dom0/domU split. Just ignore for now. + return + fi + wait_for_compute 60 +} + function start_nova { # this catches the cells v1 case early _set_singleconductor diff --git a/stack.sh b/stack.sh index 301e1e7c6b..1e5bc51f01 100755 --- a/stack.sh +++ b/stack.sh @@ -1431,6 +1431,13 @@ fi # Sanity checks # ============= +# Check that computes are all ready +# +# TODO(sdague): there should be some generic phase here. +if is_service_enabled n-cpu; then + is_nova_ready +fi + # Check the status of running services service_check