From 5605512bdfd1e6a5dd44312b0e95e874b27d1f1b Mon Sep 17 00:00:00 2001 From: Jean-Louis Dupond Date: Fri, 11 Oct 2024 14:21:26 +0200 Subject: [PATCH] bll/storage: don't check source domain space on lsm When doing a LiveStorageMigration, the code checked if the disk/image would fit not only on the destination, but also on the source. This because theoretically the snapshot image can grow until the disksize. But this means that we needed to live migrate a 1TB disk, also at least 1TB of free space on the source domain. This is quite useless, and causes problemns to move disks from for example an already overloaded source domain. As this check is neither being done when creating a simple snapshot, just drop the check on the source domain. Signed-off-by: Jean-Louis Dupond --- .../core/bll/storage/disk/MoveOrCopyDiskCommand.java | 2 +- .../core/bll/storage/lsm/LiveMigrateDiskCommand.java | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/disk/MoveOrCopyDiskCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/disk/MoveOrCopyDiskCommand.java index d30cf4c1d84..1b99691113d 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/disk/MoveOrCopyDiskCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/disk/MoveOrCopyDiskCommand.java @@ -715,7 +715,7 @@ protected MultipleDiskVmElementValidator createMultipleDiskVmElementValidator() diskVmElementDao.getAllDiskVmElementsByDiskId(getParameters().getImageGroupID())); } - protected MultipleStorageDomainsValidator createMultipleStorageDomainsValidator() { + public MultipleStorageDomainsValidator createMultipleStorageDomainsValidator() { List sdsToValidate = new ArrayList<>(); sdsToValidate.add(getStorageDomainId()); diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/lsm/LiveMigrateDiskCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/lsm/LiveMigrateDiskCommand.java index 6faed984173..fbec6af5b73 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/lsm/LiveMigrateDiskCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/lsm/LiveMigrateDiskCommand.java @@ -1,6 +1,5 @@ package org.ovirt.engine.core.bll.storage.lsm; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -26,7 +25,6 @@ import org.ovirt.engine.core.bll.tasks.CommandHelper; import org.ovirt.engine.core.bll.tasks.interfaces.CommandCallback; import org.ovirt.engine.core.bll.utils.PermissionSubject; -import org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidator; import org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator; import org.ovirt.engine.core.common.AuditLogType; import org.ovirt.engine.core.common.FeatureSupported; @@ -684,16 +682,6 @@ protected boolean validateDestDomainsSpaceRequirements() { return true; } - @Override - protected MultipleStorageDomainsValidator createMultipleStorageDomainsValidator() { - List sdsToValidate = new ArrayList<>(); - - sdsToValidate.add(getParameters().getSourceDomainId()); - sdsToValidate.add(getParameters().getDestDomainId()); - - return new MultipleStorageDomainsValidator(getStoragePoolId(), sdsToValidate); - } - private DiskImage getDiskImageByImageId(Guid imageId) { if (diskImagesMap.containsKey(imageId)) { return diskImagesMap.get(imageId);