@Override public PingCommand getCurrentStatus(long id) { return new PingRoutingCommand(com.cloud.host.Host.Type.Routing, id, new HashMap<String, HostVmStateReportEntry>()); }
@Override public boolean processCommands(final long agentId, final long seq, final Command[] cmds) { boolean processed = false; for (final Command cmd : cmds) { if (cmd instanceof PingRoutingCommand) { final PingRoutingCommand ping = (PingRoutingCommand)cmd; if (ping.getHostVmStateReport() != null) { _syncMgr.processHostVmStatePingReport(agentId, ping.getHostVmStateReport()); } // take the chance to scan VMs that are stuck in transitional states // and are missing from the report scanStalledVMInTransitionStateOnUpHost(agentId); processed = true; } } return processed; }
final boolean gatewayAccessible = ((PingRoutingCommand)cmd).isGatewayAccessible(); final HostVO host = _hostDao.findById(Long.valueOf(cmdHostId));
@Override public PingCommand getCurrentStatus(long id) { //TODO: check server return new PingRoutingCommand(getType(), id, new HashMap<String, HostVmStateReportEntry>()); }
@Override public PingCommand getCurrentStatus(long id) { com.trilead.ssh2.Connection sshConnection = SSHCmdHelper.acquireAuthorizedConnection(_ip, _username, _password); if (sshConnection == null) { return null; } else { SSHCmdHelper.releaseSshConnection(sshConnection); return new PingRoutingCommand(getType(), id, new HashMap<String, HostVmStateReportEntry>()); } }
@Override public PingCommand getCurrentStatus(long id) { com.trilead.ssh2.Connection sshConnection = SSHCmdHelper.acquireAuthorizedConnection(_ip, _username, _password); if (sshConnection == null) { return null; } else { SSHCmdHelper.releaseSshConnection(sshConnection); return new PingRoutingCommand(getType(), id, new HashMap<String, HostVmStateReportEntry>()); } }
@Override public PingCommand getCurrentStatus(long id) { com.trilead.ssh2.Connection sshConnection = SSHCmdHelper.acquireAuthorizedConnection(_ip, _username, _password); if (sshConnection == null) { return null; } else { SSHCmdHelper.releaseSshConnection(sshConnection); return new PingRoutingCommand(getType(), id, new HashMap<String, HostVmStateReportEntry>()); } }
@Override public PingCommand getCurrentStatus(long id) { com.trilead.ssh2.Connection sshConnection = SSHCmdHelper.acquireAuthorizedConnection(_ip, _username, _password); if (sshConnection == null) { return null; } else { SSHCmdHelper.releaseSshConnection(sshConnection); return new PingRoutingCommand(getType(), id, new HashMap<String, HostVmStateReportEntry>()); } }
@Override public final PingCommand getCurrentStatus(final long id) { final PingCommand pingCmd = new PingRoutingCommand(getType(), id, getHostVmStateReport()); if (s_logger.isDebugEnabled()) { s_logger.debug("Ping host " + _name + " (IP " + _agentIp + ")"); } final Answer pingAns = executeRequest(pingCmd); if (pingAns == null || !pingAns.getResult()) { s_logger.info("Cannot ping host " + _name + " (IP " + _agentIp + "), pingAns (blank means null) is:" + pingAns); return null; } return pingCmd; }
@Override public PingCommand getCurrentStatus(long id) { try { OvmHost.ping(_conn); return new PingRoutingCommand(getType(), id, getHostVmStateReport()); } catch (XmlRpcException e) { s_logger.debug("Check agent status failed", e); return null; } }
return new PingRoutingCommand(getType(), id, null);
@Override public PingCommand getCurrentStatus(final long id) { if (!_canBridgeFirewall) { return new PingRoutingCommand(com.cloud.host.Host.Type.Routing, id, this.getHostVmStateReport()); } else { final HashMap<String, Pair<Long, Long>> nwGrpStates = syncNetworkGroups(id); return new PingRoutingWithNwGroupsCommand(getType(), id, this.getHostVmStateReport(), nwGrpStates); } }
@Override public PingCommand getCurrentStatus(long id) { try { /* feels useless somehow */ Common test = new Common(c); String ping = "put"; String pong = test.echo(ping); if (pong.contains(ping)) { hypervisorsupport.syncState(); CloudstackPlugin cSp = new CloudstackPlugin(c); if (!cSp.dom0CheckStorageHealthCheck(configuration.getAgentScriptsDir(), configuration.getAgentCheckStorageScript(), configuration.getCsHostGuid(), configuration.getAgentStorageCheckTimeout(), configuration.getAgentStorageCheckInterval()) && !cSp.dom0CheckStorageHealthCheck()) { LOGGER.error("Storage health check not running on " + configuration.getAgentHostname()); } else if (cSp.dom0CheckStorageHealthCheck()) { LOGGER.error("Storage health check started on " + configuration.getAgentHostname()); } else { LOGGER.debug("Storage health check running on " + configuration.getAgentHostname()); } return new PingRoutingCommand(getType(), id, hypervisorsupport.hostVmStateReport()); } else { LOGGER.debug("Agent did not respond correctly: " + ping + " but got " + pong); } } catch (Ovm3ResourceException | NullPointerException e) { LOGGER.debug("Check agent status failed", e); return null; } return null; }
@Override public PingCommand getCurrentStatus(final long id) { try { if (!pingXAPI()) { Thread.sleep(1000); if (!pingXAPI()) { s_logger.warn("can not ping xenserver " + _host.getUuid()); return null; } } final Connection conn = getConnection(); if (!_canBridgeFirewall && !_isOvs) { return new PingRoutingCommand(getType(), id, getHostVmStateReport(conn)); } else if (_isOvs) { final List<Pair<String, Long>> ovsStates = ovsFullSyncStates(); return new PingRoutingWithOvsCommand(getType(), id, getHostVmStateReport(conn), ovsStates); } else { final HashMap<String, Pair<Long, Long>> nwGrpStates = syncNetworkGroups(conn, id); return new PingRoutingWithNwGroupsCommand(getType(), id, getHostVmStateReport(conn), nwGrpStates); } } catch (final Exception e) { s_logger.warn("Unable to get current status", e); return null; } }