VMware Cloud Community
RahulC
Contributor
Contributor

unable to unlock a virtual machine

Hi guys,

Whenever i try to power on a virtual machine, i get the error below. Is there a way i can unlock the this VM from its host.

Unable to access file <unspecified filename> since it is locked System

0 Kudos
19 Replies
Troy_Clavell
Immortal
Immortal

What VMware product are you hosting this guest on?

0 Kudos
scott28tt
VMware Employee
VMware Employee

This discussion doesn't belong in this area of the forums, please advise what VMware product you are using and I can move this discussion to the most relevant area.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos
RahulC
Contributor
Contributor

Sorry about the delay. Esx 4.1 is the host hosting this 2003 VM that i am unable to power on.

0 Kudos
scott28tt
VMware Employee
VMware Employee

Moved to the ESX 4 community forum.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos
aravinds3107
Virtuoso
Virtuoso

Check this KB

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=10051

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful |Blog: http://aravindsivaraman.com/ | Twitter : ss_aravind
0 Kudos
RahulC
Contributor
Contributor

[root@ABCD123 SERVER]# vmkfstools -D /vmfs/volumes/4958d4bf-2c20a507-2982-001a4bff0978/SERVER/SERVER-1257e06f.vswp
[root@ABCD123 SERVER]# tail /var/log/vmkernel
Mar  6 10:35:57 ABCD123 vmkernel: 0:13:41:17.008 cpu1:4331)WARNING: Swap: vm 4332: 2457: Failed to open swap file '/volumes/       4958d4bf-2c20a507-2982-001a4bff0978/LONINF005/LONINF005-fad8f839.vswp': Lock was not free
Mar  6 10:35:57 ABCD123 vmkernel: 0:13:41:17.008 cpu1:4331)WARNING: Swap: vm 4332: 4356: Failed to initialize swap file '/vo       lumes/4958d4bf-2c20a507-2982-001a4bff0978/LONINF005/LONINF005-fad8f839.vswp': Lock was not free
Mar  6 10:35:57 ABCD123 vmkernel: 0:13:41:17.008 cpu1:4331)WARNING: Swap: vm 4332: 4521: Swap initialization failed Lock was        not free
Mar  6 10:35:57 ABCD123 vmkernel: 0:13:41:17.008 cpu1:4331)WARNING: World: vm 4332: 1111: init fn swap failed with: Lock was        not free!
Mar  6 10:37:30 ABCD123 vmkernel: 0:13:42:49.816 cpu6:4198)FS3: 142: <START SERVER-1257e06f.vswp>
Mar  6 10:37:30 ABCD123 vmkernel: 0:13:42:49.816 cpu6:4198)Lock [type 10c00001 offset 46454784 v 375, hb offset 4177920
Mar  6 10:37:30 ABCD123 vmkernel: gen 29147, mode 1, owner 4f4d0250-e7143d4a-8eea-0022640d38f8 mtime 1326]
Mar  6 10:37:30 ABCD123 vmkernel: 0:13:42:49.816 cpu6:4198)Addr <4, 92, 107>, gen 108, links 1, type reg, flags 0x0, uid 0,        gid 0, mode 600
Mar  6 10:37:30 ABCD123 vmkernel: 0:13:42:49.816 cpu6:4198)len 4294967296, nb 4096 tbz 0, cow 0, zla 3, bs 1048576
Mar  6 10:37:30 ABCD123 vmkernel: 0:13:42:49.816 cpu6:4198)FS3: 144: <END SERVER-1257e06f.vswp>

Please help I just can t go beyond this.SERVER-1257e06f.vswp seems to be locked. how do i unlock it

0 Kudos
aravinds3107
Virtuoso
Virtuoso

Did you try to restart the management agents of the host on which VM found running?

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful |Blog: http://aravindsivaraman.com/ | Twitter : ss_aravind
0 Kudos
virtualdutch
Enthusiast
Enthusiast

If you want to “kill” the process, you can log onto to the ESXi Server, and selecting Restart Network Management Agents.

or login to the ESXi server via ssh, and run /sbin/services.sh

0 Kudos
RahulC
Contributor
Contributor

This is an ESX server, would this still work run /sbin/services.sh

I am not able to run this command

0 Kudos
virtualdutch
Enthusiast
Enthusiast

0 Kudos
RahulC
Contributor
Contributor

Did that already. Same error cant power on the machine

0 Kudos
aravinds3107
Virtuoso
Virtuoso

Are you able to remvoe the VM from vcenter(Remove from Inventory)? If Yes try to remvoe and re-add it to the Inventory

If this is not solving then i think rebooting of the ESX host should remvoe the lock

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful |Blog: http://aravindsivaraman.com/ | Twitter : ss_aravind
0 Kudos
TomHowarth
Leadership
Leadership

Can you print out the list of files on the data store that relate to this Virtual machine please

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
0 Kudos
RahulC
Contributor
Contributor

I have even rebooted the host but i am still unable to power on that server. I have identified the lock as stated in my earlier comments. Is there no other way to release the lock

0 Kudos
RahulC
Contributor
Contributor

[root@ESXHOST SERVER1234]# vim-cmd vmsvc/getallvms
Vmid     Name                         File                             Guest OS                                                   Version   Annotation
16     LONRBO006   [Storage1] Server1/Server1.vmx   windows7Server6                                         4Guest   vmx-07
32     LONCTX081   [Storage 2] Server2/Server2.vmx        winNetStandardG                                         uest     vmx-07
48     SERVER1234   [Storage 3] SERVER1234/SERVER1234.vmx        winNetStandard6                                         4Guest   vmx-04


Cat vmware-223.log

Mar 06 13:14:37.999: vmx| MONITOR MODE: guestOS preferred modes: HWMMU BT HV
Mar 06 13:14:38.000: vmx| MONITOR MODE: filtered list          : BT
Mar 06 13:14:38.000: vmx| HV Settings: virtual exec = 'software'; virtual mmu = 'software'
Mar 06 13:14:38.122: vmx| VMMon_ConfigMemSched: vmmon.numVCPUs=2
Mar 06 13:14:38.123: vmx| CreateVM: Swap: generating normal swap file name.
Mar 06 13:14:38.124: vmx| Swap file path: '/vmfs/volumes/4958d4bf-2c20a507-2982-001a4bff0978/SERVER1234/SERVER1234-1257e06f.vswp'
Mar 06 13:14:42.133: vmx| Msg_Post: Error
Mar 06 13:14:42.134: vmx| [vob.swap.poweron.openfailure.status] Failed to initialize swap file '/volumes/4958d4bf-2c20a507-2982-001a4bff0978/SERVER1234/SERVER1234-1257e06f.vswp' : Lock was not free
Mar 06 13:14:42.134: vmx| [msg.vmmonVMK.creatVMFailed] Could not power on VM : Lock was not free.
Mar 06 13:14:42.134: vmx| [msg.monitorLoop.createVMFailed] Failed to power on VM----------------------------------------
Mar 06 13:14:42.148: vmx| Module MonitorLoop power on failed.

Sorry didint check your post earlier. here is the print

0 Kudos
TomHowarth
Leadership
Leadership

no that is not what I meant,  I want to see what is acutally on the datastore.  ie what is in the following folder

/vmfs/volumes/4958d4bf-2c20a507-2982-001a4bff0978/SERVER1234/

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
0 Kudos
RahulC
Contributor
Contributor


root@ESXHOST SERVER1234]# cd /vmfs/volumes/4958d4bf-2c20a507-2982-001a4bff0978/SERVER1234
[root@ESXHOST SERVER1234]# ls
SERVER1234-1257e06f.hlog  SERVER1234.vmx   vmware-222.log  vmware-231.log
SERVER1234-1257e06f.vswp  SERVER1234.vmxf  vmware-223.log  vmware-232.log
SERVER1234_1-flat.vmdk    vmware-198.log  vmware-224.log  vmware-233.log
SERVER1234_1.vmdk         vmware-216.log  vmware-225.log  vmware-234.log
SERVER1234-aux.xml        vmware-217.log  vmware-226.log  vmware-235.log
SERVER1234-flat.vmdk      vmware-218.log  vmware-227.log  vmware-236.log
SERVER1234.nvram          vmware-219.log  vmware-228.log  vmware-237.log
SERVER1234.vmdk           vmware-220.log  vmware-229.log  vmware.log
SERVER1234.vmsd           vmware-221.log  vmware-230.log

Is this what you are looking for?

0 Kudos
virtualdutch
Enthusiast
Enthusiast

Have you removed the virtual machine already from the inventory and readd the .vmx from the datastore to the inventory?

0 Kudos
TomHowarth
Leadership
Leadership

delete the file ending in *.vswp that is your swap memory that is created on power on.  if you delete that you should be able to start or guest.  the guest will be in a crash consisant state.

if there is a folder in the directory with the *.lkc extension delete that too

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
0 Kudos