
This can increase the time it takes to perform a vMotion but might be a worthy tradeoff to leveraging the host’s local disk.
vMotion Performance – If the destination host cannot see the swap file then it creates a new swap file and potentially copies swapped memory from the source. Here’s a good reference: “Storing a virtual machine swap file in a location other than the default” Īnd a reason to keep the VM swap files on a shared datastore versus a local datastore: Troubleshooting – isolation helps in finding guest OS issues but resolving the underlying overcommit issues should be the focus. Here’s a good reference: “What Do You Do With Your Swap File? – VMworld Update, Thursday” Backup – Similar to replication, the VM swap file should be on a datastore that is not backed up in order to skip scanning and backing up swap file data. This will save on storage capacity and provide better overall efficiency. Snapshot – Similar to replication, the VM swap file swap should not be on a datastore with snapshots enabled. If swapping is occurring then the blocks are constantly changing thus it will be constantly replicated possibly resulting in a very busy WAN link resulting in poor performance and a nightmare for VMware Site Recovery Manager (SRM). Replication – The VM swap file should be in a non-replicated datastore. Capacity – The VM swap file space can add up for a large number of VM’s so isolating them to a separate datastore can provide some efficiencies. If not possible, store the swap files in the same directory as the virtual machine.” There are several good reasons to choose the option: “Datastore Specified by host – Store the swap files in the datastore specified by the host to be used for swap files. With EMC’s FAST VP technology on the VNX and VMAX, if the swap files are not used then they will be migrated to the lowest tier. So in general you could keep things simple and just accept the default “Virtual machine directory – Store the swap files in the same directory as the virtual machines”. But this might not be the best use of Flash resources if you are concerned about cost, and who isn’t? If you’ve done a good job architecting your VM’s then you shouldn’t be overcommitting memory and thus it shouldn’t really matter where you put the swap files. Sure, EMC would love it if you put your swap files on EMC Flash technology to reduce the performance impact of swapping. Once swapping starts, very bad things are already happening, so a design that is centered around identifying and stopping swap as soon as it happens is best. The general consensus is that if you are swapping you are screwed. “(Alternative) VM swap file locations Q&A” Here’s one of the best general reads on this topic.
So thanks to Robert Way, Rajeev Dawar, Rich Barlow, Itzik Reich, Scott Drummonds, and Erik Zandboer for their contributions. I cannot take credit for this post, I posed the question regarding “Best Practices for locating the Virtual Machine swap file and several vSpecialist responded with number of great answers / opinions / recommended best practices for that and for Guest OS Paging.