VMware Cloud Community
Ralf-B
Contributor
Contributor

change the swap File Path ?

Hi All,

its possible to change the path for th Virtual Mashines ? We have got the follwing problem, in our vmfs2 (esx 2.5.3) we have got 5 Virtual mashines and in this VMFS are ONLY 200 MB free. Now we watn to update to VI3 and i read that the in VI3 the swap File will be generated for every VM in their own path. the Virtual Mashines have got 20 GB RAm (each of them 4 GB) and i think i will get some problems to power on the Vms after the migration.

Thanks for any helpfull tip

Ralf

0 Kudos
20 Replies
acr
Champion
Champion

To be honest only having 200M free space will most likly cause you other problems..

Are these all locally stored VMs or are they SAN attached..

0 Kudos
acr
Champion
Champion

You may be able to do this by editing the .vmx files but your going to loose HA etc.. Which depending on how you've got this setup may or may not be a problem..

0 Kudos
gogogo5
Hot Shot
Hot Shot

yes you can, you need to use the sched.swap.dir parameter for the vm. See page 141 in the Resource Management PDF.

0 Kudos
acr
Champion
Champion

Absolutely, and by default you'll have the sched.swap.derivedName, which will also need to reflect the new path set by the sched.swap.dir parameter.

0 Kudos
acr
Champion
Champion

I did a test on one of our VMs.. just added these to .vmx

sched.swap.dir

/vmfs/volumes/43e8b777-ecf41a8a-958e-000d60eb81e4/testDIR/

sched.swap.derivedName

/vmfs/volumes/43e8b777-ecf41a8a-958e-000d60eb81e4/testDIR/test-408f9806.vswp

Worked a treat, although might be easier to configure through VC..

1. Select VM --> Edit Settings --> Options Tab --> Advanced

2. Click Configuration Parameters Button.

3. Add new Row --> Enter Name Field = sched.swap.dir

4. In Value Field Enter full path..

Make sure "sched.swap.derivedName" also reflects changes..

This will add the lines to the .vmx..

0 Kudos
kitcolbert
VMware Employee
VMware Employee

sched.swap.derivedName is not quite what you think it is. You don't need to worry about it.

Also, as acr mentioned, you have to set sched.swap.dir to a directory on a shared VMFS volume if you want to still be able to VMotion the VM or have it work under DRS and HA.

0 Kudos
Ralf-B
Contributor
Contributor

at first, Thanks acr and kitcolbert .... i test it, works fine Smiley Happy

acr writes i will loose the funktions as HA....

Do i get any Problems with HA or DRS or vcb or or or...?? Ofcourse i will set a path on a shared SAN LUN fpr the swap File.

Ralf

0 Kudos
acr
Champion
Champion

Hi Kit, you get the sched.swap.derivedName by default (or at least my VM have) in the .vmx

If you then change the location of the swap file using sched.swap.dir you must also reflect the change to sched.swap.derivedName, other when you start the VM VC throws up an error cant locate swap, which sort of make sense..

0 Kudos
acr
Champion
Champion

I was only really referring to loosing HA etc if your location was of the SAN..

Remember its christmas, we do this for the points (some times just for the love of it..!!)

0 Kudos
kitcolbert
VMware Employee
VMware Employee

So basically the value for 'sched.swap.derivedName' is generated by the VM and written to the config file each time the VM powers on. Thus any changes you make to that file before you power-on the VM will be overwritten by the VM when it powers on. Thus even if you set it to some invalid value it won't affect the VM at all (or at least it shouldn't). What is the VC error you were seeing?

0 Kudos
acr
Champion
Champion

Hi Kit,

From the start i had the 'sched.swap.derivedName' in my .vmx file (actually all my .vmx files) and its path points to the same dir as my all the VM files..

So i added the 'sched.swap.dir parameter', and pointed it to a different directory on my VMFS partition..

But as long as the 'sched.swap.derivedName' pointed to the original path, my VC always reported 'error unable to start VM cache not found'..

I edited the 'sched.swap.derivedName' to have the same path as 'sched.swap.dir' and everything worked ok..

I played with the posistion of these, i.e putting one above the other etc, as long as 'sched.swap.derivedName' did not reflect the same path as 'sched.swap.dir parameter' i always got the error..

If i removed 'sched.swap.dir parameter' everything was ok and regardless of how i changed 'sched.swap.derivedName' it would always default back to its original settings..(as long as 'sched.swap.dir' didnt exist)

hope this is clear..

0 Kudos
kitcolbert
VMware Employee
VMware Employee

That is quite odd. What happens when you set 'sched.swap.dir' and delete 'sched.swap.derivedName' altogether?

0 Kudos
acr
Champion
Champion

Ah, never tried that one..

0 Kudos
acr
Champion
Champion

Ok, quickly tried it.. All ok..

0 Kudos
kitcolbert
VMware Employee
VMware Employee

Interesting. I'm surprised that having sched.swap.derivedName set to something different than sched.swap.dir should cause any problems. sched.swap.derivedName is strictly written out by the VM (it is never read) and thus shouldn't prevent the VM from powering on. Perhaps VC is reading it incorrectly or too early or something and then killing a VM as the result (or just not allowing it to start). Let me check with some VC engineers.

0 Kudos
acr
Champion
Champion

Thx Kit..

0 Kudos
Ralf-B
Contributor
Contributor

Hi acr, Hi kit,

don´t forget me please Smiley Happy

do i loose any funtions such as HA, DRS, vmotion or something else when i change the Path for the swap File. Ofcourse i want to be use a path in a shared volume.

Thanks

Ralf

0 Kudos
kitcolbert
VMware Employee
VMware Employee

Ralf, as long as all your ESX machines can see the shared volume that you store the VM's swap file on and that shared volume has enough free space to create the swap file, then you shouldn't have any problem with VMotion, DRS, HA, etc.

kitcolbert
VMware Employee
VMware Employee

acr, please check the e-mail address you specified in your vmtn forums profile, as I've sent you an e-mail with some info about collecting some debugging info for this issue to send to me. Thanks!

0 Kudos