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

[PR] [4.22] Prevent Load Balancer rule creation when adding a VM from a different network [cloudstack]

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

   ### Description
   
   This PR backports an issue fixed by PR #12487 for VPCs not using conserve mode. Since VPC Conserve mode is added on 4.23, only the logic that applies to this issue has been backported from the commit: https://github.com/apache/cloudstack/pull/12487/commits/b6fbdc37ef3c4bed6403d7644ae685e4ce9abe4c
   
   To reproduce the issue:
   - Create a VPC
   - Create two VPC tiers: Tier 1 and Tier 2.
   - Deploy one VM in each tier.
   - Acquire a public IP for the VPC.
   - Create a Port Forwarding rule on Tier 1, which associates the IP with Tier 1.
   - Attempt to create a Load Balancer rule using the same IP but specifying networkid=<tier2_id>.
   
   The issue has been detected using cmk (UI does not allow adding a VM to a LB from a different network).
   
   Before the fix: CloudStack allows the addition of VMs from different networks to the load balancer
   
   After the fix:
   
   ````
   (localcloud) 🐱 > create loadbalancerrule privateport=8080 publicport=8080 name=LB algorithm=roundrobin publicipid=dd5d9043-86b4-44d3-80fd-f4523b9f69cd networkid=a97dce8b-6cd7-4bc0-807a-24dc515b5f34
   🙈 Error: (HTTP 431, error code 9999) Cannot create Load Balancer rule LB as the IP address 10.0.60.206 is not associated with the network VPC-Default-T2 (ID=a97dce8b-6cd7-4bc0-807a-24dc515b5f34)
   ````
   
   ### 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
   - [ ] Major
   - [ ] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to -->
   
   #### How did you try to break this feature and the system with this change?
   
   <!-- see how your change affects other areas of the code, etc. -->
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
   


-- 
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] [4.22] Prevent Load Balancer rule creation when adding a VM from a different network [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland merged PR #12785:
URL: https://github.com/apache/cloudstack/pull/12785


-- 
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] [4.22] Prevent Load Balancer rule creation when adding a VM from a different network [cloudstack]

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

   ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/12785?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 3.70%. Comparing base ([`7aa0558`](https://app.codecov.io/gh/apache/cloudstack/commit/7aa0558c5b9127ef1633e151baf60ce7172ceaff?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`7911153`](https://app.codecov.io/gh/apache/cloudstack/commit/7911153c07f5aa4b8b36a4e47fe73a600e0a2b90?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 (7aa0558) and HEAD (7911153). Click for more details.
   > 
   > <details><summary>HEAD has 1 upload less than BASE</summary>
   >
   >| Flag | BASE (7aa0558) | HEAD (7911153) |
   >|------|------|------|
   >|unittests|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##               4.22   #12785       +/-   ##
   =============================================
   - Coverage     17.61%    3.70%   -13.91%     
   =============================================
     Files          5917      448     -5469     
     Lines        531402    38019   -493383     
     Branches      64971     7035    -57936     
   =============================================
   - Hits          93596     1409    -92187     
   + Misses       427252    36423   -390829     
   + Partials      10554      187    -10367     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/12785/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/12785/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `3.70% <ø> (ø)` | |
   | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/12785/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 Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/12785?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] [4.22] Prevent Load Balancer rule creation when adding a VM from a different network [cloudstack]

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

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


-- 
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] [4.22] Prevent Load Balancer rule creation when adding a VM from a different network [cloudstack]

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

   <b>[SF] Trillian test result (tid-15602)</b>
   Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
   Total time taken: 47306 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr12785-t15602-kvm-ol8.zip
   Smoke tests completed. 146 look OK, 3 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   ContextSuite context=TestListIdsParams>:teardown | `Error` | 1.11 | test_list_ids_parameter.py
   test_01_snapshot_root_disk | `Error` | 4.82 | test_snapshots.py
   test_02_list_snapshots_with_removed_data_store | `Error` | 45.54 | test_snapshots.py
   test_02_list_snapshots_with_removed_data_store | `Error` | 45.55 | test_snapshots.py
   ContextSuite context=TestSnapshotStandaloneBackup>:teardown | `Error` | 26.22 | test_snapshots.py
   test_01_snapshot_usage | `Error` | 25.62 | test_usage.py
   test_01_vpn_usage | `Error` | 1.08 | test_usage.py
   


-- 
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] [4.22] Prevent Load Balancer rule creation when adding a VM from a different network [cloudstack]

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

   @nvazquez 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] [4.22] Prevent Load Balancer rule creation when adding a VM from a different network [cloudstack]

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

   @blueorangutan test


-- 
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] [4.22] Prevent Load Balancer rule creation when adding a VM from a different network [cloudstack]

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

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


-- 
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] [4.22] Prevent Load Balancer rule creation when adding a VM from a different network [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #12785:
URL: https://github.com/apache/cloudstack/pull/12785#discussion_r2916890704


##########
server/src/main/java/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java:
##########
@@ -1790,7 +1792,17 @@ public LoadBalancer createPublicLoadBalancerRule(String xId, String name, String
 
         return result;
     }
-   /**
+
+    protected void verifyLoadBalancerRuleNetwork(String lbName, Network network, IPAddressVO ipVO) {

Review Comment:
   why protected? private seems apropriate.



-- 
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] [4.22] Prevent Load Balancer rule creation when adding a VM from a different network [cloudstack]

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

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


-- 
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] [4.22] Prevent Load Balancer rule creation when adding a VM from a different network [cloudstack]

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

   @nvazquez 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] [4.22] Prevent Load Balancer rule creation when adding a VM from a different network [cloudstack]

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

   @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


Re: [PR] [4.22] Prevent Load Balancer rule creation when adding a VM from a different network [cloudstack]

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

   @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