Invoke power cli script esxcli storage vmfs unmap -l
against all the data store.C:\temp\Datastores
Example :-
esxcli storage vmfs unmap -l Windows_PVMAX_3539
Planning to use the scheduled job from windows tasks scheduler.
Any lead will be much appreciated.
thanks
vmk
Not sure what you mean by C:\Temp\Datastores, but I assume that is a CSV that contains the datastorenames (under property Name).
In that case, you could do something like this.
If that file is of a different format, the way the script would obtain the datastorenames would need to be changed.
Get-VMHost |
ForEach-Object -Process {
$esxcli = Get-EsxCli -VMHost $_ -V2
$dsNames | ForEach-Object -Process {
$esxcli.storage.vmfs.unmap.Invoke(@{'volumelabel'="$($_.Name)"})
}
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD,
My apologies, it will datastores.csv. We are having vmfs5.5, hence disk pool is getting full from storage end,so inorder to reclaim space we are running everytime manually, until we upgrade to VMFS6.0
Can we schedule this from windows tasks scheduler ?
thanks
vmk
That should not be a problem.
Have a look at Re: scheduling_powershell script_task scheduler to see how to create such a shceduled task.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD,
Thanks for your response for both the query. I'll get back after testing the script and update you.
Thanks
vm
How does the input CSV file look ?
Please comment.