mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge remote-tracking branch 'origin/4.16'
This commit is contained in:
commit
bf3d1338e0
@ -246,7 +246,17 @@ public class OVAProcessor extends AdapterBase implements Processor {
|
|||||||
NodeList diskElements = new OVFHelper().getElementsByTagNameAndPrefix(ovfDoc, "Disk", "ovf");
|
NodeList diskElements = new OVFHelper().getElementsByTagNameAndPrefix(ovfDoc, "Disk", "ovf");
|
||||||
for (int i = 0; i < diskElements.getLength(); i++) {
|
for (int i = 0; i < diskElements.getLength(); i++) {
|
||||||
Element disk = (Element)diskElements.item(i);
|
Element disk = (Element)diskElements.item(i);
|
||||||
long diskSize = Long.parseLong(disk.getAttribute("ovf:capacity"));
|
String diskSizeValue = disk.getAttribute("ovf:capacity");
|
||||||
|
long diskSize = 1;
|
||||||
|
try {
|
||||||
|
diskSize = Long.parseLong(diskSizeValue);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
// ASSUMEably the diskSize contains a property for replacement
|
||||||
|
LOGGER.warn(String.format("the disksize for disk %s is not a valid number: %s", disk.getAttribute("diskId"), diskSizeValue));
|
||||||
|
// TODO parse the property to get any value can not be done at registration time
|
||||||
|
// and will have to be done at deploytime, so for orchestration purposes
|
||||||
|
// we now assume, a value of one
|
||||||
|
}
|
||||||
String allocationUnits = disk.getAttribute("ovf:capacityAllocationUnits");
|
String allocationUnits = disk.getAttribute("ovf:capacityAllocationUnits");
|
||||||
diskSize = OVFHelper.getDiskVirtualSize(diskSize, allocationUnits, ovfFileName);
|
diskSize = OVFHelper.getDiskVirtualSize(diskSize, allocationUnits, ovfFileName);
|
||||||
virtualSize += diskSize;
|
virtualSize += diskSize;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user