From 3c6954642a3d25db5f5814261c0a4c21a0178607 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Thu, 10 Dec 2015 11:55:53 -0800 Subject: [PATCH] buildpackages: catch instance creation failure. Split the sleep from the server creation, so we catch 'server create' failures (eg due to quota): > Quota exceeded for cores: Requested 16, but already used 10 of 20 cores > (HTTP 403) (Request-ID: req-6467934e-db50-4479-995c-4d44dedf553a) Signed-off-by: Robin H. Johnson --- tasks/buildpackages/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tasks/buildpackages/Makefile b/tasks/buildpackages/Makefile index 0ac5e54b9dde9..b7efca99fc730 100644 --- a/tasks/buildpackages/Makefile +++ b/tasks/buildpackages/Makefile @@ -26,7 +26,8 @@ ${HOME}/.ssh_agent: grep -q ssh_agent ~/.bashrc_teuthology || echo 'source ${HOME}/.ssh_agent' >> ~/.bashrc_teuthology flock-packages-repository: - openstack server create --image 'teuthology-ubuntu-14.04' --flavor ${HTTP_FLAVOR} --key-name teuthology --security-group teuthology --property ownedby=${MY_IP} --wait packages-repository ; sleep 30 + openstack server create --image 'teuthology-ubuntu-14.04' --flavor ${HTTP_FLAVOR} --key-name teuthology --security-group teuthology --property ownedby=${MY_IP} --wait packages-repository + sleep 30 ip=$(call get_ip,packages-repository) ; \ ssh $$ip sudo apt-get update ; \ ssh $$ip sudo apt-get install -y nginx ; \ @@ -40,7 +41,8 @@ packages-repository: touch ${D}/$@ ceph-${CEPH_PKG_TYPE}-${CEPH_DIST}-${CEPH_ARCH}-${CEPH_FLAVOR}-${CEPH_SHA1}: packages-repository - openstack server create --image 'teuthology-${CEPH_OS_TYPE}-${CEPH_OS_VERSION}' --flavor ${BUILD_FLAVOR} --key-name teuthology --security-group teuthology --property ownedby=${MY_IP} --user-data ${CEPH_OS_TYPE}-${CEPH_OS_VERSION}-user-data.txt --wait $@ ; sleep 30 + openstack server create --image 'teuthology-${CEPH_OS_TYPE}-${CEPH_OS_VERSION}' --flavor ${BUILD_FLAVOR} --key-name teuthology --security-group teuthology --property ownedby=${MY_IP} --user-data ${CEPH_OS_TYPE}-${CEPH_OS_VERSION}-user-data.txt --wait $@ + sleep 30 set -ex ; \ trap "openstack server delete --wait $@" EXIT ; \ ip=$(call get_ip,$@) ; \ -- 2.39.5