summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCsaba Henk <chenk@redhat.com>2015-09-24 12:30:36 +0200
committerCsaba Henk <chenk@redhat.com>2015-09-24 12:42:32 +0200
commit9110aa631b332b219e6a4165be8faaac8f320b66 (patch)
tree15f2e6810f60947adc2543fcae7f6160140da487
parent8f92d699808033b49a8f3a4f6aaeac585f0825a1 (diff)
retry mkfs.xfs until subject LV becomes available (or a time bound is reached)
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: Ramana Raja <rraja@redhat.com> Workflow+1: Ramana Raja <rraja@redhat.com> Submitted-by: Jenkins Submitted-at: Thu, 24 Sep 2015 11:31:20 +0000 Reviewed-on: https://review.openstack.org/227214 Project: stackforge/devstack-plugin-glusterfs Branch: refs/heads/master
-rwxr-xr-xdevstack/gluster-functions.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/devstack/gluster-functions.sh b/devstack/gluster-functions.sh
index 853d38b..4383d56 100755
--- a/devstack/gluster-functions.sh
+++ b/devstack/gluster-functions.sh
@@ -225,7 +225,21 @@ function _create_thin_lv_gluster_vol {
225 sudo lvcreate -V $vol_size -T $GLUSTERFS_VG_NAME/$GLUSTERFS_THIN_POOL_NAME -n $vol_name 225 sudo lvcreate -V $vol_size -T $GLUSTERFS_VG_NAME/$GLUSTERFS_THIN_POOL_NAME -n $vol_name
226 226
227 # Format the LV. 227 # Format the LV.
228 sudo mkfs.xfs -i size=512 /dev/$GLUSTERFS_VG_NAME/$vol_name 228 local mkfs_result=0
229 for i in `seq 100`; do
230 mkfs_result=0
231 sudo mkfs.xfs -i size=512 /dev/$GLUSTERFS_VG_NAME/$vol_name || mkfs_result=$?
232 [ $mkfs_result -eq 0 ] && break
233 sleep 0.1
234 done
235 local mkfs_duration="$((i/10)).$((i%10))"
236 if [ $mkfs_result -eq 0 ]; then
237 echo "mkfs.xfs succeeded after retrying for $mkfs_duration"
238 true
239 else
240 echo "giving up on mkfs.xfs after retrying for $mkfs_duration with exit code $mkfs_result"
241 false
242 fi
229 243
230 # Mount the filesystem 244 # Mount the filesystem
231 mkdir -p $MANILA_STATE_PATH/export/$vol_name 245 mkdir -p $MANILA_STATE_PATH/export/$vol_name