Fixed it! – Hack your way to faster VMware snapshots

Tired of waiting forever for your VMware snapshots to complete? Well, I’ve got a little trick up my sleeve that will make those waiting times a thing of the past. Get ready to hack your way to faster snapshots!

This is how we can resolve them. It seems the snapshot functionality built into VMware’s Workstation still runs on the premise that the underlying disk being used is a slow, old, spinning rust disk. But it is 2023 and I would wager that most machines actually running Workstation or ESXi likely are using flash based storage.

This underlying assumption is what we suspect is the issue in the configuration that is taken as default for some of the snapshot parameters.

Primarily the options:

  • mainMem.ioWait
  • mainMem.ioBlockPages

mainMem.ioWait is a metric that indicates the amount of time the processor spends waiting for data to be transferred to or from the main memory. It is an essential factor in determining the overall performance of a computer system. By minimizing the ioWait time, the system can efficiently process tasks and improve its responsiveness.

mainMem.ioBlockPages refers to the number of memory pages that are blocked due to I/O operations. When a process requests data from a peripheral device, the corresponding memory pages may be blocked until the data transfer is complete. This can impact the system’s performance, especially if multiple processes are waiting for I/O operations to finish. It is crucial to optimize the I/O operations to minimize the number of blocked pages and enhance overall system efficiency.

With mainMem.ioWait set to a default value of 25ms which could be used in a classical HDD setup to save snapshots from hindering disk performance when VM’s are running on the same disk the snapshot is being written to. By waiting 25ms for each block of data, it allows the VM performance at the cost of the Snapshot taking place.

For the option mainMem.ioBlockPages, that is by default set to 64 pages, with each page being only 4k, this splits the memory dump into MANY small transaction each having to wait 25ms in between, and with the size of VM’s memory profiles and the amount of memory hosts have dedicated for virtual machines, this is too small.

By increasing the ioBlockPages and decreasing the ioWait values, we can cut down on both the number of iterations and waiting time ( which in turn will decrease the total time to dump the memory to disk).

So lets adjust these to options within the Virtual Machines .vmx file, and we should see an order of magnitude in snapshot performance.

Find the .vmx file for your VM in question and edit the file by adding the following lines to the end of the file:

mainMem.ioBlockPages = "2048" 
mainMem.iowait = "0"

Save the file and enjoy your speedy snapshots!