CLOUDSTACK-4455:object_store - Template sync results in private

templates being synced to all the secondary stores.
This commit is contained in:
Min Chen 2013-08-22 15:37:37 -07:00
parent 2611ac75c1
commit 0fdaef8e3d

View File

@ -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 "