You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "hulucc (via GitHub)" <gi...@apache.org> on 2026/10/20 09:12:24 UTC

[PR] Routed VR: accept VRRP and conntrackd sync on redundant routers [cloudstack]

hulucc opened a new pull request, #14446:
URL: https://github.com/apache/cloudstack/pull/14446

   ### Description
   
   This PR fixes redundant VRs of ROUTED isolated networks and VPCs coming up as PRIMARY on both routers.
   
   In ROUTED mode the VR flushes iptables and builds nftables tables (`ip4_firewall` for isolated networks, `ip4_acl` for VPCs) whose INPUT chain has a drop policy. The INPUT whitelist built by `fw_router_routing` and `fw_vpcrouter_routing` lacks VRRP (224.0.0.18) and conntrackd (225.0.0.50) multicast, which `fw_router` / `fw_vpcrouter` accept for non-routed networks. Both routers drop each other's VRRP advertisements and both become PRIMARY.
   
   This adds `iifname <guest dev> ip daddr 224.0.0.18 counter accept` and `iifname <guest dev> ip daddr 225.0.0.50 counter accept` to the INPUT whitelist of both functions, plus unit tests. The rules match the destination address rather than the protocol because keepalived uses AH authentication, so the advertisements are IP protocol 51, not 112.
   
   Redundant ROUTED offerings can be created on 4.20 (the RedundantRouter capability on the Gateway service was added for ROUTED in #9470), so this targets 4.20 as a bug fix, following CONTRIBUTING.md. If you would rather take it as part of #11565 on main, I can retarget the PR; the commit cherry-picks cleanly onto main and the new tests pass there.
   
   Fixes: #14445
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [x] 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
   - [ ] test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [x] Major
   - [ ] Minor
   - [ ] Trivial
   
   
   ### Screenshots (if appropriate):
   
   
   ### How Has This Been Tested?
   
   Unit tests: the two new tests in `TestCsAddress.TestCsIPRouted` pass. pycodestyle (`--max-line-length=179`) and pylint report nothing new for the changed files; the two `TestCsRoute` failures in a container are pre-existing (they need a real default route).
   
   Test environment: management server 4.20.3.1, KVM on CentOS 8, systemvm template 4.20.2. The change was applied to `/usr/share/cloudstack-common/vms/cloud-scripts.tgz` on the host, which the agent copies into the VR at boot (the new md5 showed up as the routers' scripts version).
   
   - Isolated network, ROUTED Static, redundant offering (created via API, `RedundantRouter` capability on the Gateway service): before the change both VRs were PRIMARY; after, PRIMARY/BACKUP, and the INPUT counters of the new rules show VRRP and conntrackd traffic being accepted. Forced stop of the primary: about 3 s of ping loss, and the stopped VR rejoins as BACKUP when started again (nopreempt).
   - Isolated network, ROUTED Dynamic, with an FRR peer: PRIMARY/BACKUP. The backup's BGP session stays Active (its public interface is down), and after a failover the new primary establishes the session.
   - VPC, ROUTED Dynamic, redundant VPC offering: PRIMARY/BACKUP, about 6 s of ping loss on failover.
   
   #### How did you try to break this feature and the system with this change?
   
   - Only `fw_router_routing` and `fw_vpcrouter_routing` change, and both return early unless the network is ROUTED, so non-routed VRs are not affected.
   - The new rules accept only the two link-local multicast groups on the guest interface, the same addresses the iptables path already accepts.
   - On non-redundant routed networks the rules never match anything.
   
   Not addressed here, but possibly useful for #11565: during a BGP failover the peer may refuse the new primary with a Connection Collision until the stale session from the old primary is torn down. With default timers this caused about 20 s without the route in our test, and with keepalive 3 s / hold 9 s on the peer the total failover was about 5 s.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Routed VR: accept VRRP and conntrackd sync on redundant routers [cloudstack]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #14446:
URL: https://github.com/apache/cloudstack/pull/14446#issuecomment-6288607539

   ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/14446?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 4.16%. Comparing base ([`376c1b4`](https://app.codecov.io/gh/apache/cloudstack/commit/376c1b40174ab4b8d7f9aced5401143cbc09d587?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`8637dc4`](https://app.codecov.io/gh/apache/cloudstack/commit/8637dc4e2e10fad570ca7476a30feafac80e0ad9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   > :exclamation:  There is a different number of reports uploaded between BASE (376c1b4) and HEAD (8637dc4). Click for more details.
   > 
   > <details><summary>HEAD has 1 upload less than BASE</summary>
   >
   >| Flag | BASE (376c1b4) | HEAD (8637dc4) |
   >|------|------|------|
   >|unittests|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##               4.20   #14446       +/-   ##
   =============================================
   - Coverage     16.41%    4.16%   -12.25%     
   =============================================
     Files          5669      405     -5264     
     Lines        501628    33078   -468550     
     Branches      60942     5903    -55039     
   =============================================
   - Hits          82336     1378    -80958     
   + Misses       410064    31524   -378540     
   + Partials       9228      176     -9052     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/14446/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/14446/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.16% <ø> (ø)` | |
   | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/14446/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/cloudstack/pull/14446?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Routed VR: accept VRRP and conntrackd sync on redundant routers [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #14446:
URL: https://github.com/apache/cloudstack/pull/14446#issuecomment-6289770364

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Routed VR: accept VRRP and conntrackd sync on redundant routers [cloudstack]

Posted by "hulucc (via GitHub)" <gi...@apache.org>.
hulucc commented on PR #14446:
URL: https://github.com/apache/cloudstack/pull/14446#issuecomment-6306569149

   Thanks @weizhouapache for the quick response and for testing it!
   
   We are preparing to upgrade our production cloud from 4.19 to 4.20, and we plan to use routed VPCs with dynamic routing (BGP) and redundant VRs there. So far it has been tested in our test environment (4.20.3.1, KVM), with this patch applied to `cloud-scripts.tgz` on the hosts.
   
   Some observations from the tests that may help with #11565:
   - With the fix, a forced stop of the primary VR caused about 3 s of ping loss (isolated, static).
   - With BGP, the new primary was refused by the peer with "Connection Collision Resolution" until the stale session from the old primary was torn down. With default timers (60/180) this left the routes withdrawn for about 20 s; with keepalive 3 / hold 9 on the peer, the whole failover took about 5 s.
   - The UI only shows the redundant router switch when SourceNat is selected, so redundant ROUTED offerings can currently only be created via the API. I'm happy to open a separate PR for that if useful.
   
   The failing simulator smoke job (`test_network_permissions`, `test_primary_storage` teardown) does not exercise the systemvm Python scripts this PR changes, and the same job fails intermittently on other PRs. Could you re-run it when convenient?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Routed VR: accept VRRP and conntrackd sync on redundant routers [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #14446:
URL: https://github.com/apache/cloudstack/pull/14446#issuecomment-6288459438

   @hulucc 
   thanks for raising the issue and creating the PR.
   
   To be frank, when I developed the feature, I did not take redundant VRs into consideration. I will review and test the PR.
   
   I am glad to see the feature is being tested or used. Are you doing PoC of routed network/vpc, or running it in production ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Routed VR: accept VRRP and conntrackd sync on redundant routers [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #14446:
URL: https://github.com/apache/cloudstack/pull/14446#issuecomment-6288486083

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Routed VR: accept VRRP and conntrackd sync on redundant routers [cloudstack]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #14446:
URL: https://github.com/apache/cloudstack/pull/14446#issuecomment-6287573125

   Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
   Here are some useful points:
   - In case of a new feature add useful documentation (raise doc PR at https://github.com/apache/cloudstack-documentation)
   - Be patient and persistent. It might take some time to get a review or get the final approval from the committers.
   - Pay attention to the quality of your code, ensure tests are passing and your PR doesn't have conflicts.
   - Please follow [ASF Code of Conduct](https://github.com/apache/.github/blob/main/.github/CODE_OF_CONDUCT.md) for all communication including (but not limited to) comments on Pull Requests, Issues, Mailing list and Slack.
   - Be sure to read the [CloudStack Coding Conventions](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Coding+conventions).
   Apache CloudStack is a community-driven project and together we are making it better 🚀.
   In case of doubts contact the developers at:
   Mailing List: dev@cloudstack.apache.org (https://cloudstack.apache.org/mailing-lists.html)
   Slack: https://apachecloudstack.slack.com/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Routed VR: accept VRRP and conntrackd sync on redundant routers [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #14446:
URL: https://github.com/apache/cloudstack/pull/14446#issuecomment-6288462207

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org