mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-9628: Use correct virtualsize with Swift as secondary storage
This commit is contained in:
parent
7da95172a4
commit
79f4177212
@ -1585,19 +1585,28 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
||||
String line = null;
|
||||
String uniqName = null;
|
||||
Long size = null;
|
||||
Long physicalSize = null;
|
||||
String name = null;
|
||||
while ((line = brf.readLine()) != null) {
|
||||
if (line.startsWith("uniquename=")) {
|
||||
uniqName = line.split("=")[1];
|
||||
} else if (line.startsWith("size=")) {
|
||||
physicalSize = Long.parseLong(line.split("=")[1]);
|
||||
} else if (line.startsWith("virtualsize=")){
|
||||
size = Long.parseLong(line.split("=")[1]);
|
||||
} else if (line.startsWith("filename=")) {
|
||||
name = line.split("=")[1];
|
||||
}
|
||||
}
|
||||
|
||||
//fallback
|
||||
if (size == null) {
|
||||
size = physicalSize;
|
||||
}
|
||||
|
||||
tempFile.delete();
|
||||
if (uniqName != null) {
|
||||
TemplateProp prop = new TemplateProp(uniqName, container + File.separator + name, size, size, true, false);
|
||||
TemplateProp prop = new TemplateProp(uniqName, container + File.separator + name, size, physicalSize, true, false);
|
||||
tmpltInfos.put(uniqName, prop);
|
||||
}
|
||||
} catch (IOException ex)
|
||||
@ -1615,7 +1624,6 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
||||
}
|
||||
}
|
||||
return tmpltInfos;
|
||||
|
||||
}
|
||||
|
||||
Map<String, TemplateProp> s3ListTemplate(S3TO s3) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user