Unable to retrieve slot information for clusters with admission failover level control policy enabled

StackOverflow https://stackoverflow.com/questions/21609681

  •  08-10-2022
  •  | 
  •  

Question

I'm experiencing some problems when trying to retrieve the slot information for VMware clusters with admission failover level control policy enabled. I use the VI Java API.

When calling the following method:

clusterComputeResource.retrieveDasAdvancedRuntimeInfo()

I either get the following Exception:

java.rmi.RemoteException: VI SDK invoke exception:java.rmi.RemoteException: Exception in 
WSClient.invoke:; nested exception is:
java.lang.NoSuchFieldException: slotInfo
at com.vmware.vim25.ws.WSClient.invoke(WSClient.java:122)
at com.vmware.vim25.ws.VimStub.retrieveDasAdvancedRuntimeInfo(VimStub.java:269)

or I get the result which is of type ClusterDasAdvancedRuntimeInfo but I need the subclass ClusterDasFailoverLevelAdvancedRuntimeInfo in order to get the SlotInfo field (casting to the required sublcass doesn't work either).

I tried to access the web service of a vcenter directly via Soap UI and it worked without any problems, but with the vijava API it just doesn't.

Thanks in advance for any help!!!

Was it helpful?

Solution

After a lot of of debugging to see what the VI Java API does internally, I found out that if the web service client (wsc) is invoked with the name of the sublcass instead of the name of the superclass (as last parameter), the response will be converted correctly. This way the slot information can be retrieved without any problems. Here is the solution for those experiencing the same problems:

ClusterDasFailoverLevelAdvancedRuntimeInfo clusterDasFailoverLevelAdvancedRuntimeInfo = null;
try {
final Argument[] paras = new Argument[1];
paras[0] = new Argument("_this", "ManagedObjectReference", clusterComputeResource.getMOR());

clusterDasFailoverLevelAdvancedRuntimeInfo = (ClusterDasFailoverLevelAdvancedRuntimeInfo) serviceInstance.getServerConnection().getVimService().getWsc().invoke("RetrieveDasAdvancedRuntimeInfo", paras, "ClusterDasFailoverLevelAdvancedRuntimeInfo");
} catch (final Exception e) {
//error handling
}

(Note that this only works if admission control failover level policy is enabled!!!)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top