Skip to content

Commit

Permalink
bll/storage: don't check source domain space on lsm
Browse files Browse the repository at this point in the history
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 <jean-louis@dupond.be>
  • Loading branch information
dupondje committed Oct 14, 2024
1 parent 1e10b6e commit 5605512
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ protected MultipleDiskVmElementValidator createMultipleDiskVmElementValidator()
diskVmElementDao.getAllDiskVmElementsByDiskId(getParameters().getImageGroupID()));
}

protected MultipleStorageDomainsValidator createMultipleStorageDomainsValidator() {
public MultipleStorageDomainsValidator createMultipleStorageDomainsValidator() {
List<Guid> sdsToValidate = new ArrayList<>();
sdsToValidate.add(getStorageDomainId());

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -684,16 +682,6 @@ protected boolean validateDestDomainsSpaceRequirements() {
return true;
}

@Override
protected MultipleStorageDomainsValidator createMultipleStorageDomainsValidator() {
List<Guid> 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);
Expand Down

0 comments on commit 5605512

Please sign in to comment.