CLOUDSTACK-5446:

delete all the leftover snapshots on primary storage in case of snapshot
errors, after a new backup snapshot is finished

(cherry picked from commit 2667855ccb)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Edison Su 2014-11-19 14:31:51 -08:00 committed by Rohit Yadav
parent e9c5a03fb0
commit ba7711b066
1 changed files with 2 additions and 1 deletions

View File

@ -146,7 +146,8 @@ destroy_snapshot() {
fi
lvm lvremove -f "${vg}/${snapshotname}-cow"
elif [ -f $disk ]; then
$qemu_img snapshot -d "$snapshotname" $disk
#delete all the existing snapshots
$qemu_img snapshot -l $disk |tail -n +3|awk '{print $1}'|xargs -I {} $qemu_img snapshot -d {} $disk >&2
if [ $? -gt 0 ]
then
failed=2