Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server: fix haproxy misconfiguration after VPC VR start #8881

Conversation

weizhouapache
Copy link
Member

@weizhouapache weizhouapache commented Apr 4, 2024

Description

This PR fixes #8745

  1. create vpc with 2 tiers
  2. create lb in each vpc tier
  3. check vpc vr, /etc/haproxy/haproxy.cfg contains the load balancer configuration of both 2 tiers.
  4. restart vpc with cleanup. check the new vpc vr
  • expected: /etc/haproxy/haproxy.cfg in new vpc vr should be same as before (step 3)
  • actual without this PR: /etc/haproxy/haproxy.cfg in new vpc vr contains the load balancer configuration for only 1 tier.
  • with this PR: works as expected

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache 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.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el7 ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 9156

@weizhouapache weizhouapache force-pushed the 4.18-fix-vpc-vr-haproxy-misconfiguration branch from d99ce9c to e63cf69 Compare April 4, 2024 10:58
@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache 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.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 35 lines in your changes are missing coverage. Please review.

Project coverage is 13.17%. Comparing base (7a9985b) to head (e63cf69).

Files Patch % Lines
...ork/router/VirtualNetworkApplianceManagerImpl.java 0.00% 21 Missing ⚠️
.../router/VpcVirtualNetworkApplianceManagerImpl.java 0.00% 14 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.18    #8881      +/-   ##
============================================
- Coverage     13.17%   13.17%   -0.01%     
+ Complexity     9215     9214       -1     
============================================
  Files          2725     2725              
  Lines        258215   258235      +20     
  Branches      40247    40249       +2     
============================================
- Hits          34017    34013       -4     
- Misses       219885   219911      +26     
+ Partials       4313     4311       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9157

@weizhouapache
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@weizhouapache a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@SadiJr
Copy link
Collaborator

SadiJr commented Apr 4, 2024

Hey @weizhouapache, is this PR already done to be reviewed?

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-9704)

@weizhouapache
Copy link
Member Author

Hey @weizhouapache, is this PR already done to be reviewed?

@SadiJr
yes, it is ready for review and testing

@weizhouapache weizhouapache marked this pull request as ready for review April 4, 2024 14:15
@weizhouapache
Copy link
Member Author

@blueorangutan test rocky8 kvm-rocky8

@blueorangutan
Copy link

@weizhouapache a [SL] Trillian-Jenkins test job (rocky8 mgmt + kvm-rocky8) has been kicked to run smoke tests

@vishesh92 vishesh92 linked an issue Apr 4, 2024 that may be closed by this pull request
@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-9707)

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-9713)

@blueorangutan
Copy link

[SF] Trillian test result (tid-9714)
Environment: kvm-rocky8 (x2), Advanced Networking with Mgmt server r8
Total time taken: 43042 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8881-t9714-kvm-rocky8.zip
Smoke tests completed. 109 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_migrate_VM_and_root_volume Error 82.26 test_vm_life_cycle.py
test_02_migrate_VM_with_two_data_disks Error 53.83 test_vm_life_cycle.py
test_08_migrate_vm Error 0.07 test_vm_life_cycle.py

@DaanHoogland
Copy link
Contributor

@blueorangutan test alma9 kvm-alma9

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (alma9 mgmt + kvm-alma9) has been kicked to run smoke tests

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

final List<LoadBalancingRule> lbRules = new ArrayList<>();
createLoadBalancingRulesList(lbRules, lbs);
s_logger.debug("Found " + lbRules.size() + " load balancing rule(s) to apply as a part of VPC VR " + domainRouterVO + " start.");
if (!lbRules.isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!lbRules.isEmpty()) {
if (lbRules.isEmpty()) {
return;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sureshanaparti I don't think this return mid-method makes for better readable code.

Copy link
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor suggestion, code lgtm

Copy link
Contributor

@JoaoJandre JoaoJandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLGTM, tested manually:

  1. Created a VPC with two tiers (test1 and test2);
  2. Created a VM for each one of this tiers;
  3. Acquired one public IP for each one of this tiers;
  4. Created load balancer rules in each public IP for each VM
  5. Applied restart with clean-up in the VPC

The LB rules were created correctly and only one command was sent for it.

@JoaoJandre
Copy link
Contributor

Merging based on approvals and manual testing.

@JoaoJandre JoaoJandre merged commit a5508ac into apache:4.18 Apr 5, 2024
25 checks passed
@blueorangutan
Copy link

[SF] Trillian test result (tid-9724)
Environment: kvm-alma9 (x2), Advanced Networking with Mgmt server a9
Total time taken: 47144 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8881-t9724-kvm-alma9.zip
Smoke tests completed. 109 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Failure 632.13 test_vpc_redundant.py

dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

haproxy misconfiguration after restarting VPC with cleanup
8 participants