@Override public boolean isHyperHostConnected() throws Exception { ObjectContent[] ocs = getHostPropertiesOnCluster(new String[] {"runtime"}); if (ocs != null && ocs.length > 0) { for (ObjectContent oc : ocs) { HostRuntimeInfo runtimeInfo = (HostRuntimeInfo)oc.getPropSet().get(0).getVal(); // as long as we have one host connected, we assume the cluster is up if (runtimeInfo.getConnectionState() == HostSystemConnectionState.CONNECTED) return true; } } return false; }
@Override public boolean isHyperHostConnected() throws Exception { HostRuntimeInfo runtimeInfo = (HostRuntimeInfo)_context.getVimClient().getDynamicProperty(_mor, "runtime"); return runtimeInfo != null && runtimeInfo.getConnectionState() == HostSystemConnectionState.CONNECTED; }