Skip to content

Consider next external provider tagged range for public IPs when previous is full - #14891

Merged
sureshanaparti merged 1 commit into
4.22from
fix-range-exhaustion-ext-provider-422
Nov 30, 2026
Merged

sureshanaparti merged 1 commit into
4.22from
fix-range-exhaustion-ext-provider-422

Conversation

@Pearl1594

@Pearl1594 Pearl1594 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR fixes: #14890

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
  • 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?

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

@codecov

codecov Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.33%. Comparing base (3e05055) to head (3bca37e).
⚠️ Report is 3 commits behind head on 4.22.

Files with missing lines Patch % Lines
...ain/java/com/cloud/network/NetworkServiceImpl.java 0.00% 11 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.22   #14891      +/-   ##
============================================
- Coverage     18.34%   18.33%   -0.01%     
+ Complexity    16668    16666       -2     
============================================
  Files          5939     5939              
  Lines        537809   537806       -3     
  Branches      65938    65937       -1     
============================================
- Hits          98637    98610      -27     
- Misses       427952   427978      +26     
+ Partials      11220    11218       -2     
Flag Coverage Δ
uitests 4.08% <ø> (ø)
unittests 19.42% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nvazquez

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

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

@nvazquez

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

blueorangutan commented Nov 28, 2026 •

Copy link
Copy Markdown

[SF] Trillian test result (tid-17648)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 54037 seconds
Marvin logs: [archive removed]
Smoke tests completed. 148 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_vpn_usage Error 1.10 test_usage.py

@nvazquez nvazquez left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @Pearl1594 - LGTM:

Manually tested defining 2 ranges for Netris public traffic:

mysql> select v.id,v.vlan_gateway,v.ip4_range,d.name,d.value from vlan v join vlan_details d on (v.id = d.vlan_id) where v.removed is null;
+----+--------------+---------------------------+-----------+-------+
| id | vlan_gateway | ip4_range                 | name      | value |
+----+--------------+---------------------------+-----------+-------+
|  4 | 100.99.65.1  | 100.99.65.10-100.99.65.11 | forNetris | true  |
|  5 | 100.99.66.1  | 100.99.66.10-100.99.66.14 | forNetris | true  |
+----+--------------+---------------------------+-----------+-------+
2 rows in set (0.00 sec)

Deployed 2 VPCs to exhaust the first range, and then could continue deploying a new VPC which used the second range:

mysql> select id,public_ip_address, allocated, state from user_ip_address where vlan_db_id = 4;
+----+-------------------+---------------------+-----------+
| id | public_ip_address | allocated           | state     |
+----+-------------------+---------------------+-----------+
| 41 | 100.99.65.10      | 2026-11-27 22:00:56 | Allocated |
| 42 | 100.99.65.11      | 2026-11-27 22:02:05 | Allocated |
+----+-------------------+---------------------+-----------+
2 rows in set (0.00 sec)

mysql> select id,public_ip_address, allocated, state from user_ip_address where vlan_db_id = 5;
+----+-------------------+---------------------+-----------+
| id | public_ip_address | allocated           | state     |
+----+-------------------+---------------------+-----------+
| 82 | 100.99.66.10      | 2026-11-30 01:48:14 | Allocated |
| 83 | 100.99.66.11      | NULL                | Free      |
| 84 | 100.99.66.12      | NULL                | Free      |
| 85 | 100.99.66.13      | NULL                | Free      |
| 86 | 100.99.66.14      | NULL                | Free      |
+----+-------------------+---------------------+-----------+
5 rows in set (0.00 sec)

@sureshanaparti sureshanaparti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

clgtm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

A remaining active nit requests a regression test covering later provider-tagged ranges when the first tagged range has no free IPs, leaving the fix insufficiently protected against regression.

1 open issue
What changed in this PR

This bug fix enables provider-specific public IP allocation to use a later tagged VLAN range when an earlier matching range is exhausted.

Changes:

  • Searches matching provider-tagged VLAN ranges until one with free IP addresses is found.
  • Updates logging and allocation failure messages to reflect multiple matching ranges.
  • Preserves random IP selection within the first available range.
File Description
server/​src/​main/​java/​com/​cloud/​network/​NetworkServiceImpl.java Selects free public IPs from the first non-exhausted VLAN range matching the provider detail key and updates related logging and error messages.

Review effort: Lite

@nvazquez nvazquez added the Severity:Critical Critical bug label Nov 30, 2026
@nvazquez nvazquez added this to the 4.22.2 milestone Nov 30, 2026
@sureshanaparti
sureshanaparti merged commit 069ac79 into 4.22 Nov 30, 2026
46 of 49 checks passed
@sureshanaparti
sureshanaparti deleted the fix-range-exhaustion-ext-provider-422 branch November 30, 2026 10:42
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.

[Netris] VPC deployments fail after the first dedicated range set for Netris is exhausted and does not consider the next range

5 participants