mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-11-04 00:02:37 +01:00 
			
		
		
		
	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 c1bf7eeeeeb3bd4dad384225d411e21859cce470)
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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user