mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fix NPE on scale VM operation after the corresponding template is deleted (#5721)
This commit is contained in:
parent
2df82d8188
commit
895f282d9a
@ -3808,7 +3808,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
||||
if (currentServiceOffering.isDynamic() && !newServiceOffering.isDynamic()) {
|
||||
removeCustomOfferingDetails(vmId);
|
||||
}
|
||||
VMTemplateVO template = _templateDao.findById(vmForUpdate.getTemplateId());
|
||||
VMTemplateVO template = _templateDao.findByIdIncludingRemoved(vmForUpdate.getTemplateId());
|
||||
boolean dynamicScalingEnabled = _userVmMgr.checkIfDynamicScalingCanBeEnabled(vmForUpdate, newServiceOffering, template, vmForUpdate.getDataCenterId());
|
||||
vmForUpdate.setDynamicallyScalable(dynamicScalingEnabled);
|
||||
return _vmDao.update(vmId, vmForUpdate);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user