Hi all,
I have a vcenter 6.0, hosting multiple vms.
I need to unmount and detach 100+ datastores to fulfil a storage decommission.
VMs are already migrated.
Am looking for a script, that can check the pre-requisite, if pre-requisite passed, then unmount and delete the datastore.
Could someone help me in this regard, please.
Thankyou...
Ok, for the pre-requisites you could use the function I provided in Test If The Datastore Can Be Unmounted
To unmount a datastore you have to use the API methods or use the esxcli (see KB2004605) commands.
The API methods were packaged in functions by Alan, see Datastore Mount/Unmount Detach/Attach functions
The esxcli commands can be done through Get-EsxCli.
Both will work, the functions have the advantage that they will make sure the datastore is unmounted on all connected ESXi nodes.
With the esxcli commands you will have run these commands on each connected ESXi node.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
What kind of pre-requisite are you talking about?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Luc,
Prerequisite to unmount a datastore.
Like, checking if a vm exist, SIOC enabled,part of heartbeat ...
I need to do these prechecks for multiple datastores (100+) and then unmount and delete.
Ok, for the pre-requisites you could use the function I provided in Test If The Datastore Can Be Unmounted
To unmount a datastore you have to use the API methods or use the esxcli (see KB2004605) commands.
The API methods were packaged in functions by Alan, see Datastore Mount/Unmount Detach/Attach functions
The esxcli commands can be done through Get-EsxCli.
Both will work, the functions have the advantage that they will make sure the datastore is unmounted on all connected ESXi nodes.
With the esxcli commands you will have run these commands on each connected ESXi node.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks a lot Luc,
I was able to convert your script to fetch information from multiple datastores,at the same time, and it worked well.