VMware {code} Community
rajatlr
Contributor
Contributor

vmware queryAvailablePerfMetric fails

I am connecting to vmware 5&6's wsdl URL, https://ip:port/sdk/vimService .

AppUtil cb =.....

String entityType= "VirtualMachine";

String entityName = "LinuxInstance1";

ManagedObjectReference mor = cb.getServiceUtil().getDecendentMoRef(null,entityType, entityName);            

ManagedObjectReference pmRef = cb.getConnection().getServiceContent().getPerfManager();

PerfCounterInfo[] cInfo = (PerfCounterInfo[])cb.getServiceUtil().getDynamicProperty(pmRef, "perfCounter");

PerfProviderSummary perfSum = cb.getConnection().getService().queryPerfProviderSummary(pmRef, mor);

PerfMetricId[] values = cb.getConnection().getService().queryAvailablePerfMetric(pmRef, mor, null,null, interval);

AppUtil cb =.....
String entityType= "VirtualMachine";
String entityName = "LinuxInstance1";
ManagedObjectReference mor = cb.getServiceUtil().getDecendentMoRef(null,entityType, entityName);            
ManagedObjectReference pmRef = cb.getConnection().getServiceContent().getPerfManager();
PerfCounterInfo[] cInfo = (PerfCounterInfo[])cb.getServiceUtil().getDynamicProperty(pmRef, "perfCounter");
PerfProviderSummary perfSum = cb.getConnection().getService().queryPerfProviderSummary(pmRef, mor);
PerfMetricId[] values = cb.getConnection().getService().queryAvailablePerfMetric(pmRef, mor, null,null, interval);

Here, I get 'cInfo' that contains values I originally intend to get. But, I get 'values' as null. Can I use cInfo instead of values?

If entityType = "HostSystem" and entityName = "localhost.localdomain" then "values" contain some values. But fails for "VirtualMachine" - "LinuxInstance1" pair.

Reply
0 Kudos
0 Replies