From c7a55eb812b6b85e0e9715b95f3049c143ca0d39 Mon Sep 17 00:00:00 2001 From: mrunalinikankariya Date: Thu, 14 Sep 2017 17:54:12 +0530 Subject: [PATCH] CLOUDSTACK-10019: template.properties has hardcoded id (#2243) The template.properties file created after creating template from snapshot has hardcoded id = 1. The id should have template ID. --- .../storage/resource/NfsSecondaryStorageResource.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java b/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java index 4980d97f169..68569ea7f9a 100644 --- a/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java +++ b/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java @@ -463,7 +463,7 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S FormatInfo info = processor.process(destPath, null, templateUuid); TemplateLocation loc = new TemplateLocation(_storage, destPath); - loc.create(1, true, templateUuid); + loc.create(destData.getId(), true, templateUuid); loc.addFormat(info); loc.save(); TemplateProp prop = loc.getTemplateInfo(); @@ -553,7 +553,7 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S FormatInfo info = processor.process(destPath, null, templateName); TemplateLocation loc = new TemplateLocation(_storage, destPath); - loc.create(1, true, destData.getName()); + loc.create(destData.getId(), true, destData.getName()); loc.addFormat(info); loc.save();