I need to remove|delete a datastore ("dsarchiv") from the ESXi 6.5, but I keep getting errors saying:
(vCenter)
The "Unmount VMFS volume" operation failed for the entity with the following error message.
Die Ressource 'dsarchiv' ist in Gebrauch.
Das Volume 'dsarchiv' kann aufgrund von "Eine oder mehrere virtuelle Maschinen sind weiterhin darauf registriert" nicht unmounted werden. Beheben Sie das Problem und wiederholen Sie den Vorgang. (it's German for: "resource is in use. One or more VMs are registered on it")
(directly on host)
Failed - The resource 'dsarchiv' is in use.
I've tried everything I could find on Google, including lsof-ing, ScratchConfig.ConfiguredScratchLocation setting (which previouls did point to the datastore in question, but now I switched it to point to another one). The datastore is empty, is just has few files (.fbb.sf .fdc.sf .pb2.sf .pbc.sf .sbc.sf .vh.sf) and one folder (.sdd.sf ). Any idea what's the reason for not being able to unmount?
What would happen if I simply destroy the array in RAID-controller while ESXi is running, would there be any consequences?
Solved!
Even though all the files were deleted, there were still some VMs with disconnected (?) ISO mounts.
I found a PowerCLI command here:
https://www.helixstorm.com/blog/powercli-find-vms-mounted-iso-file-cddvd-drive/
Get-VM | FT Name, @{Label="ISO file"; Expression = { ($_ | Get-CDDrive).ISOPath }}
which helped me remove the ISO mounts.
I was then able to unmount the datastore.
I would have resolved it sooner if the message from vCenter would have not been misleading (saying there are some VMs registered on the datastore - there were none).
Solved!
Even though all the files were deleted, there were still some VMs with disconnected (?) ISO mounts.
I found a PowerCLI command here:
https://www.helixstorm.com/blog/powercli-find-vms-mounted-iso-file-cddvd-drive/
Get-VM | FT Name, @{Label="ISO file"; Expression = { ($_ | Get-CDDrive).ISOPath }}
which helped me remove the ISO mounts.
I was then able to unmount the datastore.
I would have resolved it sooner if the message from vCenter would have not been misleading (saying there are some VMs registered on the datastore - there were none).