mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 18:43:26 +01:00
Prevent NPE when removing NIC from a stopped VM using service offering with CPU cap set
This commit is contained in:
parent
4348386970
commit
864071f50b
@ -132,7 +132,8 @@ public class KVMGuru extends HypervisorGuruBase implements HypervisorGuru {
|
|||||||
VirtualMachine vm = vmProfile.getVirtualMachine();
|
VirtualMachine vm = vmProfile.getVirtualMachine();
|
||||||
HostVO host = hostDao.findById(vm.getHostId());
|
HostVO host = hostDao.findById(vm.getHostId());
|
||||||
if (host == null) {
|
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);
|
logger.debug("Limiting CPU usage for VM: {} on host: {}", vm, host);
|
||||||
double hostMaxSpeed = getHostCPUSpeed(host);
|
double hostMaxSpeed = getHostCPUSpeed(host);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user