Skip to content

Commit 0e3aebb

Browse files
committed
CLOUDSTACK-5446:
delete all the leftover snapshots on primary storage in case of snapshot errors, after a new backup snapshot is finished
1 parent e32eec8 commit 0e3aebb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

scripts/storage/qcow2/managesnapshot.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ destroy_snapshot() {
152152
fi
153153
lvm lvremove -f "${vg}/${snapshotname}-cow"
154154
elif [ -f $disk ]; then
155-
$qemu_img snapshot -d "$snapshotname" $disk
155+
#delete all the existing snapshots
156+
$qemu_img snapshot -l $disk |tail -n +3|awk '{print $1}'|xargs -I {} $qemu_img snapshot -d {} $disk >&2
156157
if [ $? -gt 0 ]
157158
then
158159
failed=2

0 commit comments

Comments
 (0)