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.vsanvswpthin0

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.

vsanvswpthin01

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

vsanvswpthin02

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:

vsanvswpthin1

vsanvswpthin2

1 Comment »

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s