mirror of https://github.com/apache/cloudstack.git
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:
parent
c8f6ec043d
commit
e9e5b84747
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue