Skip to content

Commit f5e665c

Browse files
authored
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>
1 parent 21b0b0f commit f5e665c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2232,7 +2232,7 @@ private void loadVmDetailsInMapForExternalDhcpIp() {
22322232
VMInstanceVO vmInstance = _vmInstanceDao.findById(vmId);
22332233

22342234
// only load running vms. For stopped vms get loaded on starting
2235-
if (vmInstance.getState() == State.Running) {
2235+
if (vmInstance != null && vmInstance.getState() == State.Running) {
22362236
VmAndCountDetails vmAndCount = new VmAndCountDetails(vmId, VmIpFetchTrialMax.value());
22372237
vmIdCountMap.put(nicId, vmAndCount);
22382238
}

0 commit comments

Comments
 (0)