mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-7404: Failed to start an instance when originating template has been deleted
Signed-off-by: Sebastien Goasguen <runseb@gmail.com>
(cherry picked from commit c1bf7eeeee)
This commit is contained in:
parent
af2f21894c
commit
34e8483e80
|
|
@ -103,7 +103,7 @@ public class VirtualMachineProfileImpl implements VirtualMachineProfile {
|
|||
@Override
|
||||
public VirtualMachineTemplate getTemplate() {
|
||||
if (_template == null && _vm != null) {
|
||||
_template = s_entityMgr.findById(VirtualMachineTemplate.class, _vm.getTemplateId());
|
||||
_template = s_entityMgr.findByIdIncludingRemoved(VirtualMachineTemplate.class, _vm.getTemplateId());
|
||||
}
|
||||
return _template;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -832,7 +832,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
|||
|
||||
VMInstanceVO startedVm = null;
|
||||
ServiceOfferingVO offering = _offeringDao.findById(vm.getId(), vm.getServiceOfferingId());
|
||||
VirtualMachineTemplate template = _entityMgr.findById(VirtualMachineTemplate.class, vm.getTemplateId());
|
||||
VirtualMachineTemplate template = _entityMgr.findByIdIncludingRemoved(VirtualMachineTemplate.class, vm.getTemplateId());
|
||||
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Trying to deploy VM, vm has dcId: " + vm.getDataCenterId() + " and podId: " + vm.getPodIdToDeployIn());
|
||||
|
|
|
|||
Loading…
Reference in New Issue