Most of you probably already know or have heard this statement: Snapshots are not backups!
Just last week a German hosting provider did lose 1500 snapshots because of failing hardware. And who hasn’t experienced some horror stories about (forgotten) VMware snapshots. Because of that I wanted to highlight this with a dedicated blog post.
What is a snapshot?
In general a snapshot is a frozen point in time state of a certain system or data. While we're often referring to snapshots in case of virtual machines, there are other variations like storage or file snapshots.
For virtual machines, snapshots set the virtual disks to read only state and redirect all changes to a different disk file(the details may differ depending on the hypervisor). They can be used for quick rollbacks or during VM backups. Normally those are only created temporarily(or at least the should).
Storage or file snapshots can be used for versioning and can also be replicated to different systems; those tend to have a longer retention.
A snapshot is most of the time dependent on the source system/data; it's not a copy.
What is a backup?
A backup is similar to a snapshot but this time, it is an independent copy of the source data. This copy should be placed on a different storage with no connection to the source system. With the 3-2-1 rule applied, backups should later on be copied to a different storage media and also brought off-site.
A recovery from a backup should also not be limited in any ways. This means, you should, be able to restore to different hardware or recover single items.
Why is a snapshot not a backup?
As snapshots are dependent on their source, they're are a bad solution for backups. If you lose your source, you’ll also lose your snapshots (or the ability to roll them back). In addition, virtual machine snapshots cause additional IO overhead while being active and especially during the cleanup process; so they should never be active for a longer time. Forgotten VM snapshots at some point get impossible to delete or cause stuns.
Backups on the other hand are independent of their source. If the source gets corrupted, deleted or what ever, the backup should still be usable. Backups can be copied to different locations and used for long term retention.
When do you use a snapshot?
While a snapshot itself isn’t a backup, it can complement a backup solution and lower the Recovery Time Objective(RTO).
For virtual machines, they are necessary in order to backup virtual disks. So during an active backup, a snapshot will be temporarily active.
File based snapshots, like Shadow Copies on a Windows Fileserver, can be used be end users for a quick recovery of lost or overwritten files.
And storage snapshots can be created and restored in a few seconds. Those can be a great addition for regular backup job.
At the end you should just never forget, that if everything breaks, a snapshot will probably also be gone. So use them where they make sense, but don’t forget to take a backup.