VMware Cloud Community
SamTheEagle
Contributor
Contributor

Question regarding virtual machine swap files

Hi,

I have the following issue in the environment of a customer.

A 2 node cluster running ESXi 5.0.0 1311175 with Enterprise Plus licenses

various shared datastores for VM's, a dedicated datastore for VM swap files and a dedicated datastore for VMDK's holding the windows swap files

I see in the virtual machine directory on the datastore for VM's that all VM's have a vmx-<vmname>-randomnumber.VSWP file of about 75 MB and they have the VSWP file on the dedicated VM swap datastore.

Both hosts are configured to put the VSWP file on the dedicated datastore and the cluster setting is to store in the datastore specified by the host. The VM's are configured to use default settings (i.e. host or cluster setting).

Normally it wouldn't be a problem but the VM datastores are mirrored over WAN links from one country to another country for backup reasons. All those swap files consume bandwith which I didn't expect. Am I doing something wrong? Can anybody explain it to me?

1 Reply
zXi_Gamer
Virtuoso
Virtuoso

Well, the Datastore you have used for Swap will take care of the Virtual machine swapping operation. However, the swap file you are seeing is the swap created by vmx.

From 5.0, the vmx swap was introduced to take out the overhead from the ESX in handling multiple vmx [in vCloud or in VDI environments]

Virtual machine executable (VMX) swap files allow the host to greatly reduce the amount of overhead memory reserved for the VMX process.

You do can changed the vmx swap directory by adding the following entry in the vmx file:

sched.swap.vmxSwapDir = "Path of any datastore"

More info here

VMX Swap feature in vSphere 5.0 | VMware vSphere Blog - VMware Blogs

Hope it helps,

zXi