summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-12-14 05:41:07 +0000
committerGerrit Code Review <review@openstack.org>2015-12-14 05:41:07 +0000
commitf30a7381dc051bfaac861a44a33eed448dd3a235 (patch)
tree7987c2fe45ad891e4f12af06e0db926917852f33
parent92c20721210cb0c3649ad9a21cd7c76f9cc92b12 (diff)
parent21d2009e02bab24ec8a5985f24e83bf56ddca1b4 (diff)
Merge "_create_thin_lv_gluster_vol: retry mounting the lv"
-rwxr-xr-xdevstack/gluster-functions.sh19
1 files changed, 2 insertions, 17 deletions
diff --git a/devstack/gluster-functions.sh b/devstack/gluster-functions.sh
index 7edb7ee..ed66dc9 100755
--- a/devstack/gluster-functions.sh
+++ b/devstack/gluster-functions.sh
@@ -226,26 +226,11 @@ function _create_thin_lv_gluster_vol {
226 sudo lvcreate -V $vol_size -T $GLUSTERFS_VG_NAME/$GLUSTERFS_THIN_POOL_NAME -n $vol_name 226 sudo lvcreate -V $vol_size -T $GLUSTERFS_VG_NAME/$GLUSTERFS_THIN_POOL_NAME -n $vol_name
227 227
228 # Format the LV. 228 # Format the LV.
229 local mkfs_result=0 229 test_with_retry "sudo mkfs.xfs -i size=512 /dev/$GLUSTERFS_VG_NAME/$vol_name" "mkfs.xfs failed"
230 local i
231 for i in `seq 100`; do
232 mkfs_result=0
233 sudo mkfs.xfs -i size=512 /dev/$GLUSTERFS_VG_NAME/$vol_name || mkfs_result=$?
234 [ $mkfs_result -eq 0 ] && break
235 sleep 0.1
236 done
237 local mkfs_duration="$((i/10)).$((i%10))"
238 if [ $mkfs_result -eq 0 ]; then
239 echo "mkfs.xfs succeeded after retrying for $mkfs_duration"
240 true
241 else
242 echo "giving up on mkfs.xfs after retrying for $mkfs_duration with exit code $mkfs_result"
243 false
244 fi
245 230
246 # Mount the filesystem 231 # Mount the filesystem
247 mkdir -p $MANILA_STATE_PATH/export/$vol_name 232 mkdir -p $MANILA_STATE_PATH/export/$vol_name
248 sudo mount /dev/$GLUSTERFS_VG_NAME/$vol_name $MANILA_STATE_PATH/export/$vol_name 233 test_with_retry "sudo mount /dev/$GLUSTERFS_VG_NAME/$vol_name $MANILA_STATE_PATH/export/$vol_name" "mounting XFS from the LV failed"
249 234
250 # Create a directory that would serve as a brick. 235 # Create a directory that would serve as a brick.
251 sudo mkdir -p $MANILA_STATE_PATH/export/$vol_name/brick 236 sudo mkdir -p $MANILA_STATE_PATH/export/$vol_name/brick