mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-7898: Add properties file in same folder as template
This commit is contained in:
parent
9809164654
commit
8b7c1d7c5e
@ -904,10 +904,29 @@ public class Xenserver625StorageProcessor extends XenServerStorageProcessor {
|
||||
}
|
||||
|
||||
destVdi = VDI.getByUuid(conn, destVdiUuid);
|
||||
String templatePath = destDir + "/" + destVdiUuid + ".vhd";
|
||||
templatePath = templatePath.replaceAll("//","/");
|
||||
|
||||
// scan makes XenServer pick up VDI physicalSize
|
||||
destSr.scan(conn);
|
||||
|
||||
String templateUuid = destVdi.getUuid(conn);
|
||||
String templateFilename = templateUuid + ".vhd";
|
||||
long virtualSize = destVdi.getVirtualSize(conn);
|
||||
long physicalSize = destVdi.getPhysicalUtilisation(conn);
|
||||
|
||||
String templatePath = destNfsPath + "/" + destDir;
|
||||
|
||||
templatePath = templatePath.replaceAll("//", "/");
|
||||
|
||||
result = hypervisorResource.postCreatePrivateTemplate(conn, templatePath, templateFilename, templateUuid, nameLabel, null,
|
||||
physicalSize, virtualSize, destObj.getId());
|
||||
|
||||
if (!result) {
|
||||
throw new CloudRuntimeException("Could not create the template.properties file on secondary storage dir");
|
||||
}
|
||||
|
||||
TemplateObjectTO newTemplate = new TemplateObjectTO();
|
||||
newTemplate.setPath(templatePath);
|
||||
|
||||
newTemplate.setPath(destDir + "/" + templateFilename);
|
||||
newTemplate.setFormat(Storage.ImageFormat.VHD);
|
||||
newTemplate.setSize(destVdi.getVirtualSize(conn));
|
||||
newTemplate.setPhysicalSize(destVdi.getPhysicalUtilisation(conn));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user