Hi,
I am using VMWare SDK Web Service API to monitor and collect the performance statistics. I am trying to retrieve performance statistics (Historical Intervals) from vCenter. Here is the piece of code for this.
private ObjectContent[] getManagerContents(PropertySpec propertySpec, ManagedObjectReference ref) throws Exception
{
PropertySpec[] propspecary = new PropertySpec[]{ propertySpec };
PropertyFilterSpec spec = new PropertyFilterSpec();
spec.setPropSet(propspecary);
spec.setObjectSet(new ObjectSpec[]{new ObjectSpec()});
spec.getObjectSet(0).setObj(ref);
spec.getObjectSet(0).setSkip(new Boolean(false));
return cb.getConnection().getService().retrieveProperties(cb.getConnection().getServiceContent().getPropertyCollector(), new PropertyFilterSpec[]{spec});
}
The above method works most of the time, but some times returns blank ObjectContent. I would like to know in which case it will return blank array of ObjectContent.
Any help would be greatly appreciated.
Thanks,
I had a similar issue with hosts/vcenter >= 4.1. I switched from using retrieveproperties to using retrievepropertiesex together with continueretrievepropertiesex and the problem of blank returns went away (though I am fighting another problem but that is a different story). See if changing your calls helps.
--Moby
Even I do have the same issue (even with the retrievepropertiesex + continueretrievepropertiesex ) using vsphere 5.5.
Is this the known issue and vmware is working on this ?
Feel free to take a look at the implementation of open source vijava API which has resolved the issue: http://vijava.sf.net. Or, you can just use the API and forget about these tedious details.
Commercial version of open source is also available: http://www.doublecloud.org/2014/01/announcing-vijavang-much-lighter-and-faster-with-commercial-licen...
Disclaimer: I am the creator of the open source.
Steve
