We have query regarding the VMswap file storage placement.
1. Is it possible to store the VMswap(.vswp) file at different location apart from default location?
2. If yes, can we store different Vmswap(.vswp) on different data stores?
3. What are advantages & disadvantages of this configuration?
4. What will happen if we will place .vswp of all vm on single nfs data store (remote data store)
Hi,
Yes, it is possible . If your hosts are managed by a vCenter and are in a cluster, then first you have to set the policy "Store the swap file in a datastore specified by the host" by following the steps : Edit settings on the cluster-> Swapfile location . Now, go on the hosts at Configurations and specify the datastore where you want the swapfile to be held . More information at : http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=100408...
Regarding advantages : Let's assume you have disaster recovery configured for your VMs. This is done by Storage replication in another site. Then it would be clear that you don't want also the swapfile to be replicated, so you would keep your swapfile on a different datastore that is not replicated. Also for some backup solutions at storage level. Or your datastores are running on SSD ==> more infos on : http://imallvirtual.com/?p=393 .
One disadvantage that comes in mind would be in case of a vMotion, if the host were you are migrating the VM has no access to the "swapfile datastore" , then it has to recreate the swapfile . Which would not be a problem for a small VM . But if you have a big VM, it would add time to completing the vMotion .
Hope I was of some help.
Kind regards,
Mircea
Best practice as per my idea is that there should not be any swap operations. Ideally, swapping is a costly operation and offloading to different FC lun or a NAS would add up to the bottlenecks in case of heavy load VMS.
Having said that, if you want to have a better performance with swapping, then I would suggest swapping on SSD disks
Most of the part already answered by mirceaflorin and zXi_Gamer
What will happen if we will place .vswp of all vm on single nfs data store (remote data store)?
You can keep all vms vswp on single nfs. While configuring across host (means vmotion), keep that nfs volume shared.
vswp file size is equivalent to the sizeof memory assigned to the virtual machine (in case of no reservation). In case of high memory operations, you may see the timed out while doing the vmotion.
-A
Moving the swap file to an alternate datastore is a useful troubleshooting step if the virtual machine or guest operating system is experiencing failures, including STOP errors, read-only file systems, and severe performance degradation issues during periods of high I/O. However, identifying and resolving the underlying overcommit or storage performance issues is still recommended to ensure environment stability.
This can also be used to store the virtual machine swap files in an alternate non-replicated datastore when using LUN snapshot technologies to ensure that you are storing the swap files in a location that is not being replicated.
Note: If your hosts are part of an HA Cluster, you must change the cluster settings for virtual machine swap file location prior to executing the steps below. For more information, see the Change the Swap File Location section in the Virtual Machine Admin Guide for your version.
To edit the virtual machine swap file location in ESXi/ESX 3.5, 4.x, and ESXi 5.x:
To change the swap file location for a single virtual machine:
cd /vmfs/volumes/datastore_name/virtual_machine_folder/
sched.swap.dir = /vmfs/volumes/datastore/