Resolving "Resource in Use" Error When Removing a Datastore in vCenter
search cancel

Resolving "Resource in Use" Error When Removing a Datastore in vCenter

book

Article ID: 440924

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

When attempting to remove a datastore from the vCenter Server inventory, the operation fails with a "Resource in Use" error.

Environment

vCenter Server

VMware ESXi

Cause

The datastore remains in a "Resource In Use" state because one or more ESXi hosts are maintaining an active heartbeat signal or have an open file descriptor on the volume, preventing the removeDatastore operation.

Resolution

  1. Navigate to the Datastore view in vCenter.

  2. Right-click the affected datastore and select Unmount. Note: This step identifies if any files (e.g., Swap, ISOs, or Templates) are still in use by a virtual machine.

  3. Select an ESXi host in the vCenter UI that has access to the datastore.

  4. Go to the Configure tab and select Storage Devices.

  5. Locate the specific storage devices (e.g., NAA devices) associated with the datastore.

  6. Select the devices and click Detach from the actions menu.

  7. Repeat steps 3-6 for each ESXi host that has the datastore devices attached to ensure all locks are released.

  8. Once the devices are detached from all hosts, return to the Datastore view.

  9. Right-click the datastore and select Delete. It should now disappear from the inventory.

Additional Information

"Error: "Device or Resource Busy" or "Device in use" when attempting to delete/unmount/disconnect a Datastore"

"Detach a LUN device from ESXi hosts"