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
Why organisations that want to maximise the ROI of their multi-cloud approach should be considering VMware training.16 May 2023
The benefits and challenges of a multi-cloud approach in 2023
Why multi-cloud in 2023? Bryan O'Connor returns to the subject to outline some of the opportunities, challenges and solutions…11 May 2023
Best practices for managing user accounts in VMware vSphere
In another of Bryan O'Connor's technical VMware blogs, he details the do's and don'ts of adding user accounts in vSphere.24 August 2021
What is virtualisation?
Bryan O'Connor explains what a virtual machine is and what the benefits of virtualisation are for any organisation.14 May 2021
Basic virtualisation terminology
What is a hypervisor? What is vSphere vMotion? What is HA? Bryan O'Connor, our vExpert, decodes commonly used virtualisation…18 June 2021
What is the benefit of getting VMware certification?
All about the VMware Data Center Virtualization Certification 2021 update
QA's VMware vExpert Bryan O'Connor looks at the 2021 VMware Data Center Virtualization certifications.02 February 2021
VCTA: The new introduction certification from VMware
Bryan O'Connor introduces the new entry-level VMware certification, Certified Technical Associate (VCTA).27 November 2020
Which VMware certifications and tracks are right for me?
Bryan O'Connor explains the different VMware certification levels and tracks available in 2020.27 November 2020
VMware: Multi-Cloud Introduction
QA's very own VMware vExpert, Bryan O'Connor, introduces VMware Multi-Cloud.24 November 2020