When designing VDI solutions for VMware infrastructures, one of the many ways to reduce shared storage consumption is to allow the placement of VM Swap files (.vswp) on host local storage. The .vswp file is automatically created by ESX when the VM is Powered On, and automatically removed when the VM is Powered Off.
(if you read the article in full you will find a little surprise at the end)
The size of the .vswp file is equal to the memory size allocated to the VM, minus any memory reservation assigned to the VM. As an example, assume a virtual desktop with Windows 7 has 2GB RAM and 1GB memory reservation. In this case the .vswp file is 1GB.
In a deployment with 1000 virtual desktop with 2GB RAM and without any memory reservation would be possible to save approximately 3TB of SAN storage when allowing the placement of .vswp on local storage. Using the same numbers, would be required approximately 192GB of local storage to host VM swap files in each host. (bear in mind I am making some assumptions to show you these numbers).
The main benefits of offloading the VM Swap files to local storage are:
- Reduction of the shared storage datastores based on number of desktops per datastore, memory allocated to a VM and its reservation.
- Reduction of read/write I/O from shared storage, reducing overall I/O profile.
There are also downsides that should be observed when allowing VM Swap file placement to local storage:
- Slight impact on performance of vMotion and HA operations.
- Slight increased CPU and memory requirement on the ESX host to handle the I/O for local .vswp files.
- Increased local storage requirement on ESX hosts based on number of desktops per datastore, memory allocated to a VM and its reservation.
When moving .vswp to local storage it is recommended to provide local storage capable of providing large number of IOPS and throughput. SSDs are ideal, however many solutions are still using 15K drives without major problems. However, I recommend you to pay attention to those two metrics just make sure users are getting the best possible performance.
In no particular order, the most common techniques utilised to reduce storage consumption from a host and application perspective are (does not include storage array techniques such as LUN Thin Provisioning, Deduplication, etc..):
Configuring for Local VM Swap
There are two simple steps to follow in order to configure your ESX cluster to support local host .vswp files. The first step is to configure the HA cluster to “Store the swapfile in the datastore specified by the host”.
The second step need to be completed for each host member of the cluster. Under Configuration, select Virtual Machine Swapfile Location and then select the local datastore to be used to host the .vswp files.
Now your cluster and hosts are ready to start using local storage for .vswp files. Existing VMs will need to be restarted to have their .vswp created on local storage.
Ok, the surprise is that I have added local storage calculation to my VDI Calculator. When selecting “Place VM .vswp on Local Storage” the calculator will deduct the total .vswp from share storage utilisation and provide the amount of local disk required to support the virtual desktops.
To access the VDI Calculator check here or select VDI Calculator from the Top Menu.