Skip to content

Commit 6dad46b

Browse files
shwstppryadvr
authored andcommitted
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 <abhishek.kumar@shapeblue.com>
1 parent d6437d5 commit 6dad46b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

server/src/main/java/com/cloud/storage/StorageManagerImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
import org.apache.cloudstack.framework.config.Configurable;
8181
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
8282
import org.apache.cloudstack.managed.context.ManagedContextRunnable;
83+
import org.apache.cloudstack.management.ManagementServerHost;
8384
import org.apache.cloudstack.storage.command.DettachCommand;
8485
import org.apache.cloudstack.storage.datastore.db.ImageStoreDao;
8586
import org.apache.cloudstack.storage.datastore.db.ImageStoreDetailsDao;
@@ -115,7 +116,6 @@
115116
import com.cloud.capacity.CapacityVO;
116117
import com.cloud.capacity.dao.CapacityDao;
117118
import com.cloud.cluster.ClusterManagerListener;
118-
import org.apache.cloudstack.management.ManagementServerHost;
119119
import com.cloud.configuration.Config;
120120
import com.cloud.configuration.ConfigurationManager;
121121
import com.cloud.configuration.ConfigurationManagerImpl;
@@ -2096,6 +2096,7 @@ public ImageStore discoverImageStore(String name, String url, String providerNam
20962096
} else {
20972097
// populate template_store_ref table
20982098
_imageSrv.addSystemVMTemplatesToSecondary(store);
2099+
_imageSrv.handleTemplateSync(store);
20992100
}
21002101

21012102
// associate builtin template with zones associated with this image store

0 commit comments

Comments
 (0)