VMware Cloud Community
itayms
Contributor
Contributor

Thin Provision Disk Reclaim ESXi 5.5

Hi,

i'm looking for a powercli script that will used the new ESXi 5.5 command :  esxcli storage vmfs unmap -l command


the script should read the datastore list from csv file.


thanks,


Itay


Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership

Have a look at  1.  Re: ESXcli 5.5 UNMAP and PowerCLI script?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
Brian_Graf
Enthusiast
Enthusiast

Something like this may work, building off of Luc's suggestion. If this is for a single ESXi host and your CSV Datastore column name was "name"

connect-viserver -Server "hostname here"

$esxcli = Get-EsxCli -VMHost "hostname here"

$csv = Import-Csv c:\path\to\your.csv

foreach ($row in $csv) {

$esxcli.storage.vmfs.unmap(200, "$($row.name)", $null)

}

Senior Product Manager - Distributed Resource Management | @vBrianGraf
Reply
0 Kudos