VMware

This Question is Answered

1 "correct" answer available (10 pts) 1 "helpful" answer available (6 pts)
1 2 Previous Next 20 Replies Last post: May 17, 2007 12:47 AM by ciscen  

change the swap File Path ? posted: Dec 10, 2006 12:37 PM

Click to view mailmisch's profile Novice 25 posts since
Jan 8, 2006
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

Re: change the swap File Path ?

1. Dec 10, 2006 12:55 PM in response to: mailmisch
Click to view acr's profile Virtuoso 3,012 posts since
Nov 17, 2005
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..

Re: change the swap File Path ?

2. Dec 10, 2006 1:03 PM in response to: mailmisch
Click to view acr's profile Virtuoso 3,012 posts since
Nov 17, 2005
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..

Re: change the swap File Path ?

3. Dec 10, 2006 3:10 PM in response to: mailmisch
Click to view gogogo5's profile Expert 342 posts since
Aug 14, 2006
yes you can, you need to use the sched.swap.dir parameter for the vm. See page 141 in the Resource Management PDF.

Re: change the swap File Path ?

4. Dec 10, 2006 4:08 PM in response to: gogogo5
Click to view acr's profile Virtuoso 3,012 posts since
Nov 17, 2005
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.

Re: change the swap File Path ?

5. Dec 10, 2006 4:11 PM in response to: mailmisch
Click to view acr's profile Virtuoso 3,012 posts since
Nov 17, 2005
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..

Re: change the swap File Path ?

6. Dec 11, 2006 8:49 AM in response to: acr
Click to view kitcolbert's profile Expert VMware Employees 310 posts since
Feb 15, 2006
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.

Re: change the swap File Path ?

8. Dec 11, 2006 12:12 PM in response to: kitcolbert
Click to view acr's profile Virtuoso 3,012 posts since
Nov 17, 2005
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..

Re: change the swap File Path ?

9. Dec 11, 2006 12:13 PM in response to: mailmisch
Click to view acr's profile Virtuoso 3,012 posts since
Nov 17, 2005
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..!!)

Re: change the swap File Path ?

10. Dec 11, 2006 1:37 PM in response to: acr
Click to view kitcolbert's profile Expert VMware Employees 310 posts since
Feb 15, 2006
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?

Re: change the swap File Path ?

11. Dec 11, 2006 1:59 PM in response to: kitcolbert
Click to view acr's profile Virtuoso 3,012 posts since
Nov 17, 2005
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..

Re: change the swap File Path ?

12. Dec 11, 2006 2:06 PM in response to: acr
Click to view kitcolbert's profile Expert VMware Employees 310 posts since
Feb 15, 2006
That is quite odd. What happens when you set 'sched.swap.dir' and delete 'sched.swap.derivedName' altogether?

Re: change the swap File Path ?

13. Dec 11, 2006 2:11 PM in response to: kitcolbert
Click to view acr's profile Virtuoso 3,012 posts since
Nov 17, 2005
Ah, never tried that one..

Re: change the swap File Path ?

14. Dec 11, 2006 2:12 PM in response to: kitcolbert
Click to view acr's profile Virtuoso 3,012 posts since
Nov 17, 2005
Ok, quickly tried it.. All ok..

VMware Beta Programs

Want to be Considered for Future Beta Programs?

Learn More

VMware Developer

Download SDKs, APIs, videos,
training, and more in the Developer community.

Learn More

Developer
Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld
Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

Only VMware ... Delivers Nexus 1000V

Ensure consistent, policy-based network capabilities to virtual machines across your data center.

Learn More

Communities