Saturday, 19 June 2021

Limiting the Number of VMware Virtual Machine Snapshots

 Snapshots have their uses; we can use them to repeatably return back to a virtual machines previous state.

When we take a snapshot we capture the virtual machines 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 a software update fails

However, VMware has some best practices for using Snapshots.

  • Do not use snapshots as backups
  • Do not use a single snapshot for more than 72 hours
  • When using a third-party backup software, ensure that snapshots are deleted after a successful backup.
  • Maximum of 32 snapshots are supported in a chain. However, for a better performance use only 2 to 3 snapshots.

The last point is quite interesting, the more snapshots we take, the slower, potentially the VM will run, but most importantly, the VM will take up a lot of additional disk space, as the snapshot disk file increases in size.

VMware however, have a setting 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 Configuaration Parameters, and select EDIT CONFIGURATION


Then type for max of 2 snapshots, and click OK

Snapshot.maxSnapshots              2


 Now we can only take a maximum of 2 snapshots against this machine.