Recovering VM with snapshots

Gert

Member
Jul 27, 2015
16
1
23
45
Centurion, South Africa
www.huge.co.za
Hi everyone, one of my clients was running proxmox v3.2 i think. The operating system hard drive crashed but the vm images were stored on another file system. I have now replaced the drive and installed a new proxmox v3.4. Normally I would just recreate the VM and replace the created qcow2 file with the "recovered" file. But now i have some VMs with snapshots. Now Im not sure how to deal with the snapshots, is there a way I can merge all into one file again? Below is an example of on of the VMs with snapshots:


Code:
root@proxmox:/mnt/md0/images/100# ls -1
vm-100-disk-3.qcow2
vm-100-state-monthly_snap.raw
vm-100-state-Montly_snapshot.raw
vm-100-state-snappie.raw
vm-100-state-snapshot.raw
vm-100-state-Tablet_SID_WEB.raw
 
I think i have figured it out, first i run:

Code:
qemu-img snapshot -l vm-100-disk-3.qcow2

and the I run:

Code:
qemu-img snapshot -d 1 vm-100-disk-3.qcow2
qemu-img snapshot -d 2 vm-100-disk-3.qcow2
qemu-img snapshot -d 3 vm-100-disk-3.qcow2
qemu-img snapshot -d 4 vm-100-disk-3.qcow2
qemu-img snapshot -d 5 vm-100-disk-3.qcow2
qemu-img snapshot -d 6 vm-100-disk-3.qcow2

for the 6 snapshots i want to delete.

I made a copy of the files and did ran those commands. Now when I run

Code:
qemu-img snapshot -l vm-100-disk-3.qcow2

it shows no more snapshots, however the actual files are all still there and the main qcow2 file's size did not change. Is this correct?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!