Knowledge Base

Search the Knowledge Base: |
Search the Knowledge Base: |
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
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
Feedback
- KB Article: 1002643
- Updated: Aug 14, 2009
- Products:
VMware ESX
VMware Infrastructure SDK
VMware VirtualCenter - Product Versions:
VMware Infrastructure SDK 1.x
VMware Infrastructure SDK 2.0.x

