This is an automated email from the ASF dual-hosted git repository.
nvazquez pushed a commit to branch 4.13
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.13 by this push:
new 07d64cb [KVM] Agent LB Fix: Connections from disabled KVM host agents
are refused (#3617)
07d64cb is described below
commit 07d64cb65a9917d95dcb9434eae712eb2fc61258
Author: Nicolas Vazquez <[email protected]>
AuthorDate: Wed Dec 4 10:43:17 2019 -0300
[KVM] Agent LB Fix: Connections from disabled KVM host agents are refused
(#3617)
* Remove constraint for just enabled hosts receiving the ms list
* Allow sending SetupMSList command when host is in maintenance
---
.../src/main/java/com/cloud/agent/manager/AgentAttache.java | 3 ++-
.../org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImpl.java | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git
a/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentAttache.java
b/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentAttache.java
index 4f03acd..e96181b 100644
---
a/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentAttache.java
+++
b/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentAttache.java
@@ -33,6 +33,7 @@ import java.util.concurrent.TimeUnit;
import com.cloud.agent.api.ModifySshKeysCommand;
import com.cloud.agent.api.ModifyStoragePoolCommand;
+import org.apache.cloudstack.agent.lb.SetupMSListCommand;
import org.apache.cloudstack.managed.context.ManagedContextRunnable;
import org.apache.log4j.Logger;
@@ -116,7 +117,7 @@ public abstract class AgentAttache {
StopCommand.class.toString(),
CheckVirtualMachineCommand.class.toString(), PingTestCommand.class.toString(),
CheckHealthCommand.class.toString(),
ReadyCommand.class.toString(), ShutdownCommand.class.toString(),
SetupCommand.class.toString(),
CleanupNetworkRulesCmd.class.toString(),
CheckNetworkCommand.class.toString(), PvlanSetupCommand.class.toString(),
CheckOnHostCommand.class.toString(),
- ModifyTargetsCommand.class.toString(),
ModifySshKeysCommand.class.toString(),
ModifyStoragePoolCommand.class.toString()};
+ ModifyTargetsCommand.class.toString(),
ModifySshKeysCommand.class.toString(),
ModifyStoragePoolCommand.class.toString(), SetupMSListCommand.class.toString()};
protected final static String[] s_commandsNotAllowedInConnectingMode = new
String[] { StartCommand.class.toString(), CreateCommand.class.toString() };
static {
Arrays.sort(s_commandsAllowedInMaintenanceMode);
diff --git
a/server/src/main/java/org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImpl.java
b/server/src/main/java/org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImpl.java
index 19eb97d..c3cca0e 100644
---
a/server/src/main/java/org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImpl.java
+++
b/server/src/main/java/org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImpl.java
@@ -136,7 +136,7 @@ public class IndirectAgentLBServiceImpl extends
ComponentLifecycleBase implement
}
final List <Host> agentBasedHosts = new ArrayList<>();
for (final Host host : allHosts) {
- if (host == null || host.getResourceState() !=
ResourceState.Enabled) {
+ if (host == null || host.getResourceState() ==
ResourceState.Creating || host.getResourceState() == ResourceState.Error) {
continue;
}
if (host.getType() == Host.Type.Routing || host.getType() ==
Host.Type.ConsoleProxy || host.getType() == Host.Type.SecondaryStorage ||
host.getType() == Host.Type.SecondaryStorageVM) {