Troubleshooting: Failed to Unmount and Detach Datastore with vSphere Plugin
When customers try to Destroy a DataStore, they might get this alert:
“Failed to unmount and detach datastore. Please ensure that there are no registered VMs on this datastore and try again.
vSphere plugin 4.2.x
Attempting to destroy a DataStore that meets certain conditions.
Before unmounting a LUN, ensure that:
- If the LUN is being used as a VMFS datastore, all objects, (such as virtual machines, snapshots, and templates) stored on the VMFS datastore are unregistered or moved to another datastore.
- Note: All CD/DVD images located on the VMFS datastore must also be unregistered from the virtual machines.
- The datastore is not used for vSphere HA heartbeat.
- The datastore is not part of a datastore cluster.
- Please also ensure that this Datasore only uses Pure Luns.
- If this datastore is used as a heartbeat datastore, you may need to switch that role. (Consult Vmware for this operation).
- If there is any host in maintenance mode, make sure to rescan storage/hba for that hosts manually.
How to unmount a LUN or detach a datastore device from ESXi hosts (2004605)L: https://kb.vmware.com/s/article/2004605