mirror of https://github.com/apache/cloudstack.git
fix system vm template download issue
This commit is contained in:
parent
de3f12901e
commit
882919ae40
|
|
@ -92,6 +92,8 @@ public class DownloadMonitorImpl implements DownloadMonitor {
|
|||
@Inject
|
||||
VMTemplatePoolDao _vmTemplatePoolDao;
|
||||
@Inject
|
||||
VMTemplateZoneDao _vmTemplateZoneDao;
|
||||
@Inject
|
||||
StoragePoolHostDao _poolHostDao;
|
||||
@Inject
|
||||
SecondaryStorageVmDao _secStorageVmDao;
|
||||
|
|
@ -430,6 +432,9 @@ public class DownloadMonitorImpl implements DownloadMonitor {
|
|||
for (VMTemplateVO template: toBeDownloaded) {
|
||||
VMTemplateHostVO tmpltHost = _vmTemplateHostDao.findByHostTemplate(sshost.getId(), template.getId());
|
||||
if (tmpltHost == null || tmpltHost.getDownloadState() != Status.DOWNLOADED) {
|
||||
if (_vmTemplateZoneDao.findByZoneTemplate(sshost.getDataCenterId(), template.getId()) == null) {
|
||||
_templateDao.addTemplateToZone(template, sshost.getDataCenterId());
|
||||
}
|
||||
downloadTemplateToStorage(template, sshost);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue