mirror of https://github.com/apache/cloudstack.git
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 line = null;
|
||||||
String uniqName = null;
|
String uniqName = null;
|
||||||
Long size = null;
|
Long size = null;
|
||||||
|
Long physicalSize = null;
|
||||||
String name = null;
|
String name = null;
|
||||||
while ((line = brf.readLine()) != null) {
|
while ((line = brf.readLine()) != null) {
|
||||||
if (line.startsWith("uniquename=")) {
|
if (line.startsWith("uniquename=")) {
|
||||||
uniqName = line.split("=")[1];
|
uniqName = line.split("=")[1];
|
||||||
} else if (line.startsWith("size=")) {
|
} else if (line.startsWith("size=")) {
|
||||||
|
physicalSize = Long.parseLong(line.split("=")[1]);
|
||||||
|
} else if (line.startsWith("virtualsize=")){
|
||||||
size = Long.parseLong(line.split("=")[1]);
|
size = Long.parseLong(line.split("=")[1]);
|
||||||
} else if (line.startsWith("filename=")) {
|
} else if (line.startsWith("filename=")) {
|
||||||
name = line.split("=")[1];
|
name = line.split("=")[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//fallback
|
||||||
|
if (size == null) {
|
||||||
|
size = physicalSize;
|
||||||
|
}
|
||||||
|
|
||||||
tempFile.delete();
|
tempFile.delete();
|
||||||
if (uniqName != null) {
|
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);
|
tmpltInfos.put(uniqName, prop);
|
||||||
}
|
}
|
||||||
} catch (IOException ex)
|
} catch (IOException ex)
|
||||||
|
|
@ -1615,7 +1624,6 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return tmpltInfos;
|
return tmpltInfos;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, TemplateProp> s3ListTemplate(S3TO s3) {
|
Map<String, TemplateProp> s3ListTemplate(S3TO s3) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue