Search in sources :

Example 6 with MultipleDiskVmElementValidator

use of org.ovirt.engine.core.bll.validator.storage.MultipleDiskVmElementValidator in project ovirt-engine by oVirt.

the class RunVmValidator method validateDisksPassDiscard.

protected ValidationResult validateDisksPassDiscard(VM vm) {
    Map<Guid, Guid> diskIdToDestSdId = getVmDisks().stream().collect(Collectors.toMap(Disk::getId, disk -> disk.getDiskStorageType() == DiskStorageType.IMAGE ? ((DiskImage) disk).getStorageIds().get(0) : Guid.Empty));
    MultipleDiskVmElementValidator multipleDiskVmElementValidator = createMultipleDiskVmElementValidator(getVmDiskVmElementMap());
    return multipleDiskVmElementValidator.isPassDiscardSupportedForDestSds(diskIdToDestSdId);
}
Also used : DiskContentType(org.ovirt.engine.core.common.businessentities.storage.DiskContentType) UsbPolicy(org.ovirt.engine.core.common.businessentities.UsbPolicy) StringUtils(org.apache.commons.lang.StringUtils) Backend(org.ovirt.engine.core.bll.Backend) VdsDynamic(org.ovirt.engine.core.common.businessentities.VdsDynamic) VmNicDao(org.ovirt.engine.core.dao.network.VmNicDao) MultipleDiskVmElementValidator(org.ovirt.engine.core.bll.validator.storage.MultipleDiskVmElementValidator) ActionType(org.ovirt.engine.core.common.action.ActionType) DisksFilter(org.ovirt.engine.core.bll.storage.disk.image.DisksFilter) BackendInternal(org.ovirt.engine.core.bll.interfaces.BackendInternal) StorageDomainValidator(org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator) Map(java.util.Map) VmDevice(org.ovirt.engine.core.common.businessentities.VmDevice) BaseDisk(org.ovirt.engine.core.common.businessentities.storage.BaseDisk) ActionUtils(org.ovirt.engine.core.common.ActionUtils) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) ONLY_SNAPABLE(org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.ONLY_SNAPABLE) DiskImagesValidator(org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator) VmBase(org.ovirt.engine.core.common.businessentities.VmBase) DiskStorageType(org.ovirt.engine.core.common.businessentities.storage.DiskStorageType) GetImagesListParameters(org.ovirt.engine.core.common.queries.GetImagesListParameters) StoragePoolIsoMapId(org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId) Collection(java.util.Collection) EngineMessage(org.ovirt.engine.core.common.errors.EngineMessage) Set(java.util.Set) NetworkDao(org.ovirt.engine.core.dao.network.NetworkDao) VolumeType(org.ovirt.engine.core.common.businessentities.storage.VolumeType) Collectors(java.util.stream.Collectors) RunVmParams(org.ovirt.engine.core.common.action.RunVmParams) VdsDynamicDao(org.ovirt.engine.core.dao.VdsDynamicDao) DiskHandler(org.ovirt.engine.core.bll.storage.disk.DiskHandler) ONLY_NOT_SHAREABLE(org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.ONLY_NOT_SHAREABLE) List(java.util.List) VDSStatus(org.ovirt.engine.core.common.businessentities.VDSStatus) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) RepoImage(org.ovirt.engine.core.common.businessentities.storage.RepoImage) SchedulingManager(org.ovirt.engine.core.bll.scheduling.SchedulingManager) Injector(org.ovirt.engine.core.di.Injector) ValidationResult(org.ovirt.engine.core.bll.ValidationResult) MultipleStorageDomainsValidator(org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidator) GraphicsType(org.ovirt.engine.core.common.businessentities.GraphicsType) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) QueryType(org.ovirt.engine.core.common.queries.QueryType) DiskVmElement(org.ovirt.engine.core.common.businessentities.storage.DiskVmElement) Guid(org.ovirt.engine.core.compat.Guid) StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) ImageFileType(org.ovirt.engine.core.common.businessentities.storage.ImageFileType) StorageDomainStatus(org.ovirt.engine.core.common.businessentities.StorageDomainStatus) Function(java.util.function.Function) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage) NetworkUtils(org.ovirt.engine.core.utils.NetworkUtils) DbFacade(org.ovirt.engine.core.dal.dbbroker.DbFacade) StoragePoolIsoMapDao(org.ovirt.engine.core.dao.StoragePoolIsoMapDao) VmDeviceGeneralType(org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType) VmPropertiesUtils(org.ovirt.engine.core.common.utils.customprop.VmPropertiesUtils) HashSet(java.util.HashSet) Inject(javax.inject.Inject) Network(org.ovirt.engine.core.common.businessentities.network.Network) ImagesHandler(org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler) StoragePoolValidator(org.ovirt.engine.core.bll.validator.storage.StoragePoolValidator) ValidationUtils(org.ovirt.engine.core.common.utils.ValidationUtils) VmNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface) SnapshotsValidator(org.ovirt.engine.core.bll.snapshots.SnapshotsValidator) BootSequence(org.ovirt.engine.core.common.businessentities.BootSequence) Disk(org.ovirt.engine.core.common.businessentities.storage.Disk) VmCommonUtils(org.ovirt.engine.core.common.utils.VmCommonUtils) VM(org.ovirt.engine.core.common.businessentities.VM) DiskDao(org.ovirt.engine.core.dao.DiskDao) IsVmDuringInitiatingVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.IsVmDuringInitiatingVDSCommandParameters) VDSCommandType(org.ovirt.engine.core.common.vdscommands.VDSCommandType) ONLY_PLUGGED(org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.ONLY_PLUGGED) StorageDomainDao(org.ovirt.engine.core.dao.StorageDomainDao) Collections(java.util.Collections) VmDeviceUtils(org.ovirt.engine.core.bll.utils.VmDeviceUtils) VMStatus(org.ovirt.engine.core.common.businessentities.VMStatus) StoragePoolIsoMap(org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap) MultipleDiskVmElementValidator(org.ovirt.engine.core.bll.validator.storage.MultipleDiskVmElementValidator) Guid(org.ovirt.engine.core.compat.Guid) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage)

Aggregations

MultipleDiskVmElementValidator (org.ovirt.engine.core.bll.validator.storage.MultipleDiskVmElementValidator)6 Collection (java.util.Collection)3 List (java.util.List)3 Map (java.util.Map)3 Collectors (java.util.stream.Collectors)3 Inject (javax.inject.Inject)3 DiskHandler (org.ovirt.engine.core.bll.storage.disk.DiskHandler)3 DisksFilter (org.ovirt.engine.core.bll.storage.disk.image.DisksFilter)3 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)3 Disk (org.ovirt.engine.core.common.businessentities.storage.Disk)3 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)3 DiskVmElement (org.ovirt.engine.core.common.businessentities.storage.DiskVmElement)3 EngineMessage (org.ovirt.engine.core.common.errors.EngineMessage)3 Guid (org.ovirt.engine.core.compat.Guid)3 Collections (java.util.Collections)2 HashSet (java.util.HashSet)2 Set (java.util.Set)2 Function (java.util.function.Function)2 StringUtils (org.apache.commons.lang.StringUtils)2 ValidationResult (org.ovirt.engine.core.bll.ValidationResult)2