mirror of https://github.com/apache/cloudstack.git
Fix prepare template API incase of Datastore cluster
This commit is contained in:
parent
812d42ebaa
commit
e700ad72e7
|
|
@ -616,6 +616,18 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
|
|||
|
||||
private void prepareTemplateInOneStoragePool(final VMTemplateVO template, final StoragePoolVO pool) {
|
||||
s_logger.info("Schedule to preload template " + template.getId() + " into primary storage " + pool.getId());
|
||||
if (pool.getPoolType() == Storage.StoragePoolType.DatastoreCluster) {
|
||||
List<StoragePoolVO> childDataStores = _poolDao.listChildStoragePoolsInDatastoreCluster(pool.getId());
|
||||
s_logger.debug("Schedule to preload template " + template.getId() + " into child datastores of DataStore cluster: " + pool.getId());
|
||||
for (StoragePoolVO childDataStore : childDataStores) {
|
||||
prepareTemplateInOneStoragePoolInternal(template, childDataStore);
|
||||
}
|
||||
} else {
|
||||
prepareTemplateInOneStoragePoolInternal(template, pool);
|
||||
}
|
||||
}
|
||||
|
||||
private void prepareTemplateInOneStoragePoolInternal(final VMTemplateVO template, final StoragePoolVO pool) {
|
||||
_preloadExecutor.execute(new ManagedContextRunnable() {
|
||||
@Override
|
||||
protected void runInContext() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue