Cannot Delete .vmdk

Recently I had an issue removing a .vmdk from an old Datastore. VSphere was not allowing the deletion to occur because the file was still in use. Odd. Using SSH to the host console and some *nix commands, I was able to unlock the file without rebooting the host.

1.     SSH to your ESX host. If SSH is disabled you’ll need console access of some sort.

2.     Run the following :

lsof |grep vmname (vmname is the name of the virtual machine having the issue)

3.     Kill the process.

kill -9 pid ( pid is the process ID, in the image below it is 9143)

Image

You may also like...