Search in sources :

Example 1 with EsxVersion

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());
    }
}
Also used : EsxVersion(com.iwave.ext.vmware.EsxVersion)

Example 2 with EsxVersion

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;
}
Also used : VCenterAPI(com.iwave.ext.vmware.VCenterAPI) EsxVersion(com.iwave.ext.vmware.EsxVersion)

Aggregations

EsxVersion (com.iwave.ext.vmware.EsxVersion)2 VCenterAPI (com.iwave.ext.vmware.VCenterAPI)1