Examples of PingRoutingCommand


Examples of com.cloud.agent.api.PingRoutingCommand

    @Override
    public PingCommand getCurrentStatus(long id) {
        final HashMap<String, State> newStates = sync();

        if (!_can_bridge_firewall) {
            return new PingRoutingCommand(com.cloud.host.Host.Type.Routing, id,
                    newStates);
        } else {
            HashMap<String, Pair<Long, Long>> nwGrpStates = syncNetworkGroups(id);
            return new PingRoutingWithNwGroupsCommand(getType(), id, newStates,
                    nwGrpStates);
View Full Code Here

Examples of com.cloud.agent.api.PingRoutingCommand

                    return null;
                }
            }
            Connection conn = getConnection();
            if (!_canBridgeFirewall && !_isOvs) {
                return new PingRoutingCommand(getType(), id, null, getHostVmStateReport(conn));
            } else if (_isOvs) {
                List<Pair<String, Long>> ovsStates = ovsFullSyncStates();
                return new PingRoutingWithOvsCommand(getType(), id, null, getHostVmStateReport(conn), ovsStates);
            } else {
                HashMap<String, Pair<Long, Long>> nwGrpStates = syncNetworkGroups(conn, id);
View Full Code Here

Examples of com.cloud.agent.api.PingRoutingCommand

    @Override
    public PingCommand getCurrentStatus(long id) {
        try {
            OvmHost.ping(_conn);
            HashMap<String, State> newStates = sync();
            return new PingRoutingCommand(getType(), id, newStates, getHostVmStateReport());
        } catch (XmlRpcException e) {
            s_logger.debug("Check agent status failed", e);
            return null;
        }
    }
View Full Code Here

Examples of com.cloud.agent.api.PingRoutingCommand

            }
        } catch (Exception e) {
            s_logger.error("Unexpected exception", e);
            return null;
        }
        return new PingRoutingCommand(getType(), id, newStates, syncHostVmStates());
    }
View Full Code Here

Examples of com.cloud.agent.api.PingRoutingCommand

    @Override
    public PingCommand getCurrentStatus(long id) {
        final HashMap<String, State> newStates = sync();

        if (!_canBridgeFirewall) {
            return new PingRoutingCommand(com.cloud.host.Host.Type.Routing, id, newStates, this.getHostVmStateReport());
        } else {
            HashMap<String, Pair<Long, Long>> nwGrpStates = syncNetworkGroups(id);
            return new PingRoutingWithNwGroupsCommand(getType(), id, newStates, this.getHostVmStateReport(), nwGrpStates);
        }
    }
View Full Code Here

Examples of com.cloud.agent.api.PingRoutingCommand

  @Override
  public PingCommand getCurrentStatus(long id) {
    try {
      OvmHost.ping(_conn);
      HashMap<String, State> newStates = sync();
      return new PingRoutingCommand(getType(), id, newStates);
    } catch (XmlRpcException e) {
      s_logger.debug("Check agent status failed", e);
      return null;
    }
  }
View Full Code Here

Examples of com.cloud.agent.api.PingRoutingCommand

            final long hostId = attache.getId();

            if (s_logger.isDebugEnabled()) {
                if (cmd instanceof PingRoutingCommand) {
                    final PingRoutingCommand ping = (PingRoutingCommand) cmd;
                    if (ping.getNewStates().size() > 0) {
                        s_logger.debug("SeqA " + hostId + "-" + request.getSequence() + ": Processing " + request);
                    } else {
                        logD = false;
                        s_logger.debug("Ping from " + hostId);
                        s_logger.trace("SeqA " + hostId + "-" + request.getSequence() + ": Processing " + request);
View Full Code Here

Examples of com.cloud.agent.api.PingRoutingCommand

    @Override
    public boolean processCommands(long agentId, long seq, Command[] cmds) {
        boolean processed = false;
        for (Command cmd : cmds) {
            if (cmd instanceof PingRoutingCommand) {
                PingRoutingCommand ping = (PingRoutingCommand)cmd;
                if (ping.getNewStates() != null && ping.getNewStates().size() > 0) {
                    if (!VmJobEnabled.value()) {
                        Commands commands = deltaHostSync(agentId, ping.getNewStates());
                        if (commands.size() > 0) {
                            try {
                                _agentMgr.send(agentId, commands, this);
                            } catch (final AgentUnavailableException e) {
                                s_logger.warn("Agent is now unavailable", e);
                            }
                        }
                    }
                }
                if(VmJobEnabled.value()) {
                    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
View Full Code Here

Examples of com.cloud.agent.api.PingRoutingCommand

        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, State>(), new HashMap<String, HostVmStateReportEntry>());
        }
    }
View Full Code Here

Examples of com.cloud.agent.api.PingRoutingCommand

        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, State>(), new HashMap<String, HostVmStateReportEntry>());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.