VM Snapshot locked file

Running RV-tools today I see one of the Symantec NBU snapshots failed to delete on one of my VM’s

I delete the snapshot from the snapshot manager but got the following warning message.

vmware

Browsing the Data store I see there is still a snapshot file and duplicate vmdk’s (Not Good)

vmware

I ran the consolidate VM option from the Snapshot menu but got this error

vmware

To fix,

  1. Browse the datastore of the VM
  2. Download the vmware.log file and open in Notepad++
  3. Find “Failed to lock the file”
  4. You should see a list of all lock fails

vmware

  1. SSH onto the host
  2. Run ~ # lsof | grep /vmfs/volumes/50081cbd-fadf9d0b-1ce6-441ea14ad2e0/wvgensipsp01/***This VMDK file that failed to lock***
  3. If there is more than one VMDK then run the command (5.) on each one to ID the locked processes
  4. My one was locked to the –flat.vmdf

vmware4

  1. Take note of the PID number (3116)
  2. Run ~ # Kill 3116 (If you don’t want to Kill the process you can restart the management agents and it will have the same effect ~ # sbin/services.sh restart
  3. Now run the Consolidate VM and it should complete successfully

vmware5

Datastore after the consolidation… Much better

vmware6

Leave a Reply

Your email address will not be published. Required fields are marked *