Gather disk.usage.average stats per Datastore

Windows PowerShellImage via Wikipedia

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.

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.

  1. If a system has been vmotion'd to another datastore within the specified date range, the averages could be thrown off.
  2. Systems that have multiple drives located on different datastores, the script cannot differentiate disk usage stats between different disks.
  3. Other things that I may not have accounted for, feel free to comment.
Extra Stuff:
  1. 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.
  2. JavaScript file for dynamic sorting capability by clicking table headers. Place in the same directory as the htm file.


Jm Diaz said…
Now this is good stuff. We have a beefy proactivenet deployment in the works at CEI and this just come in handy, Thanks!

Popular posts from this blog

NSX-T: vCenter and NSX-T Inventory out of Sync (Hosts in vSphere not showing up in NSX-T)

MacOS: AnyConnect VPN client was unable to successfully verify the IP forwarding table modifications.

Azure VMware Solution: NSX-T Active/Active T0 Edges...but