Skip to content

Commit 72098e4

Browse files
committed
bug 10688: if the template is not installed in the primary storage, the asking zie is doubled, fixed by using physical size for template
status 10688: resolved fixed
1 parent 6d8eb45 commit 72098e4

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎server/src/com/cloud/storage/allocator/AbstractStoragePoolAllocator.java‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,12 @@ protected boolean checkPool(ExcludeList avoid, StoragePoolVO pool, DiskProfile d
234234
s_logger.info("Did not find template downloaded on secondary hosts in zone " + plan.getDataCenterId());
235235
return false;
236236
} else {
237-
s_logger.debug("For template: " + template.getName() + ", using template size multiplier: " + 2);
238-
long templateSize = templateHostVO.getSize();
239-
long templatePhysicalSize = templateHostVO.getPhysicalSize();
240-
totalAllocatedSize += (templateSize + _extraBytesPerVolume) + (templatePhysicalSize + _extraBytesPerVolume);
237+
long templateSize = templateHostVO.getPhysicalSize();
238+
if ( templateSize == 0 ){
239+
templateSize = templateHostVO.getSize();
240+
}
241+
totalAllocatedSize += (templateSize + _extraBytesPerVolume);
241242
}
242-
243243
}
244244

245245
long askingSize = dskCh.getSize();

0 commit comments

Comments
 (0)