Latest Posts


Total Pageviews

Saturday, 11 June 2016

Sparse VM Swap Object in VSAN 6.2

Those of you who have a good understanding of VSAN at this stage will know that a virtual machine deployed on the VSAN datastore is deployed as a set of objects, and not a set of files, which is how a VM is deployed on traditional datastores. Those objects include the
  • VM Home Namespace, 
  • VMDKs 
  • Snapshot Delta's
  • vmem 
  • and of course VM Swap.

VM Swap is interesting, in that it only exists when the VM is powered on, but on VSAN it has always been provisioned with 100% Object Space Reservation in the past.

This has some drawbacks, since it tended to consume a lot of capacity. For example, if I deployed 100 VMs, each with 4 GB of memory, then there is 400 GB of disk provisioned for the VM swap.

This is reserved space that I may never even use if the VM never experiences resource issues.

Here is the example of VM Provisioned with 64MB RAM in vsan datastore. As soon as it is powered on it starts consuming 140MB disk space from the datastore as Sparse VM Swap Object is disabled

1. When i started VM this object exists:-

2. When i powered off my vm this object doesn't exist anymore

3. Now i want to enable it to save the space of my vsan datastore
Putty to your esxi host where ever this vm is running (recommendation is to enable it on all the esxi hosts those are the part of vsan cluster
Command to query the status of this feature:-

esxcfg-advcfg -g /VSAN/SwapThickProvisionDisabled

Command to enable this feature:-
esxcfg-advcfg -s 1 /VSAN/SwapThickProvisionDisabled

4. Now i powered on the vm again and checked the status and it's size is just 12MB