Get-VMMetering script to collect and reset VM Metering data, report to CSV
This script can be downloaded from the Microsoft Script Center Repository. It can be set as a scheduled task on one of the Hyper-V hosts in the environment, not all of them.
Set the schedule of the scheduled task to run as often as you’d like to have the VM metering data collected and reset.
Edit the top 3 lines to match your environment details:
- $CSV = “d:\sandbox\MeteringReports”
- Edit this line to enter the path to the folder to save CSV files. This can be a UNC path like “\\server\share\folder”
- $HVHosts = @(“Host1″,”Host2”)
- Edit this line to list Hyper-V hosts in your environment
- $Sort = “AvgCPU”
- Edit this line to change the report sort order. Options include: AvgCPU, AvgRAM, MaxRAM, MinRAM, TotalDisk, NetworkInbound, NetworkOutbound, VMName, ComputerName
Report data and output will look like: