Display the top 10 disk write and read VMs

Posted: June 29, 2012 in Information Technology, Storage, VMware

Quick script that loops every 5 minutes and grabs the top 10 disk write and read VMs in the environment.

While ( 1 -eq 1 ){
$TopWrites = Get-VM | Where { $_.PowerState -eq “PoweredON” } | Get-Stat -Stat disk.write.average -Realtime -MaxSamples 1 -Instance “” | Select Entity, Value | Sort-Object Value -Descending | Select-Object -First 10

$TopReads = Get-VM | Where { $_.PowerState -eq “PoweredON” } | Get-Stat -Stat disk.read.average -Realtime -MaxSamples 1 -Instance “” | Select Entity, Value | Sort-Object Value -Descending | Select-Object -First 10

cls
Write-Host “Highest disk writes…”
$TopWrites
Write-Host “`n`nHighest disk reads…”
$TopReads

Start-Sleep -Seconds 300

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s