Skip to content

Commit 0fdaef8

Browse files
committed
CLOUDSTACK-4455:object_store - Template sync results in private
templates being synced to all the secondary stores.
1 parent 2611ac7 commit 0fdaef8

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
import com.cloud.hypervisor.Hypervisor.HypervisorType;
7575
import com.cloud.storage.DataStoreRole;
7676
import com.cloud.storage.StoragePool;
77+
import com.cloud.storage.Storage.TemplateType;
7778
import com.cloud.storage.VMTemplateStorageResourceAssoc.Status;
7879
import com.cloud.storage.VMTemplateVO;
7980
import com.cloud.storage.VMTemplateZoneVO;
@@ -405,6 +406,11 @@ public void handleTemplateSync(DataStore store) {
405406
s_logger.info("Skip downloading template " + tmplt.getUniqueName() + " since no url is specified.");
406407
continue;
407408
}
409+
// if this is private template, skip sync to a new image store
410+
if (!tmplt.isPublicTemplate() && !tmplt.isFeatured() && tmplt.getTemplateType() != TemplateType.SYSTEM) {
411+
s_logger.info("Skip sync downloading private template " + tmplt.getUniqueName() + " to a new image store");
412+
continue;
413+
}
408414

409415
if (availHypers.contains(tmplt.getHypervisorType())) {
410416
s_logger.info("Downloading template " + tmplt.getUniqueName() + " to image store "

0 commit comments

Comments
 (0)