Understanding the effects of snapshots during backup

plastilin

Renowned Member
Oct 9, 2012
108
5
83
Ukraine
Hello. The following question arose. For example, I have a snapshot of the system every day at 21.00 from Monday to Friday. On Saturday at 00.30, backup starts by creating a snapshot. What exactly will be included in the backup file? The state of the VM before the last snapshot was taken, namely at 21.00 Friday? Or is the current state of the VM up to date at 00.30 on Saturday?
 
Hi,
backups in PVE do not include snapshots. There should be a line
Code:
INFO: snapshots found (not included into backup)
in your backup logs.
The snapshot backup mode takes a snapshot of the current state of the running VM, see here for more information.
 
  • Like
Reactions: xuanguang
Hi,
backups in PVE do not include snapshots. There should be a line
Code:
INFO: snapshots found (not included into backup)
in your backup logs.
The snapshot backup mode takes a snapshot of the current state of the running VM, see here for more information.

If I understand correctly. We take a snapshot. From this point on, all data begins to be written to it. At the time of the backup, another snapshot is created. From which drive? from the base or from a snapshot that has already been created? If we have 3 snapshots that are a fork from the first to the last before creating a backup, what data will go to the archive?

For example

Code:
Base disk
 - snaphot 1
  -- snapshot 2
   --- snapshot 3
 
The presence of snapshots is ignored by the backup. When using snapshot backup mode, the disks as they appear to the running VM at the time of the backup are used, i.e. a snapshot of the current state is taken. There is no new storage level snapshot (e.g. within qcow2) created. That only happens for containers.
Using snapshot mode can lead to inconsistencies however, so it's highly recommended to enable and install the guest agent. Then the file systems can be freezed/thawed cleanly.
 
The presence of snapshots is ignored by the backup. When using snapshot backup mode, the disks as they appear to the running VM at the time of the backup are used, i.e. a snapshot of the current state is taken. There is no new storage level snapshot (e.g. within qcow2) created. That only happens for containers.
Using snapshot mode can lead to inconsistencies however, so it's highly recommended to enable and install the guest agent. Then the file systems can be freezed/thawed cleanly.
That is, even if I have snapshots taken at the time of the backup, all the data of the virtual machine at the time of the backup will still be included in the backup file. But there can be data discrepancy if the guest agent is not enabled? But is it better to delete all snapshots before backup?
 
That is, even if I have snapshots taken at the time of the backup, all the data of the virtual machine at the time of the backup will still be included in the backup file.
The backup is taken from the disk as it appears to the VM at the time of the backup. This does not include data from snapshots that are present on the backing image files.

But there can be data discrepancy if the guest agent is not enabled?
Yes. Only with the guest agent it can be ensured that the file system is in a consistent state at the time of the backup. Otherwise the backup might be reading the disk while the file system is in the middle of some operation. Either use the guest agent or a backup mode other than snapshot if you don't want to take the risk.

But is it better to delete all snapshots before backup?
No. It doesn't make a difference for the backup.
 

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!