VMware Cloud Community
mastrboy
Contributor
Contributor

Could not power on VM - No swap file / Lock was not free

We have a vm we can't power on, after some searching through the logs i have found the following:

From the /var/log/vmkernel:

Jan 24 12:21:06 vmware01 vmkernel: 101:20:35:51.076 cpu2:1283)WARNING: Swap: vm 1284: 1528: Failed to open swap file '/volumes/45654764-a6f8d5dd-8d48-0018fe897e46/vm-vcenter/vm-vcenter-d21c04a8.vswp': Lock was not freeJan 24 12:21:06 vmware01 vmkernel: 101:20:35:51.076 cpu2:1283)WARNING: Swap: vm 1284: 2448: Failed to initialize swap file '/volumes/45654764-a6f8d5dd-8d48-0018fe897e46/vm-vcenter/vm-vcenter-d21c04a8.vswp'

And from the vm's vmware.log:

Jan 23 15:36:32.902: vmx| http://msg.vmmonVMK.creatVMFailed Could not power on VM : No swap file.

After searching through the forum i have found the following sugested solutions:

- Check if there is a process hanging that still use the VM (ps aux|grep -i vm-vcenter)

- Delete / Move the swap file

- Uncomment the swap section in the vmx file

- Unregister and re-register the host

All of these are testet and none worked.. I also found someone sugesting a reboot, but i want to avoid rebooting a production server..

Anyone got any sugestions?

0 Kudos
2 Replies
dinny
Expert
Expert

Hiya,

If you are using vmotion (and have spare ESX capacity) - you can always move off any running VMs before rebooting the ESX server.

That's definitely the best way.

I think I might have got round similar issues in the past by removing it from the VC inventory - then re-registering it on a different ESX server via the datastore browser though?

I'm afraid I can't remember for certain - but you could always give it a go?

Dinny

0 Kudos
Dthomsen
Enthusiast
Enthusiast

If HA caused it you will have to hit the other hosts in the cluster. Run:

ps -aux | grep -i VM_Name

on all other hosts in the cluster. One of them should show two processes (every host will show the ps that you kicked off). On that server kill the process that claims to have the file locked.

0 Kudos