How to change Virtual Machine swap file location VMware ESXi
I have taken an example, I have created two datastore like below:-
VM-Datastore dedicated for VM related files like vmx,vmdk etc
Swap-Datastore dedicated for VM Swap files.
If you want to change the swap file location to different datastore than default, you need to shut down the VM first. Once VM is offline then go to Edit Setting of that VM and then click on Options tab like see the screenshot below:-
Then click on Configure Parameters button. Then you’ll get another window like below and then you need to click on add row button :-
Under the name filed you need to type “sched.swap.dir” and in the value field you need to type the path of datastore where you want swap files. Like in my case I have dedicated datastore for Swap files, so I have defined the path “/vmfs/volumes/Swap-Datastore” and the click on OK
After that when you powered in that VM the swap file get created under new datastore. You can browse and confirm thenswap file is under this like:-
So now swap file location is as per your requirement.