From aef25bbaa84e7d490681e4aeeda08f07b3af1ab4 Mon Sep 17 00:00:00 2001 From: Harm Weites Date: Fri, 10 Jul 2015 20:44:04 +0200 Subject: [PATCH] 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 --- tools/kolla | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/kolla b/tools/kolla index 62193d9d92..f26aaf8010 100755 --- a/tools/kolla +++ b/tools/kolla @@ -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