Restart VPC with clean-up not applying all LB rules#8765
Restart VPC with clean-up not applying all LB rules#8765SadiJr wants to merge 1 commit intoapache:4.18from
Conversation
| List<LoadBalancerVO> lbs = null; | ||
| Long vpcId = guestNetwork.getVpcId(); | ||
| if (vpcId != null) { | ||
| lbs = _loadBalancerDao.listByVpcIdAndScheme(vpcId, Scheme.Public); |
There was a problem hiding this comment.
LB rules will be applied multiple times (=number of vpc tiers). There might be exceptions as some guest nics are missing.
It can be applied when all guest nics are added to the VPC VR
There was a problem hiding this comment.
I'm not sure if I understood exactly what you meant; since LB rules are being searched for by VPC ID, exceptions should not occur if there are missing NICs. In the worst case, there will be a rule added to VR of one network that does not exists.
Regarding applying the rules when all guest networks are added to VR, from what I saw of the current ACS workflow, the solution I presented corrects the problem, and I didn't find another part of the code where it can be solved besides this section. If you think that this solution could be applied to another section, could you please point to where that would be?
There was a problem hiding this comment.
@SadiJr
the method finalizeNetworkRulesForNetwork is called for each guest network when VPC VR is started
If you search for StartCommand in management server logs, you will see multiple LoadBalancerConfigCommand with same parameters.
There was a problem hiding this comment.
Correct, the method is indeed called for each guest network, but the LoadBalancerConfigCommand command, from what I've analyzed in the logs, is not the same. Instead, for each guest network that calls such a method, only the load balancer rules for that network are passed in the LoadBalancerConfigCommand command. This is the reason why, in a VPC with multiple guest networks, each of which has its own load balancer rules, only the rules of the last implemented network are applied.
There was a problem hiding this comment.
I know what caused the issue and why you made the changes.
What I meant is, the process can be optimized. Only one LoadBalancerConfigCommand (with LB of all tiers) is needed, maybe after all other rules are applied.
There was a problem hiding this comment.
I can understand your point of view, however, considering the criticality and the time it would take me to implement and test your proposal, I'll continue with the current implementation and create an issue to optimize such a process in the future, using your idea. What do you think?
There was a problem hiding this comment.
@SadiJr
if you do not mind, I can create a new PR for it tomorrow
There was a problem hiding this comment.
Sure, feel free to create an alternative PR, as it allows the community to compare the solutions and choose the best one.
There was a problem hiding this comment.
@SadiJr if you do not mind, I can create a new PR for it tomorrow
@weizhouapache , would this be an alternative or an addition?
Have you created it?
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.18 #8765 +/- ##
============================================
- Coverage 13.16% 13.16% -0.01%
Complexity 9205 9205
============================================
Files 2724 2724
Lines 258149 258153 +4
Branches 40235 40236 +1
============================================
Hits 33987 33987
- Misses 219856 219860 +4
Partials 4306 4306 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This is marked critical, is this a must-have for 4.18.2.0 @JoaoJandre @weizhouapache @DaanHoogland ? |
@rohityadavcloud |
Yes, this is a must-have for 4.18.2.0. Now with #8881 we'll have to discuss which solution is best. |
|
@blueorangutan package |
|
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9171 |
Description
If a restart with clean-up is performed in a VPC that has different guest networks and load balancer rules in these networks, only one of the networks has its load balancer rules applied. This PR fixes this behavior.
Fixes #8745
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
How Has This Been Tested?
It's tested in a local lab, following this steps:
test1andtest2);Before, only the last tier had its rules applied. With this PR, all LB rules are applied.