Unmounting a datastore fails with error "Cannot unmount volume '<datastore name>' because "One or more virtual machines are still registered on it". Correct the problem and retry the operation."
search cancel

Unmounting a datastore fails with error "Cannot unmount volume '<datastore name>' because "One or more virtual machines are still registered on it". Correct the problem and retry the operation."

book

Article ID: 321318

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

  • On the vSphere Client, attempting to unmount a datastore from ESXi fails with error "Cannot unmount volume <Datastore> because "One or more virtual machines are still registered on it". Correct the problem and retry the operation."

Environment

VMware vSphere 7.x
VMware vSphere 8.x

Cause

  • The unmount operation on a datastore fails if Virtual Machines or Templates remain registered in the vCenter Server inventory while residing on the datastore.
  • Below are other reasons that can prevent unmounting an ESXi datastore:

    1. Storage I/O Control (SIOC):
      If the SIOC service is enabled on the datastore, the host maintains an active management stream that blocks the unmount.

    2. Swap File Configurations:
      The process is prevented if the "Swapping to host cache" or "Host-local swap" options are active and the datastore is currently storing virtual machine swap files.

    3. Diagnostic Coredumps:
      An active configuration that directs ESXi coredumps to a file on the datastore (rather than a coredump partition) creates a persistent file handle.

    4. System Logs and Traces:
      The host cannot unmount the storage if syslog services or trace files are configured to be stored on that specific datastore.

    5. vSphere Cluster Services (vCLS):
      The existence of vCLS agent VMs on the datastore will prevent a successful unmount, as these are required for cluster health.

    6. Active File Handles:
      Any active I/O, such as an open console session, a running backup, or a mounting ISO file, will result in an "In Use" error.

Note: The error message  "Cannot unmount volume <Datastore> because <Reason>" may vary based on the different causes listed above.

Resolution

The following steps address specific causes of datastore unmounting failures:

  1. If virtual machines or templates from the datastore are still registered, then unregister those virtual machines, templates and retry the unmount operation.
    On vSphere Client, right click the VM/Template -> Remove from Inventory

  2. If Storage I/O Control (SIOC) is enabled on the datastore, disable the SIOC service on the datastore and retry the operation.
    For more information, see Unmounting an inactive datastore fails with the error: Cannot remove datastore 'datastore_name' because Storage I/O Control is enabled on it.

  3. If the Host-Local Swap feature was enabled in the datastore, reconfigure the virtual machine swap file properties to use a different datastore or to store the swap files in the virtual machine directories.
    Refer: Change the Swap File Location

  4. If vCLS is configured to the datastore, refer External vCLS Datastore Placement to manage datastore placement for vCLS virtual machines.

  5. If the underlying filesystem is busy, then perform these steps.