From e92af8c72a5aa3c9520b2432a180c3261139e92b Mon Sep 17 00:00:00 2001 From: edison Date: Wed, 1 Sep 2010 11:17:06 -0700 Subject: [PATCH] Fix the bug: Remove host when the host is in disconnected state, then you will fail to add the same host back. --- server/src/com/cloud/agent/manager/AgentManagerImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/agent/manager/AgentManagerImpl.java b/server/src/com/cloud/agent/manager/AgentManagerImpl.java index 3d0ed144903..991f4348452 100755 --- a/server/src/com/cloud/agent/manager/AgentManagerImpl.java +++ b/server/src/com/cloud/agent/manager/AgentManagerImpl.java @@ -548,11 +548,12 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory { _dcDao.releasePrivateIpAddress(host.getPrivateIpAddress(), host.getDataCenterId(), null); AgentAttache attache = _agents.get(hostId); handleDisconnect(attache, Status.Event.Remove, false); - /* + + /*Disconnected agent needs special handling here*/ host.setGuid(null); host.setClusterId(null); _hostDao.update(host.getId(), host); - */ + _hostDao.remove(hostId); //delete the associated primary storage from db