Search in sources :

Example 1 with ClusterConfigInfoEx

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

the class ComputeResourceOverlay method isVsanEnabled.

public boolean isVsanEnabled() {
    ClusterConfigInfoEx info = getClusterConfigInfoEx();
    Boolean isVsanEnabled = false;
    if (null != info) {
        VsanClusterConfigInfo vsanConfig = info.getVsanConfigInfo();
        isVsanEnabled = null == vsanConfig ? false : vsanConfig.isEnabled();
    }
    return isVsanEnabled;
}
Also used : ClusterConfigInfoEx(com.vmware.vim25.ClusterConfigInfoEx) VsanClusterConfigInfo(com.vmware.vim25.VsanClusterConfigInfo)

Example 2 with ClusterConfigInfoEx

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

the class ComputeResourceOverlay method getVsanConfigId.

public String getVsanConfigId() {
    ClusterConfigInfoEx info = getClusterConfigInfoEx();
    String vsanConfigId = "";
    if (null != info) {
        VsanClusterConfigInfo vsanConfig = info.getVsanConfigInfo();
        vsanConfigId = null == vsanConfig.getDefaultConfig().getUuid() ? "" : vsanConfig.getDefaultConfig().getUuid();
    }
    return vsanConfigId;
}
Also used : ClusterConfigInfoEx(com.vmware.vim25.ClusterConfigInfoEx) VsanClusterConfigInfo(com.vmware.vim25.VsanClusterConfigInfo)

Example 3 with ClusterConfigInfoEx

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

the class ComputeResourceOverlay method isDrsEnabled.

public boolean isDrsEnabled() {
    ClusterConfigInfoEx info = getClusterConfigInfoEx();
    Boolean isDrsEnabled = false;
    if (null != info) {
        ClusterDrsConfigInfo drsConfig = info.getDrsConfig();
        isDrsEnabled = drsConfig == null || drsConfig.isEnabled();
    }
    return isDrsEnabled;
}
Also used : ClusterConfigInfoEx(com.vmware.vim25.ClusterConfigInfoEx) ClusterDrsConfigInfo(com.vmware.vim25.ClusterDrsConfigInfo)

Example 4 with ClusterConfigInfoEx

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

the class ClusterMO method getRestartPriorityForVM.

private String getRestartPriorityForVM(VirtualMachineMO vmMo) throws Exception {
    if (vmMo == null) {
        s_logger.debug("Failed to get restart priority for VM, invalid VM object reference");
        return null;
    }
    ManagedObjectReference vmMor = vmMo.getMor();
    if (vmMor == null || !vmMor.getType().equals("VirtualMachine")) {
        s_logger.debug("Failed to get restart priority for VM: " + vmMo.getName() + ", invalid VM object reference");
        return null;
    }
    ClusterConfigInfoEx configInfo = getClusterConfigInfo();
    if (configInfo == null) {
        s_logger.debug("Failed to get restart priority for VM: " + vmMo.getName() + ", no cluster config information");
        return null;
    }
    List<ClusterDasVmConfigInfo> dasVmConfig = configInfo.getDasVmConfig();
    for (int dasVmConfigIndex = 0; dasVmConfigIndex < dasVmConfig.size(); dasVmConfigIndex++) {
        ClusterDasVmConfigInfo dasVmConfigInfo = dasVmConfig.get(dasVmConfigIndex);
        if (dasVmConfigInfo != null && dasVmConfigInfo.getKey().getValue().equals(vmMor.getValue())) {
            DasVmPriority dasVmPriority = dasVmConfigInfo.getRestartPriority();
            if (dasVmPriority != null) {
                return dasVmPriority.value();
            } else {
                // VM uses cluster restart priority when DasVmPriority for the VM is null.
                return ClusterDasVmSettingsRestartPriority.CLUSTER_RESTART_PRIORITY.value();
            }
        }
    }
    s_logger.debug("VM: " + vmMo.getName() + " uses default restart priority in the cluster: " + getName());
    return null;
}
Also used : ClusterConfigInfoEx(com.vmware.vim25.ClusterConfigInfoEx) ClusterDasVmConfigInfo(com.vmware.vim25.ClusterDasVmConfigInfo) DasVmPriority(com.vmware.vim25.DasVmPriority) ManagedObjectReference(com.vmware.vim25.ManagedObjectReference)

Example 5 with ClusterConfigInfoEx

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

the class ComputeResourceOverlay method getVsanHostConfig.

public List<VsanHostConfigInfo> getVsanHostConfig() {
    ClusterConfigInfoEx info = getClusterConfigInfoEx();
    List<VsanHostConfigInfo> hostConfig = new ArrayList<>();
    if (null != info) {
        hostConfig.addAll(info.getVsanHostConfig());
    }
    return hostConfig;
}
Also used : ClusterConfigInfoEx(com.vmware.vim25.ClusterConfigInfoEx) ArrayList(java.util.ArrayList) VsanHostConfigInfo(com.vmware.vim25.VsanHostConfigInfo)

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