Knowledge Base

The VMware Knowledge Base provides support solutions, error messages and troubleshooting guides
 
Search the VMware Knowledge Base (KB)   View by Article ID
 

Deleting a vmdk file for a virtual machine that is no longer used fails: Device or resource busy (1039362)

Symptoms

  • You have a virtual machine folder on a datastore, for a virtual machine that has been deleted.
  • When you right-click on a virtual machine's virtual disk file, the Delete option is not available (greyed out).
  • Attempting to remove the virtual disk file fails, even though
    • There is no lock on the virtual disk file.
    • There is no process that has locked the virtual disk file.

  • Attempting to removing the virtual disk file fails with the error:

    Device or resource busy.

Resolution

Some virtual machine backup solutions, as part of their backup approach, mount a virtual machine's virtual disk file (.vmdk) to a virtual machine other than the one the .vmdk originally belonged to. When this happens, the .vmdk whose parent virtual machine had been deleted is still mounted to a running virtual machine. Even though the .vmdk file is not technically open, it is mounted to the backup solution's virtual machine.
 
To resolve this issue, you must locate the virtual machine that has this .vmdk mounted and then unmount it. To do so:
  1. Search for references to the .vmdk file in the settings files (.vmx files) of the other virtual machine's on the datastore. You can automate the search with a command like this:

    find /vmfs/volumes/* -name *.vmx -exec grep -Hi <name-of-the-file.vmdk> {} \;

    where <name-of-the-file.vmdk> is the .vmdk you're trying to delete.

    Note: You need to run this command from each host that can see the datastore, because the .vmx file is locked on all hosts except the one on which it is running.

  2. After you have located the virtual machine which has mounted the .vmdk, remove it. Select that virtual machine and go to Edit Settings > Hard Disk > Remove.

After you have removed the .vmdk file from the backup virtual machine, you can delete the file using normal methods.

Tags

files-locked  locked-vm-files  locked-vm-files.vmx.vmdk.vswp  delete-fails

Request a Product Feature

To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.

Feedback

  • 10 Ratings

Did this article help you?
This article resolved my issue.
This article did not resolve my issue.
This article helped but additional information was required to resolve my issue.
What can we do to improve this information? (4000 or fewer characters)
  • 10 Ratings
Actions
KB: