mirror of https://github.com/apache/cloudstack.git
Fix the size of a template downloaded from secondary storage (#10662)
Fixing the size of a template that is downloaded from secondary storage to StorPool
This commit is contained in:
parent
255a45c4a6
commit
f6f33c6add
|
|
@ -776,7 +776,8 @@ public class StorPoolPrimaryDataStoreDriver implements PrimaryDataStoreDriver {
|
|||
|
||||
if (answer != null && answer.getResult()) {
|
||||
// successfully downloaded template to primary storage
|
||||
answer = createVolumeSnapshot(cmd, size, conn, volName, dstTO);
|
||||
TemplateObjectTO templ = (TemplateObjectTO) ((CopyCmdAnswer) answer).getNewData();
|
||||
answer = createVolumeSnapshot(cmd, size, conn, volName, templ);
|
||||
} else {
|
||||
err = answer != null ? answer.getDetails() : "Unknown error while downloading template. Null answer returned.";
|
||||
}
|
||||
|
|
@ -983,7 +984,6 @@ public class StorPoolPrimaryDataStoreDriver implements PrimaryDataStoreDriver {
|
|||
} else {
|
||||
dstTO.setPath(StorPoolUtil.devPath(
|
||||
StorPoolUtil.getSnapshotNameFromResponse(resp, false, StorPoolUtil.GLOBAL_ID)));
|
||||
dstTO.setSize(size);
|
||||
answer = new CopyCmdAnswer(dstTO);
|
||||
}
|
||||
return answer;
|
||||
|
|
|
|||
Loading…
Reference in New Issue