Search in sources :

Example 6 with ClusterConfigInfoEx

use of com.vmware.vim25.ClusterConfigInfoEx in project photon-model by vmware.

the class ComputeResourceOverlay method getClusterConfigInfoEx.

private ClusterConfigInfoEx getClusterConfigInfoEx() {
    ComputeResourceConfigInfo cfg = ((ComputeResourceConfigInfo) getOrFail(VimPath.res_configurationEx));
    ClusterConfigInfoEx info = null;
    if (cfg instanceof ClusterConfigInfoEx) {
        info = (((ClusterConfigInfoEx) cfg));
    }
    return info;
}
Also used : ClusterConfigInfoEx(com.vmware.vim25.ClusterConfigInfoEx) ComputeResourceConfigInfo(com.vmware.vim25.ComputeResourceConfigInfo)

Example 7 with ClusterConfigInfoEx

use of com.vmware.vim25.ClusterConfigInfoEx in project cloudstack by apache.

the class HypervisorHostHelper method getNewVMHardwareVersion.

/**
 * Return the VM hardware version based on the information retrieved by the cluster and datacenter:
 * - If the cluster hardware version is set, then return this hardware version
 * - If the cluster hardware version is not set, check datacenter hardware version. If it is set, then return it
 * - In case both cluster and datacenter hardware version are not set, return null
 */
public static String getNewVMHardwareVersion(ClusterMO clusterMO, DatacenterMO datacenterMO) throws Exception {
    String version = null;
    ClusterConfigInfoEx clusterConfigInfo = clusterMO != null ? clusterMO.getClusterConfigInfo() : null;
    String clusterHardwareVersion = clusterConfigInfo != null ? clusterConfigInfo.getDefaultHardwareVersionKey() : null;
    if (StringUtils.isNotBlank(clusterHardwareVersion)) {
        s_logger.debug("Cluster hardware version found: " + clusterHardwareVersion + ". Creating VM with this hardware version");
        version = clusterHardwareVersion;
    } else {
        DatacenterConfigInfo datacenterConfigInfo = datacenterMO != null ? datacenterMO.getDatacenterConfigInfo() : null;
        String datacenterHardwareVersion = datacenterConfigInfo != null ? datacenterConfigInfo.getDefaultHardwareVersionKey() : null;
        if (StringUtils.isNotBlank(datacenterHardwareVersion)) {
            s_logger.debug("Datacenter hardware version found: " + datacenterHardwareVersion + ". Creating VM with this hardware version");
            version = datacenterHardwareVersion;
        }
    }
    return version;
}
Also used : ClusterConfigInfoEx(com.vmware.vim25.ClusterConfigInfoEx) DatacenterConfigInfo(com.vmware.vim25.DatacenterConfigInfo)

Aggregations

ClusterConfigInfoEx (com.vmware.vim25.ClusterConfigInfoEx)7 VsanClusterConfigInfo (com.vmware.vim25.VsanClusterConfigInfo)2 ClusterDasVmConfigInfo (com.vmware.vim25.ClusterDasVmConfigInfo)1 ClusterDrsConfigInfo (com.vmware.vim25.ClusterDrsConfigInfo)1 ComputeResourceConfigInfo (com.vmware.vim25.ComputeResourceConfigInfo)1 DasVmPriority (com.vmware.vim25.DasVmPriority)1 DatacenterConfigInfo (com.vmware.vim25.DatacenterConfigInfo)1 ManagedObjectReference (com.vmware.vim25.ManagedObjectReference)1 VsanHostConfigInfo (com.vmware.vim25.VsanHostConfigInfo)1 ArrayList (java.util.ArrayList)1