CLOUDSTACK-5446:

delete all the leftover snapshots on primary storage in case of snapshot
errors, after a new backup snapshot is finished
This commit is contained in:
Edison Su 2014-11-19 14:31:51 -08:00
parent e32eec8b3e
commit 0e3aebbb9d

View File

@ -152,7 +152,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