Updated Branches: refs/heads/master c8f6ec043 -> e9e5b8474
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. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e9e5b847 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e9e5b847 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e9e5b847 Branch: refs/heads/master Commit: e9e5b847477780daf6a5ce9cb2eab0eec950229f Parents: c8f6ec0 Author: Devdeep Singh <devd...@gmail.com> Authored: Sat Jan 18 00:50:22 2014 +0530 Committer: Devdeep Singh <devd...@gmail.com> Committed: Fri Jan 17 19:17:17 2014 +0530 ---------------------------------------------------------------------- .../ServerResource/HypervResource/HypervResourceController.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e9e5b847/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs index 94837a2..a1c91a5 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs @@ -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"); } }