Skip to content

Commit f6f33c6

Browse files
authored
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
1 parent 255a45c commit f6f33c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/storage/volume/storpool/src/main/java/org/apache/cloudstack/storage/datastore/driver/StorPoolPrimaryDataStoreDriver.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,8 @@ public void copyAsync(DataObject srcData, DataObject dstData, AsyncCompletionCal
776776

777777
if (answer != null && answer.getResult()) {
778778
// successfully downloaded template to primary storage
779-
answer = createVolumeSnapshot(cmd, size, conn, volName, dstTO);
779+
TemplateObjectTO templ = (TemplateObjectTO) ((CopyCmdAnswer) answer).getNewData();
780+
answer = createVolumeSnapshot(cmd, size, conn, volName, templ);
780781
} else {
781782
err = answer != null ? answer.getDetails() : "Unknown error while downloading template. Null answer returned.";
782783
}
@@ -983,7 +984,6 @@ private Answer createVolumeSnapshot(StorageSubSystemCommand cmd, Long size, SpCo
983984
} else {
984985
dstTO.setPath(StorPoolUtil.devPath(
985986
StorPoolUtil.getSnapshotNameFromResponse(resp, false, StorPoolUtil.GLOBAL_ID)));
986-
dstTO.setSize(size);
987987
answer = new CopyCmdAnswer(dstTO);
988988
}
989989
return answer;

0 commit comments

Comments
 (0)