SRM SWAP File error

Posted on 2013-11-26
Last Modified: 2013-12-21
HI there

Im currently trying to get our SRM (Version 5.0.1) working, but am having an issue with the SWAP files.

We have two VNXs one at each site and we have LUNs that we are replicating, Ive Created the IP mapping and Protection groups and the Recovery PLans we want.

THe machines that are on SRM ive edit their VMX file so point to a none replicated LUN by doing the following:
"1.Power off the virtual machine.
2.Unregister the virtual machine. Right-click the virtual machine in the Inventory and choose Remove from Inventory.
3.Connect to the host:

¿For ESX, use an SSH client. For more information, see Connecting to an ESX host using a SSH client (1019852).
¿For ESXi, use Tech Support Mode. For more information, see Tech Support Mode for Emergency Support (1003677) or Using Tech Support Mode in ESXi 4.1 and ESXi 5.x (1017910).

4.Change directory to the folder where the virtual machine resides:

cd /vmfs/volumes/datastore_name/virtual_machine_folder/

5.Edit the virtual machine's configuration file with a text editor.
6.Add this line:

sched.swap.dir = /vmfs/volumes/datastore/

7.Register the virtual machine again. For more information, see Registering or adding a virtual machine to the inventory on vCenter Server or on an ESXi/ESX host (1006160)."

However when i run a Test on a Recovery plan the servers wont boot up and have the following error:
"unable to create a swap file the value of sched swap dir specified in the vms configuration file is invalid"

Id be greatful on how to resolve this
Question by:Colchester_Institute
  • 5
  • 4

Expert Comment

by:Steve M
ID: 39679073
What was the location of your previous swap dir?  Could you post the location of your swap and virtual machine dir so we can verify it looks right?

It should look something like this (of course yours will be different depending on your storage setup and vm name):


Author Comment

ID: 39680132
the VMs have been migrated to a new SAN

the SWAP location is exactly how you mention it should it should be and when i look at the Datastore the SWAP file is there.  

Servers not on SRM are simpy set to default to there VM directory for their WAP file as those servers sit on non replicated luns.

Im wondering if its to do with the name of the LUN on fail over?

the name of the LUN/SWAP file location is <site prefix>_SRM_SWAP_LUN501, so obviously at the two sites the "sitePreifx part is different

Expert Comment

by:Steve M
ID: 39681179
That sounds correct - the path needs to be whatever the new location is, so if you have <site1>_SRM_SWAP_LUN501, and you have moved to a new SAN location of  <site2>_SRM_SWAP_LUN501 then you will need to update that path to match.

Are you are not using storage vmotion to migrate the vm, then you will need to edit the vmx in most cases I believe.

Author Comment

ID: 39681212
No its Definitley SRM as the migrations have taken place.

Basically at the moment out of our server environmet we have 30 or so that are on Replicated LUNS and on the SRM system.  Those servers i have manually changed the CVMX file to poing their SWAP file location to the SWAP FILE LUN which is non-replicated.

So my understanding from this converastion is for the servers to work on SRM the SWAP File Location must have the same name so in my case i would just need two LUNS named SRM_SWAP_LUN501

NB: can i put two locations within the VMX? Im thinking i cant but want to check
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.


Expert Comment

by:Steve M
ID: 39681681
Oh Boy - I just realized that I totally misunderstood the original question.  I apologize, I thought you had an application called SRM or a VM called SRM that you were migrating.  Now I think I realize that you are using VMware SRM, Site Recovery Manager, (this is why I hate acronyms), is this correct?

Author Comment

ID: 39683013
haha yes thats correct.

We are using SRM (Site Recovery Manager)

I have around 30 guest systems placed into it.

THe systems that are in SRM are obviously on Replicated LUNs and so ive changed there locations of the SWAP file Manually as described in the process in my original post.  All othe systems are on non replicated LUNs and their SWAP files are stored in their default location i.e the guest folder with aits vmx files etc.

When i run a SRM test the servers wont boot up at the recovery end with the error "unable to create a swap file the value of sched swap dir specified in the vms configuration file is invalid"

hope thios help clarify issue im having

Expert Comment

by:Steve M
ID: 39683913
Man I wish I could help, but I have no experience with the SRM product unfortunately, sorry.

Have a look through this and see if it helps -


Accepted Solution

Colchester_Institute earned 0 total points
ID: 39721482
Resolved by changing how all our vms store their swap files. We now have dedicated LUNS at both sites that are solely for the SWAP files and thus on an SRM fail over the machines will now boot

Author Closing Comment

ID: 39733387
no other solutions were acceptable and after researching more on various VM sites this seemed to be the best way to do it

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Remove a folder in Linux 9 91
V2V Hyper-V RODC to ESXi 4 65
VMWare esxi 5.1 to 6.0 upgrade 15 51
Could you bit more specific in describtion 2 32
Will try to explain how to use the VMware feature TAGs in the VMs and create Veeam Backup Jobs using TAGs. Since this article is too long, I will create second article for the Veeam tasks.
When rebooting a vCenters 6.0 and try to connect using vSphere Client we get this issue "Invalid URL: The hostname could not parsed." When we get this error we need to do some changes in the vCenter advanced settings to fix the issue.
Teach the user how to convert virtaul disk file formats and how to rename virtual machine files on datastores. Open vSphere Web Client: Review VM disk settings: Migrate VM to new datastore with a thick provisioned (lazy zeroed) disk format: Rename a…
Advanced tutorial on how to run the esxtop command to capture a batch file in csv format in order to export the file and use it for performance analysis. He demonstrates how to download the file using a vSphere web client (or vSphere client) and exp…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now