From 0fdaef8e3d7f3554b490d239b51cec384de6538c Mon Sep 17 00:00:00 2001 From: Min Chen Date: Thu, 22 Aug 2013 15:37:37 -0700 Subject: [PATCH] CLOUDSTACK-4455:object_store - Template sync results in private templates being synced to all the secondary stores. --- .../cloudstack/storage/image/TemplateServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java index bdb195d3d30..ab1f2861000 100644 --- a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java +++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java @@ -74,6 +74,7 @@ import com.cloud.exception.ResourceAllocationException; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.storage.DataStoreRole; import com.cloud.storage.StoragePool; +import com.cloud.storage.Storage.TemplateType; import com.cloud.storage.VMTemplateStorageResourceAssoc.Status; import com.cloud.storage.VMTemplateVO; import com.cloud.storage.VMTemplateZoneVO; @@ -405,6 +406,11 @@ public class TemplateServiceImpl implements TemplateService { s_logger.info("Skip downloading template " + tmplt.getUniqueName() + " since no url is specified."); continue; } + // if this is private template, skip sync to a new image store + if (!tmplt.isPublicTemplate() && !tmplt.isFeatured() && tmplt.getTemplateType() != TemplateType.SYSTEM) { + s_logger.info("Skip sync downloading private template " + tmplt.getUniqueName() + " to a new image store"); + continue; + } if (availHypers.contains(tmplt.getHypervisorType())) { s_logger.info("Downloading template " + tmplt.getUniqueName() + " to image store "