VMware vSAN Sparse Swap

Sparse Swap you say? Well, yes! Sparse Swap!
With Sparse Swap enabled, you thin provision Swap Objects. This can reduce significantly you’re disk space!
It is always important to have available disk space for swapping purposes (and other reasons), but normally, there is no need for dedicated Swap Space (unless you over provision and make a lot of use of swap space).

To disabled Sparse Swap on VM Objects, you need to alter it per host. Not on vCenter level, but on host level.

This is especially for vSAN 6.2.

To enable Sparse Swap, log into the console of you’re ESXi host(s) (every host needs to be done)

And  do the following:

esxcfg-advcfg -s 1 /VSAN/SwapThickProvisionDisabled

 

To disable Sparse Swap:

esxcfg-advcfg -s 0 /VSAN/SwapThickProvisionDisabled

Be sure to turn off and turn on the VM’s in order to have Sparse Swap activated for those machines! And be sure to do this setting on every host.

I would recommend to do this as a best practice in a new environment (but, be carful… based on what the requirements are! If you are planning to over provision and use a lot of swap data, don’t turn this option off!)

In a typical environment we had before the change:

after the change:

This is not entirely representative because we rebuild the whole vSAN. There was a lot of “trash” on it, but. stil, the difference is big!