Skip to content

Commit addec8c

Browse files
author
gitlab
committed
Merge branch 'fix/ZSTAC-74683' into '5.5.12'
<fix>[vm]: use max of virtual and actual size for root disk allocation See merge request zstackio/zstack!9155
2 parents 32e1e94 + 6b4521b commit addec8c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

header/src/main/java/org/zstack/header/vm/VmInstanceSpec.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,9 @@ public void setBootMode(String bootMode) {
847847

848848
public long getRootDiskAllocateSize() {
849849
if (rootDiskOffering == null) {
850-
return this.getImageSpec().getInventory().getSize();
850+
long virtualSize = this.getImageSpec().getInventory().getSize();
851+
long actualSize = this.getImageSpec().getInventory().getActualSize();
852+
return Math.max(virtualSize, actualSize);
851853
}
852854
return rootDiskOffering.getDiskSize();
853855
}

0 commit comments

Comments
 (0)