From 72098e4ebda023abf082e2b68cd63b2694ed5ec1 Mon Sep 17 00:00:00 2001 From: anthony Date: Mon, 11 Jul 2011 17:28:30 -0700 Subject: [PATCH] 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 --- .../allocator/AbstractStoragePoolAllocator.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/src/com/cloud/storage/allocator/AbstractStoragePoolAllocator.java b/server/src/com/cloud/storage/allocator/AbstractStoragePoolAllocator.java index 872a95a26c7..29c6647e726 100755 --- a/server/src/com/cloud/storage/allocator/AbstractStoragePoolAllocator.java +++ b/server/src/com/cloud/storage/allocator/AbstractStoragePoolAllocator.java @@ -234,12 +234,12 @@ public abstract class AbstractStoragePoolAllocator extends AdapterBase implement s_logger.info("Did not find template downloaded on secondary hosts in zone " + plan.getDataCenterId()); return false; } else { - s_logger.debug("For template: " + template.getName() + ", using template size multiplier: " + 2); - long templateSize = templateHostVO.getSize(); - long templatePhysicalSize = templateHostVO.getPhysicalSize(); - totalAllocatedSize += (templateSize + _extraBytesPerVolume) + (templatePhysicalSize + _extraBytesPerVolume); + long templateSize = templateHostVO.getPhysicalSize(); + if ( templateSize == 0 ){ + templateSize = templateHostVO.getSize(); + } + totalAllocatedSize += (templateSize + _extraBytesPerVolume); } - } long askingSize = dskCh.getSize();