use of com.iwave.ext.vmware.EsxVersion in project coprhd-controller by CoprHD.
the class EsxHostDiscoveryAdapter method discoverEsxHost.
/**
* Discover Esx host
*
* @param host
* {@link Host} instance to be discovered
* @param changes
* {@link HostStateChange} instance containing host changes
* during discovery.
*/
private void discoverEsxHost(Host host, HostStateChange changes) {
EsxVersion esxVersion = getVersion(host);
if (null != esxVersion && getVersionValidator().isValidEsxVersion(esxVersion)) {
changes.setNewCluster(host.getCluster());
discoverHost(host, changes);
processHostChanges(changes);
matchHostToComputeElements(host);
} else {
host.setCompatibilityStatus(CompatibilityStatus.INCOMPATIBLE.name());
save(host);
throw ComputeSystemControllerException.exceptions.incompatibleHostVersion("Esx", esxVersion.toString(), getVersionValidator().getEsxMinimumVersion(false).toString());
}
}
use of com.iwave.ext.vmware.EsxVersion in project coprhd-controller by CoprHD.
the class EsxHostDiscoveryAdapter method getVersion.
/**
* Get version of host
*
* @param host
* {@link Host} being discovered
* @return
*/
protected EsxVersion getVersion(Host host) {
EsxVersion esxVersion = null;
VCenterAPI api = createVCenterAPI(host);
try {
esxVersion = api.getEsxVersion();
} finally {
api.logout();
}
return esxVersion;
}
Aggregations