Skip to content

Commit 2bb50aa

Browse files
committed
Set volume size to the virtual size instead of physical
1 parent dbfec8c commit 2bb50aa

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -934,9 +934,9 @@ protected Answer copyFromNfsToS3(CopyCommand cmd) {
934934
/**
935935
* Creates a template.properties for Swift with its correct unique name
936936
*
937-
* @param swift
938-
* @param srcFile
939-
* @param containerName
937+
* @param swift The swift object
938+
* @param srcFile Source file on the staging NFS
939+
* @param containerName Destination container
940940
* @return true on successful write
941941
*/
942942
protected boolean swiftUploadMetadataFile(SwiftTO swift, File srcFile, String containerName) throws IOException {
@@ -1002,7 +1002,7 @@ protected Answer copyFromNfsToSwift(CopyCommand cmd) {
10021002
} else if (destData.getObjectType() == DataObjectType.VOLUME) {
10031003
VolumeObjectTO newVol = new VolumeObjectTO();
10041004
newVol.setPath(containerName);
1005-
newVol.setSize(srcFile.length());
1005+
newVol.setSize(getVirtualSize(srcFile, getTemplateFormat(srcFile.getName())));
10061006
retObj = newVol;
10071007
} else if (destData.getObjectType() == DataObjectType.SNAPSHOT) {
10081008
SnapshotObjectTO newSnapshot = new SnapshotObjectTO();

0 commit comments

Comments
 (0)