From 25ae0be2f914cbaefcf144f0fe20c89c8adbe1fa Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Wed, 24 Feb 2021 11:54:36 +0000 Subject: [PATCH] CI: display VM console log on ping or SSH failure Also increase attempts to 12, in line with Kolla Ansible CI. Change-Id: I81cabf27f44af3c8135efe8e427db1ffee5f0091 --- dev/functions | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dev/functions b/dev/functions index 2a3b0ae48..46171c7ad 100644 --- a/dev/functions +++ b/dev/functions @@ -516,12 +516,14 @@ function overcloud_test { openstack server add floating ip ${name} ${ip} fi echo "$name: Waiting for ping and SSH access via ${ip}" - attempts=6 + attempts=12 for i in $(seq 1 $attempts); do if ping -c1 -W1 $ip && ssh -v -o StrictHostKeyChecking=no -o BatchMode=yes cirros@$ip hostname; then break elif [[ $i -eq $attempts ]]; then echo "Failed to access server $name via SSH after $attempts attempts" + echo "Console log:" + openstack console log show ${name} return 1 else echo "Cannot access server $name - retrying"