Error: Unmount datastore failed the resource Datastore is in use.
search cancel

Error: Unmount datastore failed the resource Datastore is in use.

book

Article ID: 379435

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

 Unmounting or removing a datastore from vCenter Server or an ESXi host fails with an error indicating the resource is in use. This behavior persists even when no active Virtual Machines are running on the storage.

 Symptoms:

  • Attempt to unmount an NFS or VMFS datastore fails.

  • The vSphere Client displays the error: Unmount datastore failed! The resource <Datastore_Name> is in use.

  • The datastore is reported as inaccessible or offline, but remains in the inventory.

  • One or more templates are visible in the datastore Summary tab.

Environment

VMware vSphere ESXi 7.x
VMware vSphere ESXi 8.x


Cause

vCenter Server maintains logical locks and dependencies on datastores hosting registered inventory objects (VMs, templates, or ISOs). These locks prevent accidental data loss. If a pointer to a template remains in the vCenter database, the unmount operation will fail.

Resolution

Unregister the template from the vCenter inventory to release the logical lock before attempting the unmount operation.

Option 1: Unregister via vSphere Client

  1. Navigate to the affected datastore in the vSphere Client.

  2. Select the VMs tab.

  3. Change the filter/view from Virtual Machines to VM Templates.

  4. Right-click the template and select Remove from Inventory.

  5. Confirm the removal by clicking Yes.

  6. Perform the datastore unmount or deletion operation.

Option 2: Alternative Workaround

If removing from inventory is not preferred, migrate the object:

  1. Convert the template to a Virtual Machine.

  2. Migrate the Virtual Machine to a different datastore.

  3. Convert the Virtual Machine back into a template.