VMware
 

Knowledge Base

Search the Knowledge Base:

Products:
Search In:
 

Ensuring Counters Are Unique Across ESX Server and VirtualCenter Versions

Details

I have noticed that sometimes the counter ID and even the counter name changes, depending upon which version of ESX Server or VirtualCenter I am running. How can I map a unique counter ID for the platform to which I'm connected? I might be connected to many different platforms.

 

Solution

Counter IDs are dynamically generated numbers and are not guaranteed to stay the same. The current CounterId for a stats metric should be determined by comparing it to the PerfCounterInfo objects returned by the QueryAvailablePerfMetric or PerfCounter calls.
 
The counter structure provided in ESX Server and VirtualCenter is:

CounterId

PerfCounterInfo

groupInfo

nameInfo

rollupType

statsType

unitInfo

To ensure that you have a unique counter ID and name across the possible ESX Server and VirtualCenter versions you are running, include the rollupType value in your counter definition:

groupInfo.key:nameInfo.key:rollupType

This provides a unique value that can be mapped to an individual counter. For example:

my $perfCounterInfo = $perfmgr_view->perfCounter;

foreach (@$perfCounterInfo) {

my $key = $_->key; # index

my $groupName = $_->groupInfo->key; # cpu

my $counterName = $_->nameInfo->key; # usageMhz

my $rollupType = $_->rollupType->val; # average

my $statsType = $_->statsType->val; # type of value

print $key, ":",

join (".", $groupName, $counterName,$rollupType),

"(", $statsType, ")\n";

}

For more information, see http://www.vmware.com/vmtn/technology/developer/webinars/vi-api-performance-mgmt_webcast_2006-11-15.pdf%20page%2021 . It describes how to identify a counter uniquely.

Keywords

URLZ, Virtual Center, ESX, SDK

Feedback

Rating: 1 - Lowest 2 3 4 5 - Highest (0 Ratings)   

Did this article help you?
This article resolved my issue.
This article did not resolve my issue.
This article helped but additional information was required to resolve my issue.
What can we do to improve this information? (2000 or fewer characters)
Submit
Rating: 1 - Lowest 2 3 4 5 - Highest (0 Ratings)   
Actions