Examples of PingRoutingCommand


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

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

Examples of com.cloud.agent.api.PingRoutingCommand

    } catch (Exception e) {
      s_logger.debug("Cannot ping ipmi nic " + _ip, e);
      return null;
    }

    return new PingRoutingCommand(getType(), id, deltaSync());
  }
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>());
    }
  }
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 && ping.getHostVmStateReport().size() > 0) {
                        _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

    @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, 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

      HashMap<String, State> newStates = sync();
      if (newStates == null) {
        return null;
      }
      return new PingRoutingCommand(getType(), id, newStates,
          syncHostVmStates());
    } finally {
      recycleServiceContext();
    }
  }
View Full Code Here

Examples of com.cloud.agent.api.PingRoutingCommand

  }

  @Override
  public PingCommand getCurrentStatus(long id) {
        HashMap<String, VirtualMachine.State> newStates = new HashMap<String, VirtualMachine.State>();
        return new PingRoutingCommand(com.cloud.host.Host.Type.Routing, id, newStates);
  }
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

                    return null;
                }
            }
            Connection conn = getConnection();
            if (!_canBridgeFirewall && !_isOvs) {
              return new PingRoutingCommand(getType(), id, null);
            } else if (_isOvs) {
                List<Pair<String, Long>>ovsStates = ovsFullSyncStates();
                return new PingRoutingWithOvsCommand(getType(), id, null, ovsStates);
            }else {
                HashMap<String, Pair<Long, Long>> nwGrpStates = syncNetworkGroups(conn, id);
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.