Difference between snapshot and backup

Backups are independent of your VM and can be stored everywhere like every file.
Snapshots are in your VM-disk so you cant take it away.

Backups are full copy's of the VM and need more space
Snapshots need less storage.

Backups would take more time.
Snapshots are instant.

Snapshots

By using snapshots you can preserve the KVM virtual machine state. A snapshot includes the contents of the virtual machine memory, virtual machine settings, and the state of all the virtual disks. When you roll back to a snapshot, you restore the memory, virtual disks and all settings of the virtual machine to the state they were in when you took the snapshot.

You can take a snapshot and continue to use the virtual machine from that point, take another snapshot at a later point, and so on. You can roll back to the snapshot of a previous known working state of the project if the changes do not work as expected.

Backup Storage

Before a backup can run, backup storage must be defined. A backup storage must be a file-level storage, as backups are stored as regular files. In most situations, using a NFS server is a good way to store backups.

Backup modes

Backup modes for VMs

stop mode - This mode provides the highest consistency of the backup, at the cost of a short downtime in the VM operation. It works by executing an orderly shutdown of the VM, and then runs a background Qemu process to backup the VM data. After the backup is started, the VM goes to full operation mode if it was previously running. Consistency is guaranteed by using the live backup feature.

suspend mode - This mode is provided for compatibility reason, and suspends the VM before calling the snapshot mode. Since suspending the VM results in a longer downtime and does not necessarily improve the data consistency, the use of the snapshot mode is recommended instead.

snapshot mode - This mode provides the lowest operation downtime, at the cost of a small inconsistency risk. It works by performing a backup, in which data blocks are copied while the VM is running. If the guest agent is enabled (agent: 1) and running, it calls guest-fsfreeze-freeze and guest-fsfreeze-thaw to improve consistency.


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 8270