Properly wait for Openstack services to be ready

Just checking for an account in keystone is pointless since nova and
neutron take way more time before they are fully operational. If the user
would continue as tools/kolla suggests, the init-runonce script would
fail because either nova or neutron would not be ready for service.

Change-Id: I8fbfaa16d961b418b9ac6a34d311adb8e41b61e9
Closes-bug: #1471331
This commit is contained in:
Harm Weites 2015-07-10 20:44:04 +02:00
parent bd1e41a767
commit aef25bbaa8

View File

@ -75,12 +75,18 @@ function pre_start {
}
function post_start {
until keystone user-list | grep glance; do
echo "Waiting for OpenStack services to become available"
echo -n "Waiting for OpenStack services to become available"
until [ $(nova service-list 2>&1 | grep -c enabled) -ge 4 ]; do
echo -n .
sleep 2
done
sleep 3
until [ $(neutron agent-list 2>&1 | grep -c ':-)') -ge 4 ]; do
echo -n .
sleep 2
done
echo " done"
echo Example Usage:
echo source openrc # source keystone credentials