bug 7293: return complete installpath for createprivatetemplatefromvolume

status 7293: resolved fixed
This commit is contained in:
Anthony Xu 2010-11-23 16:15:26 -08:00 committed by anthony
parent 3d4b8ab4a0
commit 7518488672
2 changed files with 5 additions and 3 deletions

View File

@ -5478,6 +5478,7 @@ public abstract class CitrixResourceBase implements StoragePoolResource, ServerR
if (!result) {
throw new CloudRuntimeException("Could not create the template.properties file on secondary storage dir: " + tmpltURI);
}
installPath = installPath + "/" + tmpltFilename;
return new CreatePrivateTemplateAnswer(cmd, true, null, installPath, virtualSize, tmpltUUID, ImageFormat.VHD);
} catch (XenAPIException e) {
details = "Creating template from volume " + volumeUUID + " failed due to " + e.getMessage();

View File

@ -126,17 +126,18 @@ def post_create_private_template(session, args):
template_properties_install_path = local_mount_path + "/template.properties"
f = open(template_properties_install_path, "w")
f.write("filename=" + filename + "\n")
f.write("name=" + filename + "\n")
f.write("vhd=true\n")
f.write("id=" + template_id + "\n")
f.write("vhd.filename=" + filename + "\n")
f.write("public=false\n")
f.write("uniquename=" + name + "\n")
f.write("vhd.virtualsize=" + virtual_size + "\n")
f.write("vhd.size=" + str(file_size) + "\n")
f.write("virtualsize=" + virtual_size + "\n")
f.write("checksum=" + checksum + "\n")
f.write("hvm=true\n")
f.write("description=" + name + "\n")
f.write("description=" + description + "\n")
f.write("vhd.size=" + str(file_size) + "\n")
f.write("size=" + str(file_size) + "\n")
f.close()
util.SMlog("Created template.properties file")