Search in sources :

Example 71 with VDS

use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.

the class HostSetupNetworksModel method queryNetworkAttachments.

private void queryNetworkAttachments() {
    VDS vds = getEntity();
    IdQueryParameters params = new IdQueryParameters(vds.getId());
    params.setRefresh(false);
    // query for network attachments
    Frontend.getInstance().runQuery(QueryType.GetNetworkAttachmentsByHostId, params, new AsyncQuery<>((QueryReturnValue returnValue) -> {
        hostSetupNetworksParametersData.getNetworkAttachments().addAll((List<NetworkAttachment>) returnValue.getReturnValue());
        initNetworkIdToExistingAttachmentMap();
        // chain the vfsConfig query
        queryVfsConfig();
    }));
}
Also used : QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) VDS(org.ovirt.engine.core.common.businessentities.VDS) List(java.util.List) ArrayList(java.util.ArrayList)

Example 72 with VDS

use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.

the class HostGeneralModel method upgrade.

private void upgrade() {
    if (getWindow() != null) {
        return;
    }
    final VDS host = getEntity();
    Model model = createUpgradeModel(host);
    model.initialize();
    // $NON-NLS-1$
    model.getCommands().add(UICommand.createCancelUiCommand("Cancel", this));
    setWindow(model);
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) Model(org.ovirt.engine.ui.uicommonweb.models.Model)

Example 73 with VDS

use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.

the class HostGeneralModel method updateProperties.

private void updateProperties() {
    VDS vds = getEntity();
    setOS(vds.getHostOs());
    setOsPrettyName(vds.getPrettyName());
    setKernelVersion(vds.getKernelVersion());
    setKvmVersion(vds.getKvmVersion());
    setLibvirtVersion(vds.getLibvirtVersion());
    setVdsmVersion(vds.getVersion());
    setSpiceVersion(vds.getSpiceVersion());
    setGlusterVersion(vds.getGlusterVersion());
    setLibrbdVersion(vds.getLibrbdVersion());
    setIScsiInitiatorName(vds.getIScsiInitiatorName());
    setSpmPriorityValue(vds.getVdsSpmPriority());
    setActiveVms(vds.getVmActive());
    setPhysicalMemory(vds.getPhysicalMemMb());
    setSwapTotal(vds.getSwapTotal());
    setSwapFree(vds.getSwapFree());
    setSharedMemory(vds.getMemSharedPercent());
    setMemoryPageSharing(vds.getKsmState());
    setAutomaticLargePage(vds.getTransparentHugePagesState());
    if (vds.getHugePages() != null) {
        setHugePages(vds.getHugePages().stream().map(page -> messages.hugePages(String.valueOf(page.getSizeKB()), String.valueOf(page.getAmount() != null ? page.getAmount() : constants.notAvailableLabel()))).collect(// $NON-NLS-1$
        Collectors.joining(", ")));
    } else {
        setHugePages(constants.notAvailableLabel());
    }
    setBootTime(vds.getBootTime());
    setKdumpStatus(EnumTranslator.getInstance().translate(vds.getKdumpStatus()));
    setSelinuxEnforceMode(EnumTranslator.getInstance().translate(vds.getSELinuxEnforceMode()));
    setClusterCompatibilityVersion(vds.getSupportedClusterLevels());
    setHostDevicePassthroughSupport(vds.isHostDevicePassthroughEnabled());
    if (!vds.getHighlyAvailableIsConfigured()) {
        setHostedEngineHaIsConfigured(false);
        setHostedEngineHa(constants.bracketedNotAvailableLabel());
    } else {
        setHostedEngineHaIsConfigured(true);
        if (!vds.getHighlyAvailableIsActive()) {
            setHostedEngineHa(constants.haNotActive());
        } else if (vds.getHighlyAvailableGlobalMaintenance()) {
            setHostedEngineHa(constants.haGlobalMaintenance());
        } else if (vds.getHighlyAvailableLocalMaintenance()) {
            setHostedEngineHa(constants.haLocalMaintenance());
        } else {
            setHostedEngineHa(messages.haActive(vds.getHighlyAvailableScore()));
        }
    }
    setLogicalCores(vds.getCpuThreads());
    String onlineCores = vds.getOnlineCpus();
    if (onlineCores != null) {
        onlineCores = // $NON-NLS-1$
        Arrays.stream(onlineCores.split(",")).sorted((s1, s2) -> {
            Integer i1;
            Integer i2;
            try {
                i1 = Integer.parseInt(s1);
                i2 = Integer.parseInt(s2);
            } catch (NumberFormatException ex) {
                return s1.compareTo(s2);
            }
            return i1.compareTo(i2);
        }).collect(// $NON-NLS-1$
        Collectors.joining(", "));
    }
    setOnlineCores(onlineCores);
    setKernelFeatures(formatKernelFeatures(vds.getKernelFeatures()));
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS)

Example 74 with VDS

use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.

the class HostInterfaceListModel method updateActionAvailability.

private void updateActionAvailability() {
    VDS host = getEntity();
    getSaveNetworkConfigCommand().setIsExecutionAllowed(host != null && (host.getNetConfigDirty() == null ? false : host.getNetConfigDirty()));
    getSyncAllHostNetworksCommand().setIsExecutionAllowed(getOriginalItems() != null && getOriginalItems().stream().map(hostInterface -> hostInterface.getNetworkImplementationDetails()).filter(Objects::nonNull).anyMatch(implementationDetails -> implementationDetails.isManaged() && !implementationDetails.isInSync()));
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS)

Example 75 with VDS

use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.

the class HostInterfaceListModel method setEntity.

public void setEntity(VDS value) {
    if (super.getEntity() != null && value != null) {
        VDS currentItem = super.getEntity();
        Guid currentItemId = currentItem.getId();
        Guid newItemId = value.getId();
        if (currentItemId.equals(newItemId)) {
            setEntity(value, false);
            updateActionAvailability();
            return;
        }
    }
    super.setEntity(value);
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) Guid(org.ovirt.engine.core.compat.Guid)

Aggregations

VDS (org.ovirt.engine.core.common.businessentities.VDS)578 ArrayList (java.util.ArrayList)160 Test (org.junit.Test)138 Guid (org.ovirt.engine.core.compat.Guid)132 List (java.util.List)78 VM (org.ovirt.engine.core.common.businessentities.VM)65 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)55 HashMap (java.util.HashMap)53 HashSet (java.util.HashSet)48 Map (java.util.Map)45 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)42 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)42 Set (java.util.Set)40 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)39 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)39 AsyncDataProvider (org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)39 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)38 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)38 ConstantsManager (org.ovirt.engine.ui.uicompat.ConstantsManager)37 Frontend (org.ovirt.engine.ui.frontend.Frontend)35