VMware Cloud Community
Guv
Enthusiast
Enthusiast

Get-Stat for measuring disk performance

I want to use the get-stat command to measure the virtual disks of virtual machines, such as reads and writes. is there any specific counters I can use to measure this. I want to move some of the virtual disks to some faster datastores (LUNS), but i want to check which virtual disks are slow on reads and writes. Can this be checked via get-stat.

0 Kudos
3 Replies
jeveenj
Enthusiast
Enthusiast

Hi,

You can try below snippet, this will give disk read and write info of a VM

get-vm |Get-Stat -Disk -MaxSamples 10

Hope this helps

-If you found this information useful, please consider awarding points for Correct or Helpful.
0 Kudos
RvdNieuwendijk
Leadership
Leadership

Afaik it is not possible to get performance information about individual disks of virtual machines. You can however get the performance information of individual LUNs of an ESX server, if you connect directly to the ESX server. For example:

Connect-VIServer YourESXserverName
Get-Stat -Disk

Robert

Message was edited by: RvdNieuwendijk

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
bulletp31
Enthusiast
Enthusiast

 $filename = "vm-disk-usage-average"
echo "Collecting VM Disk Usage usage ladt 24 Hours"

$table = @()

$vms = @((Get-VM | where {$_.PowerState -eq "PoweredOn"}) | Sort Name)
foreach ($VM in $VMs){
	Get-Stat -Entity $vm -Stat disk.usage.average -maxsamples 24 -intervalMins 60 | %{
		$Details = "" | select VM, VMhost, Time, Usage_KBps
		$Details.VM = $VM.Name 
		$Details.VMhost = $VM.host 
		$Details.Time = $_.Timestamp
		$Details.Usage_KBps = $_.Value 
		$table += $Details
	}
}
$table | Export-Csv c:\disk usage.csv -NoTypeInformation 

This is what I use to get them when doing a health check. This will only do the VMs thou.

As it is it will get 24 figures at 60 min gaps. will give you two days worth of stats.

You can change the "-maxsamples and -intervalmins to the figures you need.

hope this helps

Phil

0 Kudos