Skip to content

Commit

Permalink
core: Modify free space validation on destination Storage Domain in L…
Browse files Browse the repository at this point in the history
…SM flow

Modify destination "StorageDomainValidator" getter to return a
dedicated validator that its "getTotalSizeForClonedDisk()" method
requires the additional 3 chunks (approximately 8 GiB) extra space
on the destination Storage Domain.
This is relevant only in LSM flow for cluster version 4.7 or above.

Signed-off-by: Pavel Bar <pbar@redhat.com>
Bug-Url: https://bugzilla.redhat.com/2116309
  • Loading branch information
barpavel authored and ahadas committed Sep 22, 2022
1 parent 7843d9a commit 4655358
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,17 @@ protected boolean isDiskSnapshotNotPluggedToOtherVmsThatAreNotDown(Guid imageId)
}

protected StorageDomainValidator createStorageDomainValidator(StorageDomain storageDomain) {
return new StorageDomainValidator(storageDomain);
return new StorageDomainValidator(storageDomain) {
@Override
protected double getTotalSizeForClonedDisk(DiskImage diskImage) {
double basicSize = super.getTotalSizeForClonedDisk(diskImage);
// Add additional snapshot overhead (relevant only for Live Storage flow, cluster version 4.7 or above).
if (FeatureSupported.isReplicateExtendSupported(getCluster().getCompatibilityVersion())) {
basicSize += ImagesHandler.computeImageInitialSizeInBytes(diskImage.getImage());
}
return basicSize;
}
};
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private double getTotalSizeForClonedDisks(Collection<DiskImage> diskImages) {
* currently in the VDSM code.
*
* */
private double getTotalSizeForClonedDisk(DiskImage diskImage) {
protected double getTotalSizeForClonedDisk(DiskImage diskImage) {
double sizeForDisk = ImagesHandler.getTotalActualSizeOfDisk(diskImage, storageDomain.getStorageStaticData());

if (diskImage.getVolumeFormat() == VolumeFormat.COW) {
Expand Down

0 comments on commit 4655358

Please sign in to comment.