VMware statistics counters

Note: LPAR2RRD v5.+ versions do not need any VMware counter adjustments anymore.
Bellow text is related to LPAR2RRD v4.x only.

The tool uses statistics data provided by VMware.
When you do not see all data in the UI then you probably need to adjust related counters to the level which allows perf data collection. If you see all data in the UI then you do not need to modify anything even if some counters are not in level 1.

Data collection is controlled by Historical Statistics Settings.
You can see it by using the vSphere Client. Select tab Administration->vCenter Server Settings, and then select Statistics.
Pay attention to value of 5 Minutes Statistics Level. All metrics counters below should be on the same level or lower, not higher.

Indication of missing counters in logs


If you see below lines in logs/error.log or logs/counter-info.txt then you definitly need to adjust some counters (mostly some memory counters are missing together with all datastore counters).
$ tail /home/lpar2rrd/lpar2rrd/logs/error.log
  Fault string: A specified parameter was not correct.
  querySpec.size
  Fault detail: InvalidArgumentFault ./bin/vmw2rrd.pl:2449 :
  Tue Feb 02 11:38:34 2016: (F9) not defined real_sampling_period time_stamps= no timestamps for Prod_ResourcePool./bin/vmw2rrd.pl:2491 :
  Tue Feb 02 11:38:35 2016: (F9) vmw2rrd failed: RP    :  Testo_ResourcePool Memory overhead KB average 1 1
  SOAP Fault:
  -----------
  Fault string: A specified parameter was not correct.
  querySpec.size
  Fault detail: InvalidArgumentFault ./bin/vmw2rrd.pl:2449 :
  Tue Feb 02 11:38:39 2016: (F10) not defined real_sampling_period time_stamps= no timestamps for XIV01./bin/vmw2rrd.pl:2491 :
  Tue Feb 02 11:38:39 2016: (F13) not defined real_sampling_period time_stamps= no timestamps for XIV02./bin/vmw2rrd.pl:2491 :
  Tue Feb 02 11:38:39 2016: (F11) not defined real_sampling_period time_stamps= no timestamps for XIV03./bin/vmw2rrd.pl:2491 :
  Tue Feb 02 11:38:39 2016: (F12) not defined real_sampling_period time_stamps= no timestamps for XIV04./bin/vmw2rrd.pl:2491 :
  ...
$ tail /home/lpar2rrd/lpar2rrd/logs/counter-info.txt
  Wed Dec  2 10:00:04 2015: (F1) no real counter for Disk:read:KBps: Host_System:
  Wed Dec  2 10:00:04 2015: (F1) no real counter for Memory:active:KB:
  Wed Dec  2 10:00:04 2015: (F1) no real counter for Memory:granted:KB:

Check actual status

To view the current status of the Counter Collection Level values :
  1. Connect to your vCenter Server using the vSphere Client.
  2. Click Home > Inventory > Hosts and Clusters.
  3. Click a virtual machine, then click the Performance tab.
  4. Click Advanced.
  5. Click Chart Options, then:
    • Click Past day under CPU/Mem/Virtual disk/... in the left pane.
    • In the Counters list view, check counters
Generally when all required counters are on level 1 then all should work fine.
Use below options for providing global changes.

Collection level change

Use LevelMappingUtility in PowerCLI

  1. Download and unzip LevelMappingUtility.zip (Also available in KB2009532 from VMware).
    The archive contains the required Power CLI functions in VMware.VimAutomation.PowerCliExtensions.CounterLevelMapping.psm1
  2. Ensure that you have VMware vSphere Power CLI installed.
    For more information, see Installing VMware vSphere PowerCLI.
    Download VMware vSphere PowerCLI.
  3. Import the module in Power CLI:
    PS> Import-Module VMware.VimAutomation.PowerCliExtensions.CounterLevelMapping.psm1
  4. Identify the counter you want to change (check list of counters below)
    In this example counter 'mem.granted.average' is being mapped to level 1.
  5. Check counter configuration:
    PS> Get-PxCounterLevelMapping | where { $_.Name -like "mem.granted.average" }
    Name                      AggregateLevel                 PerDeviceLevel   
    ----                      --------------                 --------------   
    mem.granted.average            2                                3    
    
  6. Map the counters to Level 1 for both levels
    PS> Get-PxCounterLevelMapping | where { $_.Name -like "mem.granted.average" } | Set-PxCounterLevelMapping -AggregateLevel 1 -PerDeviceLevel 1
    You can omit '-PerDeviceLevel' unless it is below noted.

Use Stats Toolbox

Another way how to change the statistics level of counters is Stats Toolbox

List of used counters

VMs and ESXi hosts
NamePower CLI nameAggregateNote
CPU:usagemhz:MHz cpu.usagemhz.average1
CPU:usage:Percent cpu.usage.average1
CPU:ready:Millisecond cpu.ready.summation1
Disk:usage:KBps disk.usage.average1only when Disk:read is not available
Disk:read:KBps disk.read.average1
Disk:write:KBps disk.write.average1
Network:usage:KBps net.usage.average1only when Net:read is not available
Network:received:KBps net.received.average1
Network:transmitted:KBps net.transmitted.average1
Memory:active:KB mem.active.average1
Memory:granted:KB mem.granted.average1
Memory:vmmemctl:KB mem.vmmemctl.average1
Memory:swapinRate:KBps mem.swapin.average1only when is available
Memory:swapoutRate:KBps mem.swapout.average1only when is available
Memory:decompressionRate:KBps mem.decompressionRate.average1only when is available
Memory:compressionRate:KBps mem.compressionRate.average1only when is available
Cluster
namePower CLI nameAggregateNote
CPU:usagemhz:MHz cpu.usagemhz.average1
CPU:usage:Percent cpu.usage.average1
CPU:reservedCapacity:MHz cpu.reservedCapacity.average1
CPU:totalmhz:MHz cpu.totalmhz.average1
Cluster services:effectivecpu:MHz clusterServices.effectivecpu.average1
Cluster services:effectivemem:MB clusterServices.effectivemem.average1
Memory:totalmb:MB mem.totalmb.average1
Memory:shared:KB mem.shared.average1
Memory:zero:KB mem.zero.average1
Memory:vmmemctl:KB mem.vmmemctl.average1
Memory:consumed:KB mem.consumed.average1
Memory:overhead:KB mem.overhead.average1
Memory:active:KB mem.active.average1
Memory:granted:KB mem.granted.average1
Memory:compressed:KB mem.compressed.average1
Memory:reservedCapacity:MB mem.reservedCapacity.average1
Memory:swapused:KB mem.swapused.average1
Memory:compressionRate:KBps mem.compressionRate.average1
Memory:decompressionRate:KBps mem.decompressionRate.average1
Memory:usage:Percent mem.usage.average1
Power:powerCap:Watt power.powerCap.average1only when is available
Power:power:Watt power.power.average1only when is available
Resource Pool
namePower CLI nameAggregateNote
CPU:usagemhz:MHz cpu.usagemhz.average1
Memory:shared:KB mem.shared.average1
Memory:zero:KB mem.zero.average1
Memory:vmmemctl:KB mem.vmmemctl.average1
Memory:consumed:KB mem.consumed.average1
Memory:overhead:KB mem.overhead.average1
Memory:active:KB mem.active.average1
Memory:granted:KB mem.granted.average1
Memory:compressed:KB mem.compressed.average1
Memory:swapped:KB mem.swapped.average1
Memory:compressionRate:KBps mem.compressionRate.average1
Memory:decompressionRate:KBps mem.decompressionRate.average1
Datastore
namePower CLI nameAggregateNote
Disk:used:KB disk.used.latest1
Disk:provisioned:KB disk.provisioned.latest1
Disk:capacity:KB disk.capacity.latest1
Datastore:read:KBps datastore.read.average1
Datastore:write:KBps datastore.write.average1
Datastore:numberReadAveraged:Number datastore.numberReadAveraged.average1
Datastore:numberWriteAveraged:Number datastore.numberWriteAveraged.average1