Troubleshoot Datastore Maintenance Mode Failures - VMware vSphere ESXi
search cancel

Troubleshoot Datastore Maintenance Mode Failures - VMware vSphere ESXi

book

Article ID: 451095

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Attempts to place a datastore into maintenance mode fail with the message "The enter maintenance mode task will start but cannot finish..." even when the datastore appears empty or contains no virtual machines. This issue occurs when vCenter inventory retains stale references to objects on the datastore.

  • Maintenance mode task hangs at 1%.
  • Datastore appears empty in the browser.
  • vCenter reports VMs reside on the datastore despite none being visible.
  • Common causes include stale ISO pointers, VM templates registered in inventory, or hidden vCLS VMs.

 

 

Environment

 

  • VMware vSphere ESXi 7.x, 8.x
  • VMware VCF 9.x

 

Cause

vCenter Server tracks datastore usage through its internal database. If a template or VM is registered to a datastore in the database, the maintenance mode workflow waits for that object to be evacuated. Stale inventory references or hidden vSphere Cluster Services (vCLS) VMs prevent the task from completing.

Resolution

 

  • Identify referencing VMs and Templates:
    1. Navigate to the VMs and Templates view.
    2. Check for any templates or VMs that list the target datastore in their Summary tab.
    3. If a template is found, right-click and select Remove from Inventory (do not remove from disk if the files are needed).
  • Clear Stale ISO Pointers:
    1. Check VM CD/DVD drive configurations.
    2. Point the CD/DVD drive to an ISO on a different datastore or set the device to "Client Device."
  • Handle vCLS VMs:
    1. Check the Cluster > Configure > vSphere Cluster Services > VMs to identify any vCLS VMs pinned to the datastore.
    2. If the datastore is the only one available, enable "Retreat Mode" on the cluster to force the removal of vCLS VMs.
    3. Once the datastore maintenance mode is successful, disable Retreat Mode to allow vCLS VMs to redeploy.
  • Identify File Locks (Advanced):
    1. Log in to the ESXi host CLI.
    2. Run the following command to identify locks on the datastore: vmfsfilelockinfo -p /vmfs/volumes/####
    3. If an active lock is found, restart management agents on the host holding the lock using: services.sh restart