mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
server: fix VM with ISO attached migration issue (#3935)
As previously described by PR #3929: If vm has attached ISO, the migration fails with error message "org.libvirt.LibvirtException: Cannot access storage file /mnt/b33e5a1d-e4ea-3465-b6ac-c98dc8ff8af0/207-2-cc5fd717-2d57-3bb3-bcf6-2c930268db6c.iso"
This commit is contained in:
parent
4be70014bb
commit
bd7d41bf6d
@ -68,7 +68,7 @@ public class TemplateDataFactoryImpl implements TemplateDataFactory {
|
||||
@Override
|
||||
public TemplateInfo getTemplate(long templateId, DataStore store) {
|
||||
VMTemplateVO templ = imageDataDao.findById(templateId);
|
||||
if (store == null) {
|
||||
if (store == null && !templ.isDirectDownload()) {
|
||||
TemplateObject tmpl = TemplateObject.getTemplate(templ, null);
|
||||
return tmpl;
|
||||
}
|
||||
|
||||
@ -584,10 +584,8 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
|
||||
}
|
||||
poolId = storagePool.getId();
|
||||
}
|
||||
template = prepareIso(vm.getIsoId(), vm.getDataCenterId(), dest.getHost().getId(), poolId);
|
||||
} else {
|
||||
template = _tmplFactory.getTemplate(vm.getIsoId(), DataStoreRole.Primary, dest.getDataCenter().getId());
|
||||
}
|
||||
template = prepareIso(vm.getIsoId(), vm.getDataCenterId(), dest.getHost().getId(), poolId);
|
||||
|
||||
if (template == null){
|
||||
s_logger.error("Failed to prepare ISO on secondary or cache storage");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user