Sunday, September 9, 2012

Active memory or consumed memory

Referring to older post about getting the numbers of memory and CPU usage HERE, lets go deeper into the memory part.

The script collect the usage of memory active, instead of memory consumed. It is the amount of memory that is actively used, as estimated by VMkernel based on recently touched memory pages (REF).

That is not a very good indicator if you're doing a VM resizing plan, or chargeback. To get a better view, use consumed memory counter instead. This is closest guess of what is the amount of memory used by the guest VM.

Or, get Veeam One monitor ;-)


Read more about memory counters

Wednesday, September 5, 2012

Windows Slowdown, Investigated and Identified

reblogging from http://randomascii.wordpress.com/2012/09/04/windows-slowdown-investigated-and-identified/

all credits goes to original author, I'm merely archiving it for my personal future reference.
in short, if your free memory is high, and cached is low, there's a culprit in there.

Wednesday, August 22, 2012

Getting VM utilization history using PowerCLI

I found this awesome powerCLI script that help to get VM's utilization history.

$report = @()
$metrics = "cpu.usage.average","mem.active.average" 
$vms = Get-Vm | where {$_.PowerState -eq "PoweredOn"} 
$start = (get-date).AddDays(-1) 

Get-Stat -Entity ($vms) -start $start -stat $metrics | `  Group-Object -Property EntityId | %{
    $row = ""| Select VmName, Timestamp, vCPU, MinCpu,AvgCpu,MaxCpu,MemAlloc,MinMem,AvgMem,MaxMem 
    $row.VmName = $_.Group[0].Entity.Name
    $row.Timestamp = ($_.Group | Sort-Object -Property Timestamp)[0].Timestamp
    $row.vCPU = $_.Group[0].Entity.NumCpu
    $cpuStat = $_.Group | where {$_.MetricId -eq "cpu.usage.average"} | Measure-Object -Property Value -Minimum -Maximum -Average
    $row.MinCpu = "{0:f2}" -f ($cpuStat.Minimum)
    $row.AvgCpu = "{0:f2}" -f ($cpuStat.Average)
    $row.MaxCpu = "{0:f2}" -f ($cpuStat.Maximum)
    $row.MemAlloc = $_.Group[0].Entity.MemoryMB
    $memStat = $_.Group | where {$_.MetricId -eq "mem.active.average"} | Measure-Object -Property Value -Minimum -Maximum -Average    $row.MinMem = "{0:f2}" -f ($memStat.Minimum)
    $row.AvgMem = "{0:f2}" -f ($memStat.Average)
    $row.MaxMem = "{0:f2}" -f ($memStat.Maximum)
    $report += $row}
$report | Export-Csv "C:\VM-stats.csv" -NoTypeInformation -UseCulture


Change the line "$start = (get-date).AddDays(-1)" accordingly to set how many days of history you want.

Original link :- http://communities.vmware.com/message/1784833#1784833