diff --git a/server/src/com/cloud/storage/download/DownloadMonitorImpl.java b/server/src/com/cloud/storage/download/DownloadMonitorImpl.java index ea142137dc3..064c9660bcf 100755 --- a/server/src/com/cloud/storage/download/DownloadMonitorImpl.java +++ b/server/src/com/cloud/storage/download/DownloadMonitorImpl.java @@ -234,6 +234,10 @@ public class DownloadMonitorImpl implements DownloadMonitor { } Long maxTemplateSizeInBytes = getMaxTemplateSizeInBytes(); + if (srcTmpltHost.getSize() > maxTemplateSizeInBytes){ + throw new CloudRuntimeException("Cant copy the template as the template's size " +srcTmpltHost.getSize()+ + " is greater than max.template.iso.size " + maxTemplateSizeInBytes); + } if(destTmpltHost != null) { start();