VMware: Detach unmounted datastores with PowerCLI
Last week I had some issues with unmounting some old datastores in a vSphere 5.5 environment. In the GUI it look like:
When I tried to unmount / detach the datastore I received this error message::
Call “HostDatastoreSystem.RemoveDatastore” for object “datastoreSystem-330” on vCenter Server “itvvca01.domain.local” failed.
Operation failed, diagnostics report: Unable to query live VMFS state of volume.: No such file or directory
More information:
SAN01_VMFS04 datastore state accessible: false….
Solution:
You can easy detach the inaccessible datastores with the following command:
Get-Datastore SAN01_VMFS0* | Unmount-Datastore
Or per specific datastore:
Get-Datastore SAN01_VMFS01 | Unmount-Datastore Get-Datastore SAN01_VMFS02 | Unmount-Datastore
More information: VMware
WOW just what I was searching foг. Came here by searching foг
datastore
I keep getting Unmount-Datastore is not recognized as the name of a cmdlet. Do I need to load a lib?
Bill
Great post.
very good
@Bill
Bill,
You need to load the functions into your PowerCLI console. You can download them here….
https://communities.vmware.com/docs/DOC-18008
First – thank you for sharing this!
I have a basic question – how would i go about using this library? I have powerCLI intsalled and connected to vCenter. I’ve looked around but not able to execute any commands. Clearly i’m mis-reading.
any insight on how I can use the commands in the script?
very good