Gather disk.usage.average stats per Datastore
Image via Wikipedia
Summary:This script isn't perfect as there can be some exceptions to the rule, but it can give you an idea of how much you are utilizing to each of your datastores to determine if there might be a bottleneck.
Get-DatastoreAvgUsgKBps.ps1
Details:
The script first gathers your datastores, then does a get-vm to list all VM's located in that datastore.
For each VM, get-stat is run to gather the disk.usage.average metric for the date range specified in the $start and $finish variables.
Once that data is gathered for that VM, it takes the KBps data and mathematically averages those numbers then continues to the next VM in that Datastore.
After averages for all VM's in the datastore have been calculated, they are all added up to represent the Average disk usage KBps against that datastore.
This is repeated for each datastore.
Exceptions:
- If a system has been vmotion'd to another datastore within the specified date range, the averages could be thrown off.
- Systems that have multiple drives located on different datastores, the script cannot differentiate disk usage stats between different disks.
- Other things that I may not have accounted for, feel free to comment.
- CSS Style to make the html output look nice. Place it in the same directory as the htm file. You can dynamically generate this file w/ powershell if so please too.
- JavaScript file for dynamic sorting capability by clicking table headers. Place in the same directory as the htm file.
Comments