What is a VM snapshot?
Virtual machine (VM) snapshots have their uses – they're handy, for instance, to repeatably return back to a virtual machine's previous state.
When we take a snapshot, we capture the virtual machine's hard disk, hardware and optionally the memory state.
Within VMware, we create three state files:
- Disk files – Delta.VMDK (VMFS5 less than 2TB virtual disk)
- Hardware state – .vmsn
- Memory state – .vmem
These snapshots then allow us to revert back to a previous state if something goes wrong, for example, if a software update fails.
Snapshots best practices
VMware has some best practices for using snapshots.
- Do not use snapshots as back-ups.
- Do not use a single snapshot for more than 72 hours.
- When using third-party back-up software, ensure that snapshots are deleted after a successful back-up.
- A maximum of 32 snapshots are supported in a chain. However, for a better performance use only two to three snapshots.
Why you should limit the number of VM snapshots
The last point is quite interesting: The more snapshots we take, the slower the VM will potentially run, but most importantly, the VM will take up a lot of additional disk space, as the snapshot disk file increases in size.
How to limit the number of VM snapshots
VMware has a setting that we can add to the VMs .vmx file – we set the maximum number of snapshots for a virtual machine by editing the snapshot.maxSnapshots = n variable of the configuration file.
Once we are in the vSphere Client, right-click and edit your VM settings, select VM options and then select Advanced, then locate Configuration Parameters, and select EDIT CONFIGURATION.
Then select ADD CONFIGURATION PARAMS.
Next, type for max of 2 snapshots, and click OK.
Now we can only take a maximum of 2 snapshots against this machine:
If you would like to learn more, check out our comprehensive catalogue of VMware courses.
Bryan O'ConnorBryan has been working at QA as one of the principal virtualisation trainers for 13 years and counting, specialising in VMware, but also working with Microsoft Hyper-V, and multiple Cloud technologies.
More articles by Bryan
Going Swiss: How VMware training can streamline your multi-cloud systems
The benefits and challenges of a multi-cloud approach in 2023
The 3 steps to becoming a VCP-DCV 2023
What is the benefit of getting VMware certification?
Why multi-cloud, what are the challenges and how can VMware help?
Best practices for managing user accounts in VMware vSphere
Free VMware resources
What is virtualisation?
Basic virtualisation terminology
VCTA: The new introduction certification from VMware