Unable to delete the virtual machine snapshot due to locked files

Sharing is caring!

To work around this issue:
  1. Power down the backup server, or remove the .vmdk from the backup virtual appliance or the other virtual machine the disk is attached to. Warning: Do not select Delete option as it will result in data loss.
  2. Create a new snapshot of the affected virtual machine and then Perform a Delete All from the snapshot manager to consolidate all snapshots.
  3. If the delete succeeds, check the folder of the virtual machine to ensure that all the snapshots are consolidated. 
  4. If the delete fails again with lock messages, determine which host still has a lock on the name-flat.vmdk or name-delta.vmdk file.
  5. If it continues to fail with lock messages, restart the management agents on the ESX/ESXi host where the virtual machine is running. 
  6. If you are unable to determine the process or virtual machine holding the lock on the file in the error, consider migrating the running virtual machines of the ESX host that is holding a lock and reboot. 

Alternatively, if you are unable to reboot ESX host, you can consider cloning the disk in question and create a new disk.

To clone and attach the new disk back:

  1. Power off the virtual machine with the locked disk.
  2. Clone the latest snapshot disk (i.e. name-000003.vmdk) from the command line. 
  3. Once clone is complete, remove the locked disk from the virtual machine using Remove from virtual machine option.
  4. Attach the cloned .vmdk as to the virtual machine and power it up.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.