Revert "Fix NPE on scale VM operation after the corresponding template is deleted (#5721)"

This reverts commit 895f282d9a.
This commit is contained in:
sureshanaparti 2021-12-01 11:06:40 +05:30 committed by GitHub
parent 895f282d9a
commit 24726864ec
1 changed files with 1 additions and 1 deletions

View File

@ -3808,7 +3808,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
if (currentServiceOffering.isDynamic() && !newServiceOffering.isDynamic()) {
removeCustomOfferingDetails(vmId);
}
VMTemplateVO template = _templateDao.findByIdIncludingRemoved(vmForUpdate.getTemplateId());
VMTemplateVO template = _templateDao.findById(vmForUpdate.getTemplateId());
boolean dynamicScalingEnabled = _userVmMgr.checkIfDynamicScalingCanBeEnabled(vmForUpdate, newServiceOffering, template, vmForUpdate.getDataCenterId());
vmForUpdate.setDynamicallyScalable(dynamicScalingEnabled);
return _vmDao.update(vmId, vmForUpdate);