VMware Cloud Community
JRex08
Contributor
Contributor

Have a "Virtual machine disks conslidation is needed" message and consolidating fails on vSphere 5.0.

I currenlty have a SQL Server 2008 VM running on an vSphere 5.0 ESXi host that currently doesn't have any snapshots in the Snapshot Manager but has multiple VM-000001.vmdk, VM-000001-delta.vmdk, VM-000002.vmdk, VM-000002-delta.vmdk via SSH from previous snapshots that didn't appear to consolidate into the VM.vmdk file during previous snapshot consolidations.  Also the VM-000001.vmdk shows up while browsing the datastore but not the VM-000001-delta.vmdk file. Any ideas on how to get these delta's consolidated?  The new "Snapshot-->Consolidate" option fails with the message of "Unable to access file <unspecified filename> since it is locked".

Log is attached during consolidation attempt.

Thanks

Jeremy Rexroad System Administrator VCP5
0 Kudos
3 Replies
vmroyale
Immortal
Immortal

Hello.

Note: Discussion successfully moved from VMware ESXi™ 4 to VMware ESXi 5

Brian Atkinson | vExpert | VMTN Moderator | Author of "VCP5-DCV VMware Certified Professional-Data Center Virtualization on vSphere 5.5 Study Guide: VCP-550" | @vmroyale | http://vmroyale.com
0 Kudos
JRex08
Contributor
Contributor

I was able to locate the issue due to another issue I was having with cloning. I believe this issue was a compounded issue and the "Consolidate" option should have worked but since attempting to clone the VM and it failing, I was unable to use the "Consolidate" option since the cloning task was still active but didn't show within vCenter as being active so but here is what I did to resolve this issue which are resolutions pull out of the KB @ http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=10051 if anyone else runs into this issue:

1. SSH into the ESXi host using Putty or another SSH client.

2. Drilled down to the Datastore where the VM in question resides: cd /vmfs/volumes/<datastore>/<VMDIR>

3. Locate the vmware.log and open with a text viewer.  I used cat vmware.log to view the log.  Also, used putty and set my session to log all screen output but you could extract that log to better review.

4. After you open the log, see if you see any errors regarding locked files, etc. (These errors existed in my case)

5. If errors exist such as "Failed to lock the file" there is possibly a active process that didn't stop correctly from a previous failed task.

6. Run # lsof | grep <name_of_locked_file>

7. Next run Kill <PID> .  The <PID> should be at the begining from the output in step 6 which has been underlined in the following example. (EX:  5303   vpxa-worker  12   29  /vmfs/volumes/4360c6cf-2fee4d90-2404-5ef3fc344abb/VM/<name_of_locked_file>)

8. The host may appear to have went offline for a few seconds if you happen to have a vSphere client open but should reconnect.

9. Next, select the VM which should still have a mesage of "Virtual machine disks consolidation is needed" and select Snapshot-->Consolidate.

10. The file should begin to consolidate and the error message should disappear.

Not sure if this will help anyone since I was my own worst enemy in this case.

Jeremy Rexroad System Administrator VCP5
0 Kudos
reneke34
Contributor
Contributor

I had the same problem and wasn't able to kill the process. However, I issued the following command on the affected ESX server: /etc/init.d/vpxa restart

This restarts the vCenter Server Service Agent. After that, the lock is gone and the consolidate action is successful.

0 Kudos