mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
server: NPE may cause management server to not start (#5001)
This NPE may happen when a VM is marked removed in the DB but not its nics on a shared network. This can usually happen due to a failed expunged VM or when an admin manually marks a VM as removed in DB but does not cleanup the nics/network resources. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
21b0b0f84e
commit
f5e665cd63
@ -2232,7 +2232,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
|
|||||||
VMInstanceVO vmInstance = _vmInstanceDao.findById(vmId);
|
VMInstanceVO vmInstance = _vmInstanceDao.findById(vmId);
|
||||||
|
|
||||||
// only load running vms. For stopped vms get loaded on starting
|
// only load running vms. For stopped vms get loaded on starting
|
||||||
if (vmInstance.getState() == State.Running) {
|
if (vmInstance != null && vmInstance.getState() == State.Running) {
|
||||||
VmAndCountDetails vmAndCount = new VmAndCountDetails(vmId, VmIpFetchTrialMax.value());
|
VmAndCountDetails vmAndCount = new VmAndCountDetails(vmId, VmIpFetchTrialMax.value());
|
||||||
vmIdCountMap.put(nicId, vmAndCount);
|
vmIdCountMap.put(nicId, vmAndCount);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user