diff --git a/server/src/com/cloud/storage/allocator/AbstractStoragePoolAllocator.java b/server/src/com/cloud/storage/allocator/AbstractStoragePoolAllocator.java index c226784d2ec..05bb740e0fe 100644 --- a/server/src/com/cloud/storage/allocator/AbstractStoragePoolAllocator.java +++ b/server/src/com/cloud/storage/allocator/AbstractStoragePoolAllocator.java @@ -211,9 +211,7 @@ public abstract class AbstractStoragePoolAllocator extends AdapterBase implement } for (VMTemplateStoragePoolVO templatePoolVO : templatePoolVOs) { - VMTemplateVO templateInPool = _templateDao.findById(templatePoolVO.getTemplateId()); - - if ((template != null) && !tmpinstalled && (templateInPool.getId() == template.getId())) { + if ((template != null) && !tmpinstalled && (templatePoolVO.getTemplateId() == template.getId())) { tmpinstalled = true; }