File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -125,14 +125,18 @@ if [[ -n $IMAGE ]]; then
125125 exit $result
126126 fi
127127
128- # Resize the volume to the requested capacity.
129- output=$( virsh vol-resize --pool " $POOL " --vol " $NAME " --capacity " $CAPACITY " 2>&1 )
130- result=$?
131- if [[ $result -ne 0 ]]; then
132- echo " Failed to resize volume $VOLUME to $CAPACITY "
133- echo " $output "
134- virsh vol-delete --pool " $POOL " --vol " $NAME "
135- exit $result
128+ # Resize the volume to the requested capacity. Attempting to resize a raw volume
129+ # to the same capacity will result in failure, see:
130+ # https://github.com/stackhpc/ansible-role-libvirt-vm/issues/23
131+ if [ " ${FORMAT,,} " != " raw" ]; then
132+ output=$( virsh vol-resize --pool " $POOL " --vol " $NAME " --capacity " $CAPACITY " 2>&1 )
133+ result=$?
134+ if [[ $result -ne 0 ]]; then
135+ echo " Failed to resize volume $VOLUME to $CAPACITY "
136+ echo " $output "
137+ virsh vol-delete --pool " $POOL " --vol " $NAME "
138+ exit $result
139+ fi
136140 fi
137141fi
138142
You can’t perform that action at this time.
0 commit comments