From 09c26e56711590316f233f26911e16654057834e Mon Sep 17 00:00:00 2001 From: Nitin Date: Tue, 2 Aug 2011 20:30:10 +0530 Subject: [PATCH] bug 10775: copyTemplate - Compute checksum at source from now on because the checksum might be referring to the compressed template. Send this checksum for comparison. --- .../com/cloud/storage/download/DownloadMonitorImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/src/com/cloud/storage/download/DownloadMonitorImpl.java b/server/src/com/cloud/storage/download/DownloadMonitorImpl.java index d4249382970..31395a3c518 100755 --- a/server/src/com/cloud/storage/download/DownloadMonitorImpl.java +++ b/server/src/com/cloud/storage/download/DownloadMonitorImpl.java @@ -236,12 +236,14 @@ public class DownloadMonitorImpl implements DownloadMonitor { if(destTmpltHost != null) { start(); - + String sourceChecksum = _vmMgr.getChecksum(srcTmpltHost.getHostId(), srcTmpltHost.getInstallPath()); DownloadCommand dcmd = - new DownloadCommand(destServer.getStorageUrl(), url, template, TemplateConstants.DEFAULT_HTTP_AUTH_USER, _copyAuthPasswd, maxTemplateSizeInBytes); + new DownloadCommand(destServer.getStorageUrl(), url, template, TemplateConstants.DEFAULT_HTTP_AUTH_USER, _copyAuthPasswd, maxTemplateSizeInBytes); + if (downloadJobExists) { dcmd = new DownloadProgressCommand(dcmd, destTmpltHost.getJobId(), RequestType.GET_OR_RESTART); - } + } + dcmd.setChecksum(sourceChecksum); // We need to set the checksum as the source template might be a compressed url and have cksum for compressed image. Bug #10775 HostVO ssAhost = _agentMgr.getSSAgent(destServer); if( ssAhost == null ) { s_logger.warn("There is no secondary storage VM for secondary storage host " + destServer.getName());