Search in sources :

Example 71 with Version

use of org.ovirt.engine.core.compat.Version in project ovirt-engine by oVirt.

the class OvfReader method readGeneralData.

protected void readGeneralData(XmlNode content) {
    vmBase.setVmInit(new VmInit());
    consumeReadProperty(content, DESCRIPTION, val -> vmBase.setDescription(val));
    consumeReadProperty(content, COMMENT, val -> vmBase.setComment(val));
    consumeReadProperty(content, DOMAIN, val -> vmBase.getVmInit().setDomain(val));
    consumeReadProperty(content, CREATION_DATE, val -> vmBase.setCreationDate(OvfParser.utcDateStringToLocalDate(val)));
    consumeReadProperty(content, EXPORT_DATE, val -> vmBase.setExportDate(OvfParser.utcDateStringToLocalDate(val)));
    consumeReadProperty(content, DEFAULT_BOOT_SEQUENCE, val -> vmBase.setDefaultBootSequence(BootSequence.forValue(Integer.parseInt(val))));
    consumeReadProperty(content, INITRD_URL, val -> vmBase.setInitrdUrl(val));
    consumeReadProperty(content, KERNEL_URL, val -> vmBase.setKernelUrl(val));
    consumeReadProperty(content, KERNEL_PARAMS, val -> vmBase.setKernelParams(val));
    consumeReadProperty(content, GENERATION, val -> vmBase.setDbGeneration(Long.parseLong(val)), () -> vmBase.setDbGeneration(1L));
    XmlNode node = selectSingleNode(content, CUSTOM_COMPATIBILITY_VERSION);
    if (node != null) {
        vmBase.setCustomCompatibilityVersion(new Version(node.innerText));
    }
    // the originating ENGINE version
    Version originVersion = new Version(getVersion());
    node = selectSingleNode(content, CLUSTER_COMPATIBILITY_VERSION);
    if (node != null) {
        originVersion = new Version(node.innerText);
    }
    vmBase.setClusterCompatibilityVersionOrigin(originVersion);
    // Note: the fetching of 'default display type' should happen before reading
    // the hardware section
    consumeReadProperty(content, getDefaultDisplayTypeStringRepresentation(), val -> vmBase.setDefaultDisplayType(DisplayType.forValue(Integer.parseInt(val))));
    // after reading the hardware section, if graphics device is still absent, add a default one
    addDefaultGraphicsDevice();
    fixDiskVmElements();
    // due to dependency on vmBase.getOsId() must be read AFTER readOsSection
    consumeReadProperty(content, TIMEZONE, val -> vmBase.setTimeZone(val), () -> {
        if (osRepository.isWindows(vmBase.getOsId())) {
            vmBase.setTimeZone(Config.getValue(ConfigValues.DefaultWindowsTimeZone));
        } else {
            vmBase.setTimeZone(Config.getValue(ConfigValues.DefaultGeneralTimeZone));
        }
    });
    consumeReadProperty(content, ORIGIN, val -> vmBase.setOrigin(OriginType.forValue(Integer.parseInt(val))));
    consumeReadProperty(content, VM_TYPE, val -> vmBase.setVmType(VmType.forValue(Integer.parseInt(val))));
    consumeReadProperty(content, RESUME_BEHAVIOR, val -> vmBase.setResumeBehavior(VmResumeBehavior.valueOf(val)));
    consumeReadProperty(content, IS_SMARTCARD_ENABLED, val -> vmBase.setSmartcardEnabled(Boolean.parseBoolean(val)));
    consumeReadProperty(content, NUM_OF_IOTHREADS, val -> vmBase.setNumOfIoThreads(Integer.parseInt(val)));
    consumeReadProperty(content, DELETE_PROTECTED, val -> vmBase.setDeleteProtected(Boolean.parseBoolean(val)));
    consumeReadProperty(content, SSO_METHOD, val -> vmBase.setSsoMethod(SsoMethod.fromString(val)));
    consumeReadProperty(content, TUNNEL_MIGRATION, val -> vmBase.setTunnelMigration(Boolean.parseBoolean(val)));
    consumeReadProperty(content, VNC_KEYBOARD_LAYOUT, val -> vmBase.setVncKeyboardLayout(val));
    consumeReadProperty(content, MIN_ALLOCATED_MEMORY, val -> vmBase.setMinAllocatedMem(Integer.parseInt(val)));
    consumeReadProperty(content, IS_STATELESS, val -> vmBase.setStateless(Boolean.parseBoolean(val)));
    consumeReadProperty(content, IS_RUN_AND_PAUSE, val -> vmBase.setRunAndPause(Boolean.parseBoolean(val)));
    consumeReadProperty(content, CREATED_BY_USER_ID, val -> vmBase.setCreatedByUserId(Guid.createGuidFromString(val)));
    consumeReadProperty(content, MIGRATION_DOWNTIME, val -> vmBase.setMigrationDowntime(Integer.parseInt(val)));
    consumeReadProperty(content, MIGRATION_SUPPORT, val -> vmBase.setMigrationSupport(MigrationSupport.forValue(Integer.parseInt(val))));
    // TODO dedicated to multiple hosts
    readDedicatedHostsList();
    consumeReadProperty(content, SERIAL_NUMBER_POLICY, val -> vmBase.setSerialNumberPolicy(SerialNumberPolicy.forValue(Integer.parseInt(val))));
    consumeReadProperty(content, CUSTOM_SERIAL_NUMBER, val -> vmBase.setCustomSerialNumber(val));
    consumeReadProperty(content, AUTO_STARTUP, val -> vmBase.setAutoStartup(Boolean.parseBoolean(val)));
    consumeReadProperty(content, PRIORITY, val -> vmBase.setPriority(Integer.parseInt(val)));
    consumeReadProperty(content, IS_BOOT_MENU_ENABLED, val -> vmBase.setBootMenuEnabled(Boolean.parseBoolean(val)));
    consumeReadProperty(content, IS_SPICE_FILE_TRANSFER_ENABLED, val -> vmBase.setSpiceFileTransferEnabled(Boolean.parseBoolean(val)));
    consumeReadProperty(content, IS_SPICE_COPY_PASTE_ENABLED, val -> vmBase.setSpiceCopyPasteEnabled(Boolean.parseBoolean(val)));
    consumeReadProperty(content, ALLOW_CONSOLE_RECONNECT, val -> vmBase.setAllowConsoleReconnect(Boolean.parseBoolean(val)));
    consumeReadProperty(content, CONSOLE_DISCONNECT_ACTION, val -> vmBase.setConsoleDisconnectAction(ConsoleDisconnectAction.fromString(val)));
    consumeReadProperty(content, IS_AUTO_CONVERGE, val -> vmBase.setAutoConverge(Boolean.parseBoolean(val)));
    consumeReadProperty(content, IS_MIGRATE_COMPRESSED, val -> vmBase.setMigrateCompressed(Boolean.parseBoolean(val)));
    consumeReadProperty(content, MIGRATION_POLICY_ID, val -> vmBase.setMigrationPolicyId(Guid.createGuidFromString(val)));
    consumeReadProperty(content, CUSTOM_EMULATED_MACHINE, val -> vmBase.setCustomEmulatedMachine(val));
    consumeReadProperty(content, CUSTOM_CPU_NAME, val -> vmBase.setCustomCpuName(val));
    consumeReadProperty(content, PREDEFINED_PROPERTIES, val -> vmBase.setPredefinedProperties(val));
    consumeReadProperty(content, USER_DEFINED_PROPERTIES, val -> vmBase.setUserDefinedProperties(val));
    consumeReadProperty(content, MAX_MEMORY_SIZE_MB, val -> vmBase.setMaxMemorySizeMb(Integer.parseInt(val)));
    vmBase.setCustomProperties(VmPropertiesUtils.getInstance().customProperties(vmBase.getPredefinedProperties(), vmBase.getUserDefinedProperties()));
    consumeReadProperty(content, VM_LEASE, val -> vmBase.setLeaseStorageDomainId(new Guid(val)));
    readVmInit(content);
}
Also used : XmlNode(org.ovirt.engine.core.utils.ovf.xml.XmlNode) VmInit(org.ovirt.engine.core.common.businessentities.VmInit) Version(org.ovirt.engine.core.compat.Version) Guid(org.ovirt.engine.core.compat.Guid)

Example 72 with Version

use of org.ovirt.engine.core.compat.Version in project ovirt-engine by oVirt.

the class OvfReader method setDeviceByResource.

private void setDeviceByResource(XmlNode node, VmDevice vmDevice) {
    String resourceType = selectSingleNode(node, VMD_RESOURCE_TYPE, _xmlNS).innerText;
    XmlNode resourceSubTypeNode = selectSingleNode(node, VMD_SUB_RESOURCE_TYPE, _xmlNS);
    if (resourceSubTypeNode == null) {
        // we need special handling for Monitor to define it as vnc or spice
        if (OvfHardware.Monitor.equals(adjustHardwareResourceType(resourceType))) {
            // get number of monitors from VirtualQuantity in OVF
            if (selectSingleNode(node, VMD_VIRTUAL_QUANTITY, _xmlNS) != null && !StringUtils.isEmpty(selectSingleNode(node, VMD_VIRTUAL_QUANTITY, _xmlNS).innerText)) {
                int virtualQuantity = Integer.parseInt(selectSingleNode(node, VMD_VIRTUAL_QUANTITY, _xmlNS).innerText);
                if (virtualQuantity > 1) {
                    vmDevice.setDevice(VmDeviceType.QXL.getName());
                } else {
                    // get first supported display device
                    List<Pair<GraphicsType, DisplayType>> supportedGraphicsAndDisplays = osRepository.getGraphicsAndDisplays(vmBase.getOsId(), new Version(getVersion()));
                    if (!supportedGraphicsAndDisplays.isEmpty()) {
                        DisplayType firstDisplayType = supportedGraphicsAndDisplays.get(0).getSecond();
                        vmDevice.setDevice(firstDisplayType.getDefaultVmDeviceType().getName());
                    } else {
                        vmDevice.setDevice(VmDeviceType.QXL.getName());
                    }
                }
            } else {
                // default to spice if quantity not found
                vmDevice.setDevice(VmDeviceType.QXL.getName());
            }
        } else {
            vmDevice.setDevice(VmDeviceType.getoVirtDevice(Integer.parseInt(resourceType)).getName());
        }
    } else if (OvfHardware.Network.equals(resourceType)) {
        // handle interfaces with different sub types : we have 0-5 as the VmInterfaceType enum
        Integer nicTypeValue = getVmInterfaceType(resourceSubTypeNode);
        VmInterfaceType nicType = nicTypeValue != null ? VmInterfaceType.forValue(nicTypeValue) : null;
        if (nicType != null) {
            if (nicType == VmInterfaceType.pciPassthrough) {
                vmDevice.setDevice(VmDeviceType.HOST_DEVICE.getName());
            } else {
                vmDevice.setDevice(VmDeviceType.BRIDGE.getName());
            }
        } else {
            vmDevice.setDevice(VmDeviceType.getoVirtDevice(Integer.parseInt(resourceType)).getName());
        }
    }
}
Also used : XmlNode(org.ovirt.engine.core.utils.ovf.xml.XmlNode) DisplayType(org.ovirt.engine.core.common.businessentities.DisplayType) Version(org.ovirt.engine.core.compat.Version) VmInterfaceType(org.ovirt.engine.core.common.businessentities.network.VmInterfaceType) Pair(org.ovirt.engine.core.common.utils.Pair)

Example 73 with Version

use of org.ovirt.engine.core.compat.Version in project ovirt-engine by oVirt.

the class OvfReader method addDefaultGraphicsDevice.

private void addDefaultGraphicsDevice() {
    VmDevice device = VmDeviceCommonUtils.findVmDeviceByGeneralType(vmBase.getManagedDeviceMap(), VmDeviceGeneralType.GRAPHICS);
    if (device != null) {
        return;
    }
    List<Pair<GraphicsType, DisplayType>> graphicsAndDisplays = osRepository.getGraphicsAndDisplays(vmBase.getOsId(), new Version(getVersion()));
    GraphicsType graphicsType = vmBase.getDefaultDisplayType() == DisplayType.cirrus ? GraphicsType.VNC : GraphicsType.SPICE;
    GraphicsType supportedGraphicsType = null;
    for (Pair<GraphicsType, DisplayType> pair : graphicsAndDisplays) {
        if (pair.getSecond() == vmBase.getDefaultDisplayType()) {
            if (pair.getFirst() == graphicsType) {
                supportedGraphicsType = graphicsType;
                break;
            }
            if (supportedGraphicsType == null) {
                supportedGraphicsType = pair.getFirst();
            }
        }
    }
    if (supportedGraphicsType != null) {
        device = new GraphicsDevice(supportedGraphicsType.getCorrespondingDeviceType());
        device.setId(new VmDeviceId(Guid.newGuid(), vmBase.getId()));
        addManagedVmDevice(device);
    } else {
        log.warn("Cannot find any graphics type for display type {} supported by OS {} in compatibility version {}", vmBase.getDefaultDisplayType().name(), osRepository.getOsName(vmBase.getOsId()), getVersion());
    }
}
Also used : GraphicsType(org.ovirt.engine.core.common.businessentities.GraphicsType) VmDevice(org.ovirt.engine.core.common.businessentities.VmDevice) GraphicsDevice(org.ovirt.engine.core.common.businessentities.GraphicsDevice) DisplayType(org.ovirt.engine.core.common.businessentities.DisplayType) Version(org.ovirt.engine.core.compat.Version) VmDeviceId(org.ovirt.engine.core.common.businessentities.VmDeviceId) Pair(org.ovirt.engine.core.common.utils.Pair)

Example 74 with Version

use of org.ovirt.engine.core.compat.Version in project ovirt-engine by oVirt.

the class AsyncDataProvider method initCpuMap.

private void initCpuMap() {
    cpuMap = new HashMap<>();
    final List<QueryType> queryTypes = new ArrayList<>();
    final List<QueryParametersBase> queryParams = new ArrayList<>();
    for (Version version : Version.ALL) {
        queryTypes.add(QueryType.GetAllServerCpuList);
        queryParams.add(new GetAllServerCpuListParameters(version));
    }
    final IFrontendMultipleQueryAsyncCallback callback = result -> {
        for (int i = 0; i < result.getReturnValues().size(); i++) {
            final List<ServerCpu> cpus = result.getReturnValues().get(i).getReturnValue();
            final Version version = ((GetAllServerCpuListParameters) result.getParameters().get(i)).getVersion();
            initCpuMapForVersion(version, cpus);
        }
    };
    Frontend.getInstance().runMultipleQueries(queryTypes, queryParams, callback);
}
Also used : StorageDomainsAndStoragePoolIdQueryParameters(org.ovirt.engine.core.common.queries.StorageDomainsAndStoragePoolIdQueryParameters) BusinessEntity(org.ovirt.engine.core.common.businessentities.BusinessEntity) ServiceType(org.ovirt.engine.core.common.businessentities.gluster.ServiceType) StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) GetConfigurationValueParameters(org.ovirt.engine.core.common.queries.GetConfigurationValueParameters) Map(java.util.Map) VdsNumaNode(org.ovirt.engine.core.common.businessentities.VdsNumaNode) ProfileEntry(org.ovirt.engine.core.aaa.ProfileEntry) AsyncQuery(org.ovirt.engine.ui.frontend.AsyncQuery) DisplayType(org.ovirt.engine.core.common.businessentities.DisplayType) AdditionalFeature(org.ovirt.engine.core.common.businessentities.AdditionalFeature) GlusterGeoRepSession(org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession) ActionUtils(org.ovirt.engine.core.common.ActionUtils) RefObject(org.ovirt.engine.core.compat.RefObject) SetupNetworksBondModel(org.ovirt.engine.ui.uicommonweb.models.hosts.SetupNetworksBondModel) GlusterVolumeQueriesParameters(org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters) StringHelper(org.ovirt.engine.core.compat.StringHelper) NetworkQoSModel(org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkQoSModel) VolumeType(org.ovirt.engine.core.common.businessentities.storage.VolumeType) DbUser(org.ovirt.engine.core.common.businessentities.aaa.DbUser) GlusterParameters(org.ovirt.engine.core.common.queries.gluster.GlusterParameters) GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) DiskInterface(org.ovirt.engine.core.common.businessentities.storage.DiskInterface) GraphicsType(org.ovirt.engine.core.common.businessentities.GraphicsType) GlusterServerService(org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService) GetStorageDomainsByConnectionParameters(org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters) QueryType(org.ovirt.engine.core.common.queries.QueryType) LoginModel(org.ovirt.engine.ui.uicommonweb.models.LoginModel) GlusterVolumeProfileParameters(org.ovirt.engine.core.common.queries.gluster.GlusterVolumeProfileParameters) ServerCpu(org.ovirt.engine.core.common.businessentities.ServerCpu) StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) ExternalDiscoveredHost(org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost) NfsStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage) ProviderQueryParameters(org.ovirt.engine.core.common.queries.ProviderQueryParameters) AuthzGroup(org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup) OsQueryParameters(org.ovirt.engine.core.common.queries.OsQueryParameters) GlusterClusterService(org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService) GlusterVolumeSnapshotSchedule(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotSchedule) MigrationPolicy(org.ovirt.engine.core.common.migration.MigrationPolicy) HostNetworkQos(org.ovirt.engine.core.common.businessentities.network.HostNetworkQos) Pair(org.ovirt.engine.core.common.utils.Pair) ExternalComputeResource(org.ovirt.engine.core.common.businessentities.ExternalComputeResource) VmPool(org.ovirt.engine.core.common.businessentities.VmPool) IdsQueryParameters(org.ovirt.engine.core.common.queries.IdsQueryParameters) VmNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface) Quota(org.ovirt.engine.core.common.businessentities.Quota) GlusterHookQueryParameters(org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters) VmCommonUtils(org.ovirt.engine.core.common.utils.VmCommonUtils) SupportedAdditionalClusterFeature(org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature) VM(org.ovirt.engine.core.common.businessentities.VM) QosType(org.ovirt.engine.core.common.businessentities.qos.QosType) VnicProfileView(org.ovirt.engine.core.common.businessentities.network.VnicProfileView) GetExistingStorageDomainListParameters(org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters) GlusterStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.GlusterStorageModel) GlusterVolumeRemoveBricksQueriesParameters(org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters) QuotaComparator(org.ovirt.engine.ui.uicommonweb.comparators.QuotaComparator) SearchType(org.ovirt.engine.core.common.interfaces.SearchType) NetworkModel(org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkModel) GetSupportedCpuListParameters(org.ovirt.engine.core.common.queries.GetSupportedCpuListParameters) SortedSet(java.util.SortedSet) GetClusterFeaturesByVersionAndCategoryParameters(org.ovirt.engine.core.common.queries.GetClusterFeaturesByVersionAndCategoryParameters) GetVmsFromExternalProviderQueryParameters(org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters) GetAllProvidersParameters(org.ovirt.engine.core.common.queries.GetAllProvidersParameters) OriginType(org.ovirt.engine.core.common.businessentities.OriginType) PosixStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel) KeyValuePairCompat(org.ovirt.engine.core.compat.KeyValuePairCompat) Version(org.ovirt.engine.core.compat.Version) EventArgs(org.ovirt.engine.ui.uicompat.EventArgs) StorageType(org.ovirt.engine.core.common.businessentities.storage.StorageType) Collection(java.util.Collection) WanColorDepth(org.ovirt.engine.core.common.console.ConsoleOptions.WanColorDepth) Collectors(java.util.stream.Collectors) TagsType(org.ovirt.engine.core.common.businessentities.TagsType) GetPermittedStorageDomainsByStoragePoolIdParameters(org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters) GlusterVolumeAdvancedDetails(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails) ApplicationModeHelper(org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper) VDSStatus(org.ovirt.engine.core.common.businessentities.VDSStatus) GetTagsByUserGroupIdParameters(org.ovirt.engine.core.common.queries.GetTagsByUserGroupIdParameters) Entry(java.util.Map.Entry) Converter(org.ovirt.engine.ui.frontend.Converter) VdcEventNotificationUtils(org.ovirt.engine.core.common.VdcEventNotificationUtils) IStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel) GetAllAttachableDisksForVmQueryParameters(org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters) IntegerCompat(org.ovirt.engine.core.compat.IntegerCompat) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) ImportIscsiStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.ImportIscsiStorageModel) ExternalHostGroup(org.ovirt.engine.core.common.businessentities.ExternalHostGroup) GetAllServerCpuListParameters(org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters) HashSet(java.util.HashSet) Frontend(org.ovirt.engine.ui.frontend.Frontend) GetTagsByUserIdParameters(org.ovirt.engine.core.common.queries.GetTagsByUserIdParameters) VolumeFormat(org.ovirt.engine.core.common.businessentities.storage.VolumeFormat) QueryParametersBase(org.ovirt.engine.core.common.queries.QueryParametersBase) CinderVolumeType(org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType) GetStoragePoolsByClusterServiceParameters(org.ovirt.engine.core.common.queries.GetStoragePoolsByClusterServiceParameters) VmTemplateStatus(org.ovirt.engine.core.common.businessentities.VmTemplateStatus) GetVmChangedFieldsForNextRunParameters(org.ovirt.engine.core.common.queries.GetVmChangedFieldsForNextRunParameters) DbGroup(org.ovirt.engine.core.common.businessentities.aaa.DbGroup) ConfigurationType(org.ovirt.engine.core.common.businessentities.ConfigurationType) ClusterEditWarnings(org.ovirt.engine.core.common.businessentities.ClusterEditWarnings) GetHostListFromExternalProviderParameters(org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters) GetLunsByVgIdParameters(org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters) Role(org.ovirt.engine.core.common.businessentities.Role) StorageDomainType(org.ovirt.engine.core.common.businessentities.StorageDomainType) Comparator(java.util.Comparator) VmManagementParametersBase(org.ovirt.engine.core.common.action.VmManagementParametersBase) RpmVersion(org.ovirt.engine.core.compat.RpmVersion) Arrays(java.util.Arrays) GetConnectionsByDataCenterAndStorageTypeParameters(org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters) Provider(org.ovirt.engine.core.common.businessentities.Provider) GetDataCentersWithPermittedActionOnClustersParameters(org.ovirt.engine.core.common.queries.GetDataCentersWithPermittedActionOnClustersParameters) ApplicationMode(org.ovirt.engine.core.common.mode.ApplicationMode) QuotaEnforcementTypeEnum(org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) ActionType(org.ovirt.engine.core.common.action.ActionType) HostDeviceView(org.ovirt.engine.core.common.businessentities.HostDeviceView) GetVmTemplateParameters(org.ovirt.engine.core.common.queries.GetVmTemplateParameters) Snapshot(org.ovirt.engine.core.common.businessentities.Snapshot) Tags(org.ovirt.engine.core.common.businessentities.Tags) GlusterVolumeGeoRepEligibilityParameters(org.ovirt.engine.core.common.queries.gluster.GlusterVolumeGeoRepEligibilityParameters) SearchParameters(org.ovirt.engine.core.common.queries.SearchParameters) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) VmTemplate(org.ovirt.engine.core.common.businessentities.VmTemplate) Set(java.util.Set) NameQueryParameters(org.ovirt.engine.core.common.queries.NameQueryParameters) VmGuestAgentInterface(org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface) EventNotificationEntity(org.ovirt.engine.core.common.EventNotificationEntity) GetVmTemplatesFromStorageDomainParameters(org.ovirt.engine.core.common.queries.GetVmTemplatesFromStorageDomainParameters) FenceAgent(org.ovirt.engine.core.common.businessentities.pm.FenceAgent) GlusterServiceQueryParameters(org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters) PairQueryable(org.ovirt.engine.core.common.utils.PairQueryable) Label(org.ovirt.engine.core.common.businessentities.Label) ProviderType(org.ovirt.engine.core.common.businessentities.ProviderType) VdcObjectType(org.ovirt.engine.core.common.VdcObjectType) VmWithStatusForExclusiveLock(org.ovirt.engine.core.common.businessentities.VmWithStatusForExclusiveLock) ClusterEditParameters(org.ovirt.engine.core.common.queries.ClusterEditParameters) BondMode(org.ovirt.engine.core.common.businessentities.network.BondMode) LibvirtSecretUsageType(org.ovirt.engine.core.common.businessentities.storage.LibvirtSecretUsageType) VmIconIdSizePair(org.ovirt.engine.core.common.queries.VmIconIdSizePair) GlusterGeoRepNonEligibilityReason(org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason) GetStorageDomainDefaultWipeAfterDeleteParameters(org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters) Guid(org.ovirt.engine.core.compat.Guid) GlusterServersQueryParameters(org.ovirt.engine.core.common.queries.gluster.GlusterServersQueryParameters) TreeSet(java.util.TreeSet) OsRepositoryVerb(org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb) ArrayList(java.util.ArrayList) ArchCapabilitiesVerb(org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters.ArchCapabilitiesVerb) StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) Permission(org.ovirt.engine.core.common.businessentities.Permission) VmHostDevice(org.ovirt.engine.core.common.businessentities.VmHostDevice) ConfigValues(org.ovirt.engine.core.common.config.ConfigValues) ImportFcpStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.ImportFcpStorageModel) Disk(org.ovirt.engine.core.common.businessentities.storage.Disk) LocalStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel) CertificateInfo(org.ovirt.engine.core.common.businessentities.CertificateInfo) Nameable(org.ovirt.engine.core.common.businessentities.Nameable) NumaTuneMode(org.ovirt.engine.core.common.businessentities.NumaTuneMode) NetworkQoS(org.ovirt.engine.core.common.businessentities.network.NetworkQoS) VmInterfaceType(org.ovirt.engine.core.common.businessentities.network.VmInterfaceType) GetAgentFenceOptionsQueryParameters(org.ovirt.engine.core.common.queries.GetAgentFenceOptionsQueryParameters) GetValidHostsForVmsParameters(org.ovirt.engine.core.common.queries.GetValidHostsForVmsParameters) StorageServerConnectionQueryParametersBase(org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase) GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity) ConstantsManager(org.ovirt.engine.ui.uicompat.ConstantsManager) QosQueryParameterBase(org.ovirt.engine.core.common.queries.QosQueryParameterBase) ServerParameters(org.ovirt.engine.core.common.queries.ServerParameters) NetworkFilterParameterModel(org.ovirt.engine.ui.uicommonweb.models.vms.NetworkFilterParameterModel) List(java.util.List) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) GetVmFromConfigurationQueryParameters(org.ovirt.engine.core.common.queries.GetVmFromConfigurationQueryParameters) GetVmFromOvaQueryParameters(org.ovirt.engine.core.common.queries.GetVmFromOvaQueryParameters) AuditLogType(org.ovirt.engine.core.common.AuditLogType) OsValueAutoCompleter(org.ovirt.engine.core.searchbackend.OsValueAutoCompleter) IFrontendMultipleQueryAsyncCallback(org.ovirt.engine.ui.uicompat.IFrontendMultipleQueryAsyncCallback) GlusterHookContentQueryParameters(org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters) GetAllFromExportDomainQueryParameters(org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters) ArchitectureType(org.ovirt.engine.core.common.businessentities.ArchitectureType) GlusterHookEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity) WanDisableEffects(org.ovirt.engine.core.common.console.ConsoleOptions.WanDisableEffects) IscsiStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.IscsiStorageModel) HashMap(java.util.HashMap) ArchCapabilitiesParameters(org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) SimpleDependencyInjector(org.ovirt.engine.core.common.utils.SimpleDependencyInjector) VdsNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface) NoMigrationPolicy(org.ovirt.engine.core.common.migration.NoMigrationPolicy) GetTagsByVdsIdParameters(org.ovirt.engine.core.common.queries.GetTagsByVdsIdParameters) StorageDevice(org.ovirt.engine.core.common.businessentities.gluster.StorageDevice) GetTagsByVmIdParameters(org.ovirt.engine.core.common.queries.GetTagsByVmIdParameters) LexoNumericComparator(org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator) GlusterVolumeSnapshotEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity) Network(org.ovirt.engine.core.common.businessentities.network.Network) NameableComparator(org.ovirt.engine.core.common.businessentities.comparators.NameableComparator) GetHostsForStorageOperationParameters(org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters) FcpStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.FcpStorageModel) Iterator(java.util.Iterator) GlusterVolumeAdvancedDetailsParameters(org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters) ValidateVmMacsParameters(org.ovirt.engine.core.common.queries.ValidateVmMacsParameters) ActionGroup(org.ovirt.engine.core.common.businessentities.ActionGroup) Collections(java.util.Collections) VDS(org.ovirt.engine.core.common.businessentities.VDS) LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs) GetEntitiesWithPermittedActionParameters(org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters) AddedGlusterServersParameters(org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters) Version(org.ovirt.engine.core.compat.Version) RpmVersion(org.ovirt.engine.core.compat.RpmVersion) ArrayList(java.util.ArrayList) GetAllServerCpuListParameters(org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters) QueryParametersBase(org.ovirt.engine.core.common.queries.QueryParametersBase) StorageServerConnectionQueryParametersBase(org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase) IFrontendMultipleQueryAsyncCallback(org.ovirt.engine.ui.uicompat.IFrontendMultipleQueryAsyncCallback) ArrayList(java.util.ArrayList) List(java.util.List) QueryType(org.ovirt.engine.core.common.queries.QueryType)

Example 75 with Version

use of org.ovirt.engine.core.compat.Version in project ovirt-engine by oVirt.

the class VmModelBehaviorBase method updateCompatibilityVersion.

/*
    * Updates the custom compatibility version combo box options on init/DC-change
    */
protected void updateCompatibilityVersion() {
    DataCenterWithCluster dataCenterWithCluster = getModel().getDataCenterWithClustersList().getSelectedItem();
    if (dataCenterWithCluster == null) {
        return;
    }
    final StoragePool dataCenter = dataCenterWithCluster.getDataCenter();
    if (dataCenter == null) {
        return;
    }
    AsyncDataProvider.getInstance().getDataCenterVersions(new AsyncQuery<>(versions -> {
        versions.add(0, null);
        Version selectedVersion;
        selectedVersion = getModel().getCustomCompatibilityVersion().getSelectedItem();
        if (selectedVersion != null && versions.contains(selectedVersion)) {
            getModel().getCustomCompatibilityVersion().setItems(versions, selectedVersion);
        } else {
            getModel().getCustomCompatibilityVersion().setItems(versions);
        }
    }), dataCenter.getId());
}
Also used : UsbPolicy(org.ovirt.engine.core.common.businessentities.UsbPolicy) TemplateWithVersion(org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion) Arrays(java.util.Arrays) CinderDisk(org.ovirt.engine.core.common.businessentities.storage.CinderDisk) VmType(org.ovirt.engine.core.common.businessentities.VmType) InstanceType(org.ovirt.engine.core.common.businessentities.InstanceType) DiskByDiskAliasComparator(org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator) Event(org.ovirt.engine.ui.uicompat.Event) ImagesDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.ImagesDataProvider) VmNumaSupportModel(org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VmNumaSupportModel) QuotaEnforcementTypeEnum(org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) Map(java.util.Map) VmDevice(org.ovirt.engine.core.common.businessentities.VmDevice) ConstantsManager(org.ovirt.engine.ui.uicompat.ConstantsManager) AsyncQuery(org.ovirt.engine.ui.frontend.AsyncQuery) Version(org.ovirt.engine.core.compat.Version) EventArgs(org.ovirt.engine.ui.uicompat.EventArgs) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider) StorageType(org.ovirt.engine.core.common.businessentities.storage.StorageType) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) VmBase(org.ovirt.engine.core.common.businessentities.VmBase) DiskStorageType(org.ovirt.engine.core.common.businessentities.storage.DiskStorageType) VmNumaNode(org.ovirt.engine.core.common.businessentities.VmNumaNode) Collection(java.util.Collection) VmTemplate(org.ovirt.engine.core.common.businessentities.VmTemplate) ListModel(org.ovirt.engine.ui.uicommonweb.models.ListModel) Set(java.util.Set) I18NNameValidation(org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation) StringHelper(org.ovirt.engine.core.compat.StringHelper) VolumeType(org.ovirt.engine.core.common.businessentities.storage.VolumeType) List(java.util.List) VmRngDevice(org.ovirt.engine.core.common.businessentities.VmRngDevice) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) RepoImage(org.ovirt.engine.core.common.businessentities.storage.RepoImage) LatestVmTemplate(org.ovirt.engine.ui.uicommonweb.models.templates.LatestVmTemplate) GraphicsType(org.ovirt.engine.core.common.businessentities.GraphicsType) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) QueryType(org.ovirt.engine.core.common.queries.QueryType) ArchitectureType(org.ovirt.engine.core.common.businessentities.ArchitectureType) TimeZoneType(org.ovirt.engine.core.common.TimeZoneType) Guid(org.ovirt.engine.core.compat.Guid) ServerCpu(org.ovirt.engine.core.common.businessentities.ServerCpu) StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) IEventListener(org.ovirt.engine.ui.uicompat.IEventListener) HashMap(java.util.HashMap) StorageDomainStatus(org.ovirt.engine.core.common.businessentities.StorageDomainStatus) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) ExistingBlankTemplateModelBehavior(org.ovirt.engine.ui.uicommonweb.models.templates.ExistingBlankTemplateModelBehavior) TreeSet(java.util.TreeSet) ArrayList(java.util.ArrayList) AsyncCallback(org.ovirt.engine.ui.frontend.AsyncCallback) HashSet(java.util.HashSet) CpuProfile(org.ovirt.engine.core.common.businessentities.profiles.CpuProfile) Frontend(org.ovirt.engine.ui.frontend.Frontend) NumaSupportModel(org.ovirt.engine.ui.uicommonweb.models.hosts.numa.NumaSupportModel) InstanceTypeManager(org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.InstanceTypeManager) UIMessages(org.ovirt.engine.ui.uicompat.UIMessages) NameableComparator(org.ovirt.engine.core.common.businessentities.comparators.NameableComparator) Linq(org.ovirt.engine.ui.uicommonweb.Linq) BuilderExecutor(org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor) IValidation(org.ovirt.engine.ui.uicommonweb.validation.IValidation) ConfigValues(org.ovirt.engine.core.common.config.ConfigValues) Quota(org.ovirt.engine.core.common.businessentities.Quota) VmCommonUtils(org.ovirt.engine.core.common.utils.VmCommonUtils) VM(org.ovirt.engine.core.common.businessentities.VM) UIConstants(org.ovirt.engine.ui.uicompat.UIConstants) ActionGroup(org.ovirt.engine.core.common.businessentities.ActionGroup) MigrationSupport(org.ovirt.engine.core.common.businessentities.MigrationSupport) Collections(java.util.Collections) VDS(org.ovirt.engine.core.common.businessentities.VDS) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) TemplateWithVersion(org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion) Version(org.ovirt.engine.core.compat.Version)

Aggregations

Version (org.ovirt.engine.core.compat.Version)102 ArrayList (java.util.ArrayList)24 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)20 Guid (org.ovirt.engine.core.compat.Guid)20 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)17 Map (java.util.Map)16 List (java.util.List)15 HashSet (java.util.HashSet)14 VDS (org.ovirt.engine.core.common.businessentities.VDS)14 HashMap (java.util.HashMap)13 ServerCpu (org.ovirt.engine.core.common.businessentities.ServerCpu)12 VM (org.ovirt.engine.core.common.businessentities.VM)11 ConfigValues (org.ovirt.engine.core.common.config.ConfigValues)11 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)11 Arrays (java.util.Arrays)10 MigrationPolicy (org.ovirt.engine.core.common.migration.MigrationPolicy)10 AsyncDataProvider (org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)10 Collection (java.util.Collection)9 Collections (java.util.Collections)9 ArchitectureType (org.ovirt.engine.core.common.businessentities.ArchitectureType)9