What is the best VM Backup Mode?

Stop = VM will be shut down... so data in backup is 100% consistent under all circumstandes

Suspend = VM will be "freeze" for backup. So data can not change while backup is running..... but this can happen in the middle of a disk transaction.

Snapshot = Tell the Guest-OS via Agent to create a snapshot if QEMU-Agent available and then create a Snapshot for Backup. Also most often consistent.
 
Stop = VM will be shut down... so data in backup is 100% consistent under all circumstandes

Suspend = VM will be "freeze" for backup. So data can not change while backup is running..... but this can happen in the middle of a disk transaction.

Snapshot = Tell the Guest-OS via Agent to create a snapshot if QEMU-Agent available and then create a Snapshot for Backup. Also most often consistent.

So Stop and Snapshot, which is more better?

How about backup mode for Containers?

Thanks
 
So Stop and Snapshot, which is more better?

How about backup mode for Containers?

Thanks
If downtime is OK for you, STOP is the safest way to go. Expect your VMs unusable for some time, cause system/guest will shutdown and startup after backup.
 
cause system/guest will shutdown and startup after backup.
To be slightly more specific: The VM will gracefully shut down so that it's in a clean state, then it will be started again with the vCPU paused, the backup process will set up tracking info for all devices and then unpause the vCPU so that the guest OS can start relatively quickly again.
In other words, the VM won't be shut down for the whole duration of the backup task, which could be hours, rather it will only get shutdown for a brief period of time (seconds to minutes at max) and is then able to run again while the backup task is still active.

Note that Snapshot mode can be just as secure (as in sane synced state), at least if you have the QEMU Guest Agent (QGA) setup inside the VM and have it enabled in the VM config on Proxmox VE side. As there the QGA will freeze all filesystems from inside the OS, but depending on your workload that might have some overhead too, and potentially be even more impactful than a brief shutdown+start, so you need to evaluate what of those two mode works better for your specific use case.
After all, if there would be a general answer for what mode is better, we would only have to support and maintain that; but as there isn't such an answer we offer more than one so everybody can use the one that fits their needs best.
 
Last edited:
  • Like
Reactions: EdiNaN and itNGO
Thanks for your patience @itNGO @t.lamprecht .

That means Stop might spend more time on backups than Snapshot, right?
As dirty-bitmaps are dropped when shutting down a VM, so slower incremental backups when using PBS, yes.
But the main point is the downtime. When using stop-mode your VM needs to shutdown which might take some minutes, and then needs to boot up which also might take some minutes where your services won't be available.
While when using snapshot-mode the VM will continue operating normally without downtime.
How well a VM can handle a restore depends on the services the VM is running. Restoring a stop-mode backup is clean as all the services were in a well defined state at the time of the backup (as all services got gracefully shutdown before) while restoring a snapshot-mode backup is like booting a VM after a hard reset/crash.
Lets say you run something like a minecraft server that only saves the world every full hour or when shutting down the minecraft server. If you run a stop-mode backup at 01:45 and restore it, the world would be at the state of 1:45, as it got saved from RAM to to disk when the VM and the minecraft server got shut down.
When running a snapshot-mode backup at 1:45 and then restoring it, the world would be at a state of 1:00 with the last 45 minutes of data lost, as the last 45 minutes of changes were only stored in RAM that is then lost without a proper shutdown dumping the RAM to disk.
On the other hand it would be really annoying to use a hourly stop-mode backup as everyone would get kicked every hour and need to wait some minutes before it would be possible to reconnect.

So really depends whats best...

I personally use snapshot mode backups for running guests and backup jobs and stop mode backups in case of a maintainance task like before doing a major update or to migrate a guest to another host via backup+restore where downtime isn't a problem.
Or in other words: If I know I will do a restore later I use stop-mode backups. If I probably won't restore the backup and want it just in case something might go wrong, I use snapshot-mode backups as losing some unsaved data but having a recent backup is better than having a outdated stop-mode backup or no backup.
 
Last edited:
I personally use snapshot mode backups for running guests and backup jobs and stop mode backups in case of a maintainance task like before doing a major update or to migrate a guest to another host via backup+restore where downtime isn't a problem.
Or in other words: If I know I will do a restore later I use stop-mode backups. If I probably won't restore the backup and want it just in case something might go wrong, I use snapshot-mode backups as losing some unsaved data but having a recent backup is better than having a outdated stop-mode backup or no backup.

Absolutely great way to do it...... Enterprise/Datacenter-Style.... I like it!
 
  • Like
Reactions: EdiNaN

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!