I have a virtual machine that started out with 5 snapshots 1,2,3,4,5.
I used qemu-img to delete snapshots 1,2,3. Snapshots 4 and 5 are still needed and were not deleted.
How can I release the space used by snapshots 1,2,3 and retain snapshots 4 and 5?
I have spent a lot of time searching for a solution, and the solutions I have tried got the following results:
Using qemu-img convert (Deleted needed snapshots) qemu-img convert -O qcow2 Linux.qcow2 Linux_s.qcow2 Reduces the space used by Linux.qcow2, but deletes snapshots 4 and 5.
Using virt-sparsify (Doesn't recover any space) cp Linux.qcow2 TEST.qcow2 sudo virt-sparsify --in-place TEST.qcow2
Retains the two undeleted snapshots, but doesn't recover the space that was originally occupied by snapshots 1,2,3.
How can I recover the space in a qcow2 file after deleting snapshots, while retaining remaining snapshots?
I find it difficult to understand why there isn't an easy way to achive this that is clearly documented
Edit: Is there any way to copy Snapshot 4 to a new file as a snapshot, and then add the delta for snapshot 5. Then I could just discard the extra file with the wasted space.