mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Only download eligible system template for S3 image store.
This commit is contained in:
parent
12583bbffc
commit
87af4ddab0
@ -185,7 +185,22 @@ public class TemplateServiceImpl implements TemplateService {
|
||||
toBeDownloaded.add(rtngTmplt);
|
||||
}
|
||||
|
||||
List<HypervisorType> availHypers = _clusterDao.getAvailableHypervisorInZone(store.getScope().getScopeId());
|
||||
if (availHypers.isEmpty()) {
|
||||
/*
|
||||
* This is for cloudzone, local secondary storage resource
|
||||
* started before cluster created
|
||||
*/
|
||||
availHypers.add(HypervisorType.KVM);
|
||||
}
|
||||
/* Baremetal need not to download any template */
|
||||
availHypers.remove(HypervisorType.BareMetal);
|
||||
availHypers.add(HypervisorType.None); // bug 9809: resume ISO
|
||||
// download.
|
||||
|
||||
for (VMTemplateVO template : toBeDownloaded) {
|
||||
if (availHypers.contains(template.getHypervisorType())) {
|
||||
// only download sys template applicable for current hypervisor
|
||||
TemplateDataStoreVO tmpltHost = _vmTemplateStoreDao.findByStoreTemplate(store.getId(), template.getId());
|
||||
if (tmpltHost == null || tmpltHost.getState() != ObjectInDataStoreStateMachine.State.Ready) {
|
||||
TemplateInfo tmplt = _templateFactory.getTemplate(template.getId(), DataStoreRole.Image);
|
||||
@ -193,6 +208,7 @@ public class TemplateServiceImpl implements TemplateService {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleSysTemplateDownload(HypervisorType hostHyper, Long dcId) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user