diff --git a/server/src/com/cloud/agent/manager/AgentManagerImpl.java b/server/src/com/cloud/agent/manager/AgentManagerImpl.java index 96665caa156..30bd67f41af 100755 --- a/server/src/com/cloud/agent/manager/AgentManagerImpl.java +++ b/server/src/com/cloud/agent/manager/AgentManagerImpl.java @@ -1785,10 +1785,9 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, ResourceS } else { guid = cluster.getGuid(); } - if (guid == null || guid.isEmpty()) { - throw new CloudRuntimeException("Can not find guid for cluster " + cluster.getId() + " name " + cluster.getName()); + if (guid != null && !guid.isEmpty()) { + params.put("pool", guid); } - params.put("pool", guid); } params.put("ipaddress", host.getPrivateIpAddress()); diff --git a/server/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java b/server/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java index 35f2f2851ce..67ad5b1cd25 100644 --- a/server/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java +++ b/server/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java @@ -127,26 +127,29 @@ public class ClusteredAgentManagerImpl extends AgentManagerImpl implements Clust } } } - if(hosts != null && hosts.size() > 0) { - for(HostVO host: hosts) { - AgentAttache agentattache = findAttache(host.getId()); - if(agentattache != null) { - // already loaded, skip - if(agentattache.forForward()) { - if(s_logger.isInfoEnabled()) { - s_logger.info(host + " is detected down, but we have a forward attache running, disconnect this one before launching the host"); + if (hosts != null && hosts.size() > 0) { + for (HostVO host : hosts) { + try { + AgentAttache agentattache = findAttache(host.getId()); + if (agentattache != null) { + // already loaded, skip + if (agentattache.forForward()) { + if (s_logger.isInfoEnabled()) { + s_logger.info(host + " is detected down, but we have a forward attache running, disconnect this one before launching the host"); + } + removeAgent(agentattache, Status.Disconnected); + } else { + continue; } - removeAgent(agentattache, Status.Disconnected); - } else { - continue; } - } - if (s_logger.isDebugEnabled()) { - s_logger.debug("Loading directly connected host " + host.getId() + "(" + host.getName() + ")"); + if (s_logger.isDebugEnabled()) { + s_logger.debug("Loading directly connected host " + host.getId() + "(" + host.getName() + ")"); + } + loadDirectlyConnectedHost(host); + } catch (Throwable e) { + s_logger.debug(" can not load directly connected host " + host.getId() + "(" + host.getName() + ") due to " + e.toString()); } - - loadDirectlyConnectedHost(host); } }