mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Prevent vm's from stopping while enabling maintenance mode (#4636)
Sometimes when host isput into maintenance, the connection get disconnected and as result vm's are stopped. So check for extra state before considering host as down and stopping the vm's
This commit is contained in:
parent
5845de4004
commit
aa00ef90c9
@ -875,8 +875,10 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
|
||||
agentStatusTransitTo(host, Status.Event.Ping, _nodeId);
|
||||
return false;
|
||||
} else if (determinedState == Status.Disconnected) {
|
||||
s_logger.warn("Agent is disconnected but the host is still up: " + host.getId() + "-" + host.getName());
|
||||
if (currentStatus == Status.Disconnected) {
|
||||
s_logger.warn("Agent is disconnected but the host is still up: " + host.getId() + "-" + host.getName() +
|
||||
'-' + host.getResourceState());
|
||||
if (currentStatus == Status.Disconnected ||
|
||||
(currentStatus == Status.Up && host.getResourceState() == ResourceState.PrepareForMaintenance)) {
|
||||
if ((System.currentTimeMillis() >> 10) - host.getLastPinged() > AlertWait.value()) {
|
||||
s_logger.warn("Host " + host.getId() + " has been disconnected past the wait time it should be disconnected.");
|
||||
event = Status.Event.WaitedTooLong;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user