The following steps detail how to enable vSAN to provision the Virtual Machine Swap files as thin. vSAN Sparse Swap Files allow you to conserve space in the vSAN datastore by only consuming vSAN storage as the swap gets used i.e instead of leaving as default thick swap files which means for example when you create a VM with 32GB of memory this results in the creation of a 32GB virtual swap file (.vswp) unless of course you have configured reservations. You can see how quickly your vSAN datastore could fill if there are many hundreds of VM’s created in this default manner.
Steps to to enable provisioning of virtual machine swap files on vSAN as thin:
From the vSphere Client
1. In the Navigator, click Hosts and Clusters and expand the entire cluster tree.
2. Select the first host in the clsuter.
3. Click the Configure tab->System->Advanced System Settings.
4. Click the Edit button.
5. In the filter box, enter vsan.swap and wait for the search results.
6. Change the value of VSAN.SwapThickProvisionDisabled to 1 and click OK.
Repeat the steps above for each host in the cluster.
From the ESXi Shell
Login to the ESXi shell as root and issue the following cmd to enable:
esxcfg-advcfg -s 1 /VSAN/SwapThickProvisionDisabled
If you wish to query the setting:
esxcfg-advcfg -g /VSAN/SwapThickProvisionDisabled
For existing VM’s to take advantage of this new setting they will need to be powered off and on, for example the below images display the consumed space before and after the VM’s on the vSAN datastore get power-cycled: