Skip to content

Commit f287f12

Browse files
authored
Changing the logic so that it only removes the disk snapshots (#34)
1 parent f3b4815 commit f287f12

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/storage/qcow2/managesnapshot.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ destroy_snapshot() {
152152
fi
153153
lvm lvremove -f "${vg}/${snapshotname}-cow"
154154
elif [ -f $disk ]; then
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
155+
#delete all the existing disk snapshots
156+
$qemu_img snapshot -l $disk |tail -n +3| grep -i '[0-9a-z]\{8\}-[0-9a-z]\{4\}' | awk '{print $1}'|xargs -I {} $qemu_img snapshot -d {} $disk >&2
157157
if [ $? -gt 0 ]
158158
then
159159
failed=2

0 commit comments

Comments
 (0)