Another interesting PowerCLI script from today. My proof of concept environment uses thin provisioned disks — this lets us have a lot more test machines than we really have disk space. The other day we ran out of space — a new admin had been creating test machines for a project using oversized disks and thick-provisioning. A coworker actually came up with this script to help find those disks so we could turn thin provisioning back on:
get-vm | get-view | %{ $name = $_.name $_.Config.Hardware.Device | where {$_.GetType().Name -eq "VirtualDisk"} | %{ if(!$_.Backing.ThinProvisioned){ "$name has a thick provisioned disk" } } }
Pingback: VMware PowerCLI – Get all thick provisioned disks | Null Byte