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
125
125
exit $result
126
126
fi
127
127
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
136
140
fi
137
141
fi
138
142
You can’t perform that action at this time.
0 commit comments