I’ve just been asked by a community peer to write a script that will report on the utilization of cluster shared volumes on his Hyper-V environment.
Since they are using SCVMM, normally I would tell them to use the management pack for SCOM… but they’re not using SCOM.
So, here’s a oneliner that will show you the name of the host, the label of the disk and it’s utilization in %.
Get-VMHost | Get-VMHostVolume | Select-Object @{Label="Host";Expression={$_.VMHost}}, ` @{Label="Label";Expression={$_.VolumeLabel}}, ` @{Label="% Available";Expression={[Math]::Truncate(($_.Freespace * 100) / $_.Capacity)}} | sort-object "% Available" –Descending
The output can be put in an weekly email or something like that… whatever you desire.