This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/master by this push:
     new 6dad46b  server: sync templates on adding new secondary storage (#3302)
6dad46b is described below

commit 6dad46b7ed2ee25855dcd33a19729053df8cd1de
Author: Abhishek Kumar <[email protected]>
AuthorDate: Mon Apr 29 23:37:15 2019 +0530

    server: sync templates on adding new secondary storage (#3302)
    
    Fixes #2689
    
    With the current code, existing templates were not downloaded to the new 
secondary storage when it is added. SSVM needed to be restarted to start the 
download process. This PR starts templates sync for the new secondary storage 
when it is added.
    
    Signed-off-by: Abhishek Kumar <[email protected]>
---
 server/src/main/java/com/cloud/storage/StorageManagerImpl.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/src/main/java/com/cloud/storage/StorageManagerImpl.java 
b/server/src/main/java/com/cloud/storage/StorageManagerImpl.java
index 40ecb84..ae7df65 100644
--- a/server/src/main/java/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/main/java/com/cloud/storage/StorageManagerImpl.java
@@ -80,6 +80,7 @@ import org.apache.cloudstack.framework.config.ConfigKey;
 import org.apache.cloudstack.framework.config.Configurable;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.managed.context.ManagedContextRunnable;
+import org.apache.cloudstack.management.ManagementServerHost;
 import org.apache.cloudstack.storage.command.DettachCommand;
 import org.apache.cloudstack.storage.datastore.db.ImageStoreDao;
 import org.apache.cloudstack.storage.datastore.db.ImageStoreDetailsDao;
@@ -115,7 +116,6 @@ import com.cloud.capacity.CapacityState;
 import com.cloud.capacity.CapacityVO;
 import com.cloud.capacity.dao.CapacityDao;
 import com.cloud.cluster.ClusterManagerListener;
-import org.apache.cloudstack.management.ManagementServerHost;
 import com.cloud.configuration.Config;
 import com.cloud.configuration.ConfigurationManager;
 import com.cloud.configuration.ConfigurationManagerImpl;
@@ -2096,6 +2096,7 @@ public class StorageManagerImpl extends ManagerBase 
implements StorageManager, C
         } else {
             // populate template_store_ref table
             _imageSrv.addSystemVMTemplatesToSecondary(store);
+            _imageSrv.handleTemplateSync(store);
         }
 
         // associate builtin template with zones associated with this image 
store

Reply via email to