CLOUDSTACK-5894: A template created from a volume on hyper-v became unusable after

the management server was restarted. The template.properties file created for the
template has the format field in upper-case. This caused the template service to
not to recognise the format and it removed the entry from the template_store_ref
table in db. Fixed the format field in the templatee.properties.
This commit is contained in:
Devdeep Singh 2014-01-18 00:50:22 +05:30
parent c8f6ec043d
commit e9e5b84747
1 changed files with 6 additions and 1 deletions

View File

@ -1590,6 +1590,11 @@ namespace HypervResource
string templatePropFile = Path.Combine(path, "template.properties");
using (StreamWriter sw = new StreamWriter(File.Open(templatePropFile, FileMode.Create), Encoding.GetEncoding("iso-8859-1")))
{
if (format != null)
{
format = format.ToLower();
}
sw.NewLine = "\n";
sw.WriteLine("id=" + templateId);
sw.WriteLine("filename=" + templateUuid + "." + format);
@ -1599,7 +1604,7 @@ namespace HypervResource
sw.WriteLine("virtualsize=" + virtualSize);
sw.WriteLine(format + ".virtualsize=" + virtualSize);
sw.WriteLine("size=" + physicalSize);
sw.WriteLine("vhd.size=" + physicalSize);
sw.WriteLine(format + ".size=" + physicalSize);
sw.WriteLine("public=false");
}
}