Merge "Wait for compute service to check in"
This commit is contained in:
commit
a7623994bc
20
functions
20
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 <<EOF || rval=$?
|
||||
ID=""
|
||||
while [[ "\$ID" == "" ]]; do
|
||||
sleep 1
|
||||
ID=\$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" compute service list --host `hostname` --service nova-compute -c ID -f value)
|
||||
done
|
||||
EOF
|
||||
time_stop "wait_for_service"
|
||||
# Figure out what's happening on platforms where this doesn't work
|
||||
if [[ "$rval" != 0 ]]; then
|
||||
echo "Didn't find service registered by hostname after $timeout seconds"
|
||||
openstack --os-cloud devstack-admin --os-region "$REGION_NAME" compute service list
|
||||
fi
|
||||
return $rval
|
||||
}
|
||||
|
||||
|
||||
# ping check
|
||||
# Uses globals ``ENABLED_SERVICES``, ``TOP_DIR``, ``MULTI_HOST``, ``PRIVATE_NETWORK``
|
||||
|
22
lib/nova
22
lib/nova
@ -955,6 +955,28 @@ function start_nova_conductor {
|
||||
done
|
||||
}
|
||||
|
||||
function is_nova_ready {
|
||||
# NOTE(sdague): with cells v2 all the compute services must be up
|
||||
# and checked into the database before discover_hosts is run. This
|
||||
# happens in all in one installs by accident, because > 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
|
||||
|
Loading…
Reference in New Issue
Block a user