[SOLVED] Difference between VE snapshot and backup snapshot

Faris Raouf

Well-Known Member
Mar 19, 2018
147
26
58
Please can someone explain the difference between performing a VM Snapshot (Node>[VMID]>Snapshots) and using snapshot mode when creating a backup of a VM (Node>[VMID]>Backups > Create backup [and select Snapshot as backup mode])?

I realise they are "different things" but no amount of Googling tells me how they are different when it comes to the disk side of things.

The reason I ask is that I appear to be able to use snapshot mode during a backup on a disk that does not support VM Snapshots (.raw format stored in directory in ext4 filesystem in LVM volume).

So there is obviously a fundamental difference when it comes to dealing with the disk side of things between these two things and I would like to understand what that is.
 
a snapshot (node->vm->snapshot) makes a snapshot of the config and of the disks, on a storage level (think zfs/lvmthin snapshots)

a 'snapshot backup' does not take a storage level snapshot, instead it does the following:

the qemu process begins to mirror a drive to a file/pipe/etc.
every time a write comes from the guest to this drive, it blocks this write until this specific part of the drive is backed up
repeat until the whole drive is backed up

because of this out-of-order writing, it is possible to have snapshot semantics for backups even for storages that do not support snapshot
 
The explanation although it might be technically correct (I would not know), it only confused me more, I still do no understand if it is better to have backups or snapshots.
Which is faster?
Which is more reliable?
 
I think I'm 90% correct in saying:
A full backup copies the content of the VM's disk into a backup file. You can later mount this in order to extract or view a single file. In theory you could create a clone or temporary copy of your VM by restoring a new VM from the backup. And of course you can restore your entire VM from the backup file. Ignore all references to the word snapshot when thinking of backups.

Backups, therefore, are for disaster recover and file recovery.

Snapshots are different beasts altogether. At the point of creating a snapshot, the content of RAM is saved to disk, and all new disk writes are written to a new data file, leaving the original data file untouched and read-only. This means that you can simply restore the RAM and drop the new data file in order to get back to the point when the snapshot was created. This makes it a very quick process. And because we are not copying the entire disk when we create snapshot, creating one is fast too - all we need to do is copy the content of the RAM to disk.

I dare say that some people use snapshots as a backup method. But can you imagine the mess of files (or maybe pointers if files aren't used) when multiple snapshots are taken? And if you want to delete a snapshot, the changed data must be merged with the unchanged data. Yikes!

Snapshots are useful if you potentially need to quickly go back to a point in time. Maybe you are about to do something dangerous, like a complete OS upgrade, or you are about to make fiddly changes that are likely to go wrong. Yes, you can use a backup for this, but a snapshot might be more convenient and will certainly be faster.

Err...at least that's what I think. There are many ways to do snapshots, and what I'm talking about is my understanding of how it works. It is not necessarily right.
 
Thanks
I think I'm 90% correct in saying:
A full backup copies the content of the VM's disk into a backup file. You can later mount this in order to extract or view a single file. In theory you could create a clone .......
........
Err...at least that's what I think. There are many ways to do snapshots, and what I'm talking about is my understanding of how it works. It is not necessarily right.

Thanks, that was exactly what I was thinking but I did not want to venture that I was right :)

Now the question arises, why would tools like this one (https://www.enterpriseve.com/protezione-continua-dei-dati-proxmox-ve/) exist if you are not supposed to use snapshots as a way to go back in case something goes wrong at any given time.

This is my scenario (not real), you have a DB system (yes, you are also doing SQL backups, 1 full every 24, one dif evey 4 and logs every 3 min) and sending these to a remote location, etc etc..)

Data gets corrupted, you realize it 9 hours later...

If you were doing a snapshot, (lets say every 6 hours), going back to a point in time (12 hours before you realize corruption) would be much faster than going thru your backups, restore full backup (24 hours, and adding the diff and logs to get to the 9 hour point..

Not sure if my scenario makes sense.. just trying to find a USE for snapshots, since they are indeed much faster than backups.
 
Ah, I think that might be related to ZFS snapshots (it mentions ZFS and Ceph). That's there the difference between a VM Snapshot, and a filesystem snapshot, causes confusion.

What they appear to be doing is filesystem snapshots.

Some form of CDP, possibly.

How best to protect your particular kind of data and the fastest way to recover it is, unfortunately, beyond my knowledge. I suspect that you need database snapshots as opposed to file/vm/filesystem snapshots, if such a thing exists.
 

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!