mirror of https://github.com/apache/cloudstack.git
tell agent to reconnect to mgt server, if cancelmaintainance cmd is called
This commit is contained in:
parent
86b51dedcf
commit
d9287f0e43
|
|
@ -483,8 +483,13 @@ public class Agent implements HandlerFactory, IAgentControl {
|
|||
answer = new Answer(cmd, true, null);
|
||||
} else if (cmd instanceof MaintainCommand) {
|
||||
s_logger.debug("Received maintainCommand" );
|
||||
cancelTasks();
|
||||
_reconnectAllowed = false;
|
||||
MaintainCommand maintainCmd = (MaintainCommand)cmd;
|
||||
if (maintainCmd.getMaintain()) {
|
||||
cancelTasks();
|
||||
_reconnectAllowed = false;
|
||||
} else {
|
||||
_reconnectAllowed = true;
|
||||
}
|
||||
answer = new MaintainAnswer((MaintainCommand)cmd);
|
||||
} else if (cmd instanceof ReadyCommand) {
|
||||
ReadyCommand ready = (ReadyCommand)cmd;
|
||||
|
|
|
|||
|
|
@ -18,8 +18,17 @@
|
|||
package com.cloud.agent.api;
|
||||
|
||||
public class MaintainCommand extends Command {
|
||||
|
||||
private boolean _maintain;
|
||||
public MaintainCommand() {
|
||||
_maintain = true;
|
||||
}
|
||||
|
||||
public void setMaintain(boolean maintain) {
|
||||
_maintain = maintain;
|
||||
}
|
||||
|
||||
public boolean getMaintain() {
|
||||
return _maintain;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1570,6 +1570,12 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, Manager {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (host.getHypervisorType() == HypervisorType.KVM) {
|
||||
MaintainCommand cmd = new MaintainCommand();
|
||||
cmd.setMaintain(false);
|
||||
easySend(hostId, cmd);
|
||||
}
|
||||
disconnect(hostId, Event.ResetRequested, false);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue