]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: retry when 'vagrant up' fails 23809/head
authorAndrew Schoen <aschoen@redhat.com>
Wed, 22 Aug 2018 20:37:46 +0000 (16:37 -0400)
committerAlfredo Deza <adeza@redhat.com>
Wed, 29 Aug 2018 19:15:15 +0000 (12:15 -0700)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
(cherry picked from commit 2c88e70877dcc2a04a69be4ab9c4834d5ced6198)

src/ceph-volume/ceph_volume/tests/functional/batch/tox.ini
src/ceph-volume/ceph_volume/tests/functional/lvm/tox.ini
src/ceph-volume/ceph_volume/tests/functional/scripts/vagrant_up.sh [new file with mode: 0644]
src/ceph-volume/ceph_volume/tests/functional/simple/tox.ini

index 37a9c1819ab3ebec00395c8d1bf0aa2859dabba5..6a43a110e47eb540e13ffddcdf5243a0fea79907 100644 (file)
@@ -34,7 +34,7 @@ changedir=
 commands=
   git clone -b {env:CEPH_ANSIBLE_BRANCH:master} --single-branch https://github.com/ceph/ceph-ansible.git {envdir}/tmp/ceph-ansible
 
-  vagrant up {env:VAGRANT_UP_FLAGS:"--no-provision"} {posargs:--provider=virtualbox}
+  bash {toxinidir}/../scripts/vagrant_up.sh {env:VAGRANT_UP_FLAGS:"--no-provision"} {posargs:--provider=virtualbox}
   bash {toxinidir}/../scripts/generate_ssh_config.sh {changedir}
 
   cp {toxinidir}/../playbooks/deploy.yml {envdir}/tmp/ceph-ansible
index 9d0f75db0eaca8ae47cc31090bd099dfa28eb86e..3e451aab57d8125948b1b02097d427e21fe4b61b 100644 (file)
@@ -8,6 +8,7 @@ whitelist_externals =
     bash
     git
     cp
+    sleep
 passenv=*
 setenv=
   ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config
@@ -45,7 +46,7 @@ commands=
   # but the master branch doesn't pin dependencies so we can't guarantee to work correctly
   #pip install -r {envdir}/tmp/ceph-ansible/requirements.txt
 
-  vagrant up --no-provision {posargs:--provider=virtualbox}
+  bash {toxinidir}/../scripts/vagrant_up.sh {env:VAGRANT_UP_FLAGS:"--no-provision"} {posargs:--provider=virtualbox}
   bash {toxinidir}/../scripts/generate_ssh_config.sh {changedir}
 
   # create logical volumes to test with on the vms
diff --git a/src/ceph-volume/ceph_volume/tests/functional/scripts/vagrant_up.sh b/src/ceph-volume/ceph_volume/tests/functional/scripts/vagrant_up.sh
new file mode 100644 (file)
index 0000000..2f9a15f
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+retries=0
+until [ $retries -ge 5 ]
+do
+  echo "Attempting to start VMs. Attempts: $retries"
+  timeout 10m vagrant up "$@" && break
+  retries=$[$retries+1]
+  sleep 5
+done
+
+sleep 10
index e9e80079feb7752e6392e197998535c6b54b3594..1e813cedf5d1c07d0189f181e041da5adfda3a1f 100644 (file)
@@ -42,7 +42,7 @@ commands=
   # but the master branch doesn't pin dependencies so we can't guarantee to work correctly
   #pip install -r {envdir}/tmp/ceph-ansible/requirements.txt
 
-  vagrant up --no-provision {posargs:--provider=virtualbox}
+  bash {toxinidir}/../scripts/vagrant_up.sh {env:VAGRANT_UP_FLAGS:"--no-provision"} {posargs:--provider=virtualbox}
   bash {toxinidir}/../scripts/generate_ssh_config.sh {changedir}
 
   cp {toxinidir}/../playbooks/deploy.yml {envdir}/tmp/ceph-ansible