Placing a datastore in maintenance mode fails with "The enter maintenance mode task will start but cannot finish..."
book
Article ID: 408826
calendar_today
Updated On:
Products
VMware vSphere ESXi
Issue/Introduction
When attempting to place a datastore into maintenance mode you see a message saying virtual machines reside on the datastore, but the datastore is empty or has no virtual machines on it.
Environment
VMware vSphere ESXi
Cause
This issue can occur due to any of the following reasons:
Reference to a file or path on that datastore associated with virtual machine configuration. Most often this is caused by stale .iso file pointers configured on virtual machine CD/DVD drives.
Virtual machine templates residing on the datastore
Resolution
Identify the virtual machine(s) that have references to that datastore:
From the datastore view click VMs and this will list VMs that have current, or stale/orphaned associations with the datastore.
Check these VM's CD/DVD drives for datastore .iso config pointing to this datastore and change it by pointing to an .iso on another datastore or change the type from Datastore ISO File to Client Device.
If no VM's show up in the VM tab for the datastore you can check at the ESXi cli on each host mounting that datastore with the following command:
vim-cmd vmsvc/getallvms | grep <datastoreName>
Templates residing on the Datastore:
From the datastore view click VM Templates
If VM templates exist on the datastore, migrate them to a different datastore and attempt putting the datastore in maintenance mode.
Note: If this issue occurs on a datastore which shows inaccessible in vCenter after the underlying storage device is decommissioned, migrating templates is not possible. Remove the templates from vCenter inventory using "Remove from inventory" option under the template actions