realtime re-balance remote agents - #14001
Draft
DaanHoogland wants to merge 1 commit into
Draft
Conversation
DaanHoogland
commented
Aug 28, 2026
| verify(clusteredAgentManagerImpl).loadDirectlyConnectedHost(hostVO, false); | ||
| } | ||
|
|
||
| // https://github.com/apache/cloudstack/issues/9640 |
Contributor
Author
There was a problem hiding this comment.
Suggested change
| // https://github.com/apache/cloudstack/issues/9640 |
DaanHoogland
commented
Aug 28, 2026
Comment on lines
+1042
to
+1046
| // Indirectly connected agents (KVM hosts, SSVM, CPVM) dial in to a management server rather | ||
| // than being loaded directly by it, so this management server can't hand the host to a | ||
| // specific future owner the way it can for direct agents. Disconnect it instead: the agent | ||
| // reconnects on its own using its indirect agent LB configuration (the "host" global setting | ||
| // and indirect.agent.lb.algorithm), which is what actually determines its next owner. |
Contributor
Author
There was a problem hiding this comment.
evaluate and redact comment
DaanHoogland
commented
Aug 28, 2026
Comment on lines
+158
to
+160
| // Indirectly connected agents (KVM hosts, SSVM, CPVM) dial in to a management server rather than | ||
| // being loaded directly by it, so they must be disconnected (and left to reconnect on their own) | ||
| // instead of going through the direct-agent rebalance dance that expects a ClusteredDirectAgentAttache. |
Contributor
Author
There was a problem hiding this comment.
Suggested change
| // Indirectly connected agents (KVM hosts, SSVM, CPVM) dial in to a management server rather than | |
| // being loaded directly by it, so they must be disconnected (and left to reconnect on their own) | |
| // instead of going through the direct-agent rebalance dance that expects a ClusteredDirectAgentAttache. |
DaanHoogland
commented
Aug 28, 2026
Comment on lines
+1040
to
+1053
| final AgentAttache attache = findAttache(hostId); | ||
| if (attache != null && !(attache instanceof ClusteredDirectAgentAttache)) { | ||
| // Indirectly connected agents (KVM hosts, SSVM, CPVM) dial in to a management server rather | ||
| // than being loaded directly by it, so this management server can't hand the host to a | ||
| // specific future owner the way it can for direct agents. Disconnect it instead: the agent | ||
| // reconnects on its own using its indirect agent LB configuration (the "host" global setting | ||
| // and indirect.agent.lb.algorithm), which is what actually determines its next owner. | ||
| logger.debug("Host id={} ({}) is an indirectly connected agent; disconnecting it so it reconnects and picks a management server " + | ||
| "using its own load balancing configuration", hostId, attache); | ||
| result = handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true); | ||
| finishRebalance(hostId, futureOwnerId, result ? Event.RebalanceCompleted : Event.RebalanceFailed); | ||
| return result; | ||
| } | ||
|
|
Contributor
Author
There was a problem hiding this comment.
new method, move comment to javadoc
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #14001 +/- ##
=============================================
- Coverage 19.73% 3.41% -16.33%
=============================================
Files 6371 487 -5884
Lines 575784 41863 -533921
Branches 70478 7912 -62566
=============================================
- Hits 113644 1429 -112215
+ Misses 449788 40234 -409554
+ Partials 12352 200 -12152
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
@nvazquez , can you have a look at this and discuss if needed? |
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR relates to agent rebalancing on MSses see #9640 but applies to atachees .
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?