Issue w/VM After Backup Where Unable to Consolidate Disks Due to Locked File

Mindwatering Incorporated

Author: Tripp W Black

Created: 11/07/2019 at 10:04 AM

 

Category:
VMWare
vCenter

Issue:
VM has message that Virtual machine disks need consolidation. Performing standard consolidation has error that a file is locked.

Configuration Issues
Virtual machine disks consolidation is needed

Steps to Perform:
Right-click VM --> Snapshot --> Consolidate

Error Message:
Progress varies, but typically between 30% and 50% through the consolidation progress, an error may appear.

Unable to access file since it is locked

What doesn't work:
Shut down guest, and then consolidate - never works
Migrate to another compute (host) - never works
Migrate to another compute (host) and storage while running - didn't work for us


Possible Resolution Option 1:
Do a cold migration of the VM. Shutdown the guest OS if not already cold.
Right-click VM --> Migrate -->
In the Select a migration type tab of the dialog, select to Change both compute resource and storage, click Next -->
In the Select a compute resource tab, select a different host than the current one, click Next -->
In the Select storage tab, select another storage location with enough room, click Next -->
In the Select networks tab, keep the existing network, click Next -->
In the Ready to complete tab, review your selections, click Finish, and wait.

This works for us most of the time.


Possible Resolution Option 2:
If we SSH into the host, we can see the log errors in the/var/log/hostd.log:

AIOMGR Failed to open /vmfs/volumes/... .../mydisk_flat.vmdk : Failed to lock the file (40003)
It will try up to 4 times and then fail.

You can find the host using:
# vmkstools -D /vmfs/volumes/... .../mydisk_flat.vmdk
This command will get you the "RO Owner" NIC Mac Address of the Host with the disk lock.

To make the host let go of the lock, you have to restart the management host daemon:
# /etc/init.d/hostd restart

Although this can be done while the host is up-and-running, we may want to put the host in maintenance mode and evacuate all the other VMs beforehand.




previous page

×