VMware Cloud Community
HUNGAMA
Enthusiast
Enthusiast

Virtual Machine gives swap file error

Hi Friends

I am trying to power on an existing VM but it is giving me " NO SWAP FILE " error. I am not sure if it was working before or not because I just joined this job. If there any way to recreate the swap file for the VM?

Regards

Shail

0 Kudos
5 Replies
ax_s
Enthusiast
Enthusiast

The problem is not a missing swap file but a swap file that is locked by a process form an ESX host.

To delete this lock you must reboot the ESX host that is holding the file.

If you have more than one host it is not so easy to find out wich host this is.

Here a short instruction:
- make a ssh session to one host (e.g. with PUTTY) and log in as root
- type: tail -f /var/log/vmkernel
- open a new session to the same host and log in as root
- type: vmkfstools -D '/vmfs/volumes/yourVolume/yourVM/yourVM-aa32f76f.vswp' (the name of the file varies)
- at the first console session some lines appear. Somewhere there you will find the UUID of the locking host (something like this: 470f29ca-df0ea93b-3750-0019bb3f862c)
- now you have to find out which host this is; open a ssh session to the next host and type: esxcfg-info | grep -i system.*uuid
the output looks like this:
|----System UUID..............................................473424d0-753c-44ea-7296-0013216a0d97
if the UUID matches to the above mentioned reboot the host.
- After rebooting you can start the VM

Hope this helps

Axel

0 Kudos
ascari
Expert
Expert

it's possible that had you renamed a datastore contaning your swap files? In this case:

power off your vm, edit setting and then option tab and advanced. Click on Configuration parameter and change volume name.

Bye Alberto

0 Kudos
petedr
Virtuoso
Virtuoso

Here are a couple of posts that talk about this issue, as Axel said is usually means a process has a lock on the VM and needs to be killed.

http://communities.vmware.com/message/839190#839190

http://communities.vmware.com/thread/50436

www.thevirtualheadline.com www.liquidwarelabs.com
0 Kudos
HUNGAMA
Enthusiast
Enthusiast

Thanks for the update mate.

I tried the commands but surprisingly the uuid of my esx servers doesn't match the uuid shown in log file. I think the esx host has been removed from the cluster. with vmkfstools we can reset the lun but i do not want to do that. is there any other way to unlock the swap file?

0 Kudos
ax_s
Enthusiast
Enthusiast

You say you removed a host from the cluster. Is this host still running or does it no more exist?

A non existing or switched off host cannot have a lock on a file. When the host is still running, try to reboot it.

The other way is just to reboot all hosts in the cluster one after another and then try to start the VM.

Axel

0 Kudos