private Boolean testUserVM(VirtualMachine vm, Nic nic, VirtualRouter router) { String privateIp = nic.getIp4Address(); String routerPrivateIp = router.getPrivateIpAddress(); List<Long> otherHosts = new ArrayList<Long>(); if (vm.getHypervisorType() == HypervisorType.XenServer || vm.getHypervisorType() == HypervisorType.KVM) { otherHosts.add(router.getHostId()); } else { otherHosts = findHostByPod(router.getPodIdToDeployIn(), null); } for (Long hostId : otherHosts) { try { Answer pingTestAnswer = _agentMgr.easySend(hostId, new PingTestCommand(routerPrivateIp, privateIp)); if (pingTestAnswer != null && pingTestAnswer.getResult()) { if (s_logger.isDebugEnabled()) { s_logger.debug( "user vm's " + vm.getHostName() + " ip address " + privateIp + " has been successfully pinged from the Virtual Router " + router.getHostName() + ", returning that vm is alive"); } return Boolean.TRUE; } } catch (Exception e) { if (s_logger.isDebugEnabled()) { s_logger.debug("Couldn't reach due to", e); } continue; } } if (s_logger.isDebugEnabled()) { s_logger.debug(vm + " could not be pinged, returning that it is unknown"); } return null; }