Prevent NPE when removing NIC from a stopped VM using service offering with CPU cap set

This commit is contained in:
Pearl Dsilva 2025-12-10 12:30:35 -05:00
parent 4348386970
commit 864071f50b

View File

@ -132,7 +132,8 @@ public class KVMGuru extends HypervisorGuruBase implements HypervisorGuru {
VirtualMachine vm = vmProfile.getVirtualMachine();
HostVO host = hostDao.findById(vm.getHostId());
if (host == null) {
throw new CloudRuntimeException("Host with id: " + vm.getHostId() + " not found");
logger.warn("Host is not available. Skipping CPU quota calculation for VM: {}", vm);
return;
}
logger.debug("Limiting CPU usage for VM: {} on host: {}", vm, host);
double hostMaxSpeed = getHostCPUSpeed(host);