VMware Cloud Community
Madmax01
Expert
Expert
Jump to solution

VM Correct DISK IOPS

Hi guys,

i'am unsure about that.

maybe anyone could provide me the link for having all Metrics,..... documentend and theire meaning?.

because i pulled the MAX IOPS infos from.   disk.numberwrite.summation + disk.numberread.summation.

but i wanted to quere the normal average ones also therefore i found 3 different metrics for the VM.

disk.numberReadAveraged.average,  disk.numberWriteAveraged.average

virtualDisk.numberWriteAveraged.average,   virtualDisk.numberReadAveraged.average

datastore.numberReadAveraged.average,    datasore.numberWriteAveraged.average

now i'am unsure which ones i have 100% to use.

thx

Max

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

No need to specify the IntervalSecs and Finish parameter.

The Get-Stat cmdlet knows, based on the Start parameter, which interval you want.

And the default for Finish is "now".

$stats = Get-Stat -Stat $metrics -Entity $vms -Start $start 

should be sufficient.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
10 Replies
LucD
Leadership
Leadership
Jump to solution

All the available metrics for vDisks can be found under the PerformanceManager.

In my Get the maximum IOPS post I used the NumberRead and NumberWrite metrics.

When you go for the Average numbers remember that they are per second, so you will have to multiply with the number of seconds in the interval.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Madmax01
Expert
Expert
Jump to solution

Hi Lucd,

thx for the answers.  yeah that's based on Summation.

But the other metrics are also for the I/O. but Rollup=Average.

i will give it a try with disk.numberReadAveraged.average + disk.numberWriteAveraged.average. i wasn't sure if all of them reflecting only the vm I/O or if it's shared I/O also. because of the datastore..... Smiley Wink.

thx

Max

0 Kudos
Mr_G_Grant
Enthusiast
Enthusiast
Jump to solution

Great script.

Is it possible to get another field in the NFS version showing the disk size also?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Sure, try something like this

$metrics = "virtualdisk.numberwriteaveraged.average","virtualdisk.numberreadaveraged.average" 
$start
= (Get-Date).AddMinutes(-5) $report = @() $vms = Get-VM | where {$_.PowerState -eq "PoweredOn"} $stats = Get-Stat -Realtime -Stat $metrics -Entity $vms -Start $start
$interval = $stats[0].IntervalSecs $hdTab = @{} foreach($hd in (Get-Harddisk -VM $vms)){     $controllerKey = $hd.Extensiondata.ControllerKey
    $controller = $hd.Parent.Extensiondata.Config.Hardware.Device | where{$_.Key -eq $controllerKey}     $hdTab[$hd.Parent.Name + "/scsi" + $controller.BusNumber + ":" + $hd.Extensiondata.UnitNumber] = $hd.FileName.Split(']')[0].TrimStart('['),$hd.CapacityKB} $report = $stats | Group-Object -Property {$_.Entity.Name},Instance | %{     New-Object PSObject -Property @{         VM = $_.Values[0]         Disk = $_.Values[1]         DiskSizeKB = $hdTab[$_.Values[0] + "/"+ $_.Values[1]][1]         IOPSMax = ($_.Group |
           
Group-Object -Property Timestamp |
            %{$_.Group[0].Value + $_.Group[1].Value} |
            Measure-Object -Maximum).Maximum / $interval
       
Datastore = $hdTab[$_.Values[0] + "/"+ $_.Values[1]][0]     } } $report


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Mr_G_Grant
Enthusiast
Enthusiast
Jump to solution

Thank you Sir! Works a charm 😃

0 Kudos
Madmax01
Expert
Expert
Jump to solution

Very nice script Lucd Smiley Wink  thx.

Just one question.

if we would like to split the MaxIO into  read+write  to see where the value is higher.  how should it looks like?

muchas thx

Max

0 Kudos
LucD
Leadership
Leadership
Jump to solution

You could use a Where-clause to pull out the write and the read values seperately.

Something like this

$metrics = "virtualdisk.numberwriteaveraged.average","virtualdisk.numberreadaveraged.average" 
$start = (Get-Date).AddMinutes(-5)
$report = @()

$vms = Get-VM  | where {$_.PowerState -eq "PoweredOn"}
$stats = Get-Stat -Realtime -Stat $metrics -Entity $vms -Start $start 
$interval
= $stats[0].IntervalSecs
$hdTab = @{} foreach($hd in (Get-Harddisk -VM $vms)){     $controllerKey = $hd.Extensiondata.ControllerKey
    $controller = $hd.Parent.Extensiondata.Config.Hardware.Device | where{$_.Key -eq $controllerKey}     $hdTab[$hd.Parent.Name + "/scsi" + $controller.BusNumber + ":" + $hd.Extensiondata.UnitNumber] = $hd.FileName.Split(']')[0].TrimStart('['),$hd.CapacityKB
} $report = $stats | Group-Object -Property {$_.Entity.Name},Instance | %{     New-Object PSObject -Property @{         VM = $_.Values[0]         Disk = $_.Values[1]         DiskSizeKB = $hdTab[$_.Values[0] + "/"+ $_.Values[1]][1]         IOPSMaxWrite = ($_.Group |
            where {$_.MetricId -eq "virtualdisk.numberwriteaveraged.average"} |
            Measure-Object -Property Value -Maximum).Maximum / $interval
        IOPSMaxRead = ($_.Group |
            where {$_.MetricId -eq "virtualdisk.numberreadaveraged.average"} |
            Measure-Object -Property Value -Maximum).Maximum / $interval
        Datastore = $hdTab[$_.Values[0] + "/"+ $_.Values[1]][0]     } } $report


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Madmax01
Expert
Expert
Jump to solution

Hi Lucd,

muchas thx Smiley Wink.

So if i like to make a dayli report then i have to

-  (get-date).AddDays(-1)     instead of the minutes

-  $stats = get-stat -IntervalSecs 300 -Stat $metrics -Entrity $vms -Start $start  -Finish $finish

- $finish = (get-date)

- removing $interval

Correct?

What is the benefit using -Maxsamples?

thx

Max

0 Kudos
LucD
Leadership
Leadership
Jump to solution

No need to specify the IntervalSecs and Finish parameter.

The Get-Stat cmdlet knows, based on the Start parameter, which interval you want.

And the default for Finish is "now".

$stats = Get-Stat -Stat $metrics -Entity $vms -Start $start 

should be sufficient.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Madmax01
Expert
Expert
Jump to solution

Ah now i understand Smiley Wink  i was confused about the Intervalsecs,......

So therefore it's only needed for the summation values to get the correct output.

many thx Luc

best regards

Max

0 Kudos