Guv
Enthusiast
Enthusiast

List thin provisioned disk over 500GB.

Can i get help please, I need to get all a list of all thin provisioned disks which are over 500gb only.  The report needs to show the VM name, vmdk file, and size of the virtual disk.   I have tried using powershell commands but cannot get the list.

Can anyone advise

Thanks

4 Replies
LucD
Leadership
Leadership

Try like this

Get-VM | Get-HardDisk |

where{$_.StorageFormat -eq 'Thin' -and $_.CapacityGB -gt 500} |

Select @{N='VM';E={$_.Parent}},Name,Filename,CapacityGB


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

dazzpowder
Enthusiast
Enthusiast

this is what I've used in the past :-

get-cluster acluster | Get-VM | Get-HardDisk | ? {$_.capacityGB -gt '499'} | ? {$_.storageformat -like "thin"} | select parent,capacityGB,storageformat,filename | ft -AutoSize

either way chose 499GB, if the drive is 500GB it will get over looked

0 Kudos
LucD
Leadership
Leadership

Not sure what you mean by "it will get overlooked".

Care to explain ?


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

0 Kudos
vijayrana968
Virtuoso
Virtuoso

I also tried it, somehow its not displaying in powercli console even after using ft -AutoSize. You can export it to csv and then you can use Filter in excel. I tested it for -gt '10' GB

Get-Cluster XYZ | Get-VM | Get-HardDisk | where{$_.StorageFormat -eq 'Thin' -and $_.CapacityGB -gt '10'} | Export-Csv -Path C:\xxx\Data.csv


Capture.JPG



0 Kudos