Skip to content

Persist and expose effective network rate for NIC, Network and compute offering - #13325

Draft
sudo87 wants to merge 9 commits into
apache:mainfrom
shapeblue:networkThrottling
Draft

sudo87 wants to merge 9 commits into
apache:mainfrom
shapeblue:networkThrottling

Conversation

@sudo87

@sudo87 sudo87 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Description

This PR exposes the effective network rate (bandwidth throttling) configured for NICs and guest networks through API responses and UI.

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?

@sudo87 sudo87 changed the title persist and expose effective network rate for NIC, Network and compute offering Persist and expose effective network rate for NIC, Network and compute offering Jun 3, 2026
@sudo87
sudo87 marked this pull request as draft June 3, 2026 09:56
@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 7.50000% with 74 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.89%. Comparing base (dc0ba1c) to head (5b71a1b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ava/com/cloud/upgrade/dao/Upgrade42300to42400.java 21.05% 15 Missing ⚠️
...tack/engine/orchestration/NetworkOrchestrator.java 0.00% 7 Missing and 1 partial ⚠️
...pache/cloudstack/api/response/NetworkResponse.java 0.00% 6 Missing ⚠️
...rg/apache/cloudstack/api/response/NicResponse.java 0.00% 6 Missing ⚠️
...ngine/schema/src/main/java/com/cloud/vm/NicVO.java 0.00% 6 Missing ⚠️
...src/main/java/com/cloud/api/ApiResponseHelper.java 0.00% 6 Missing ⚠️
.../main/java/com/cloud/network/NetworkModelImpl.java 16.66% 5 Missing ⚠️
server/src/main/java/com/cloud/api/ApiDBUtils.java 0.00% 4 Missing ⚠️
...m/cloud/api/query/dao/DomainRouterJoinDaoImpl.java 0.00% 4 Missing ⚠️
...ava/com/cloud/api/query/dao/UserVmJoinDaoImpl.java 0.00% 4 Missing ⚠️
... and 4 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #13325      +/-   ##
============================================
- Coverage     19.89%   19.89%   -0.01%     
- Complexity    20144    20145       +1     
============================================
  Files          6371     6372       +1     
  Lines        576829   576903      +74     
  Branches      70627    70638      +11     
============================================
+ Hits         114778   114781       +3     
- Misses       449507   449576      +69     
- Partials      12544    12546       +2     
Flag Coverage Δ
uitests 3.71% <ø> (ø)
unittests 21.16% <7.50%> (-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.

@bernardodemarco
bernardodemarco requested a review from hsato03 June 3, 2026 12:23
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@weizhouapache weizhouapache added this to the 4.24.0 milestone Jun 29, 2026
@DaanHoogland DaanHoogland moved this from Backlog to conflict/waiting for author in CloudStack Testing Aug 31, 2026
# Conflicts:
#	server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
#	ui/src/config/section/network.js
- Add network_rate column to nics table (schema-42300to42400.sql)
- Add DB upgrade path: Upgrade42300to42400 registered in DatabaseUpgradeChecker
- Add network_rate field and getter/setter to NicVO
- Set network_rate on NicVO in NetworkOrchestrator.allocateNic() where rate
  is already computed, eliminating secondary per-NIC update calls
- Add getNetworkRate() to Nic interface so ApiResponseHelper.createNicResponse
  can call result.getNetworkRate() without casting or extra DB queries
- Add nic_network_rate to user_vm_view and UserVmJoinVO so listVirtualMachines
  reads rate from the join without extra per-NIC findNicById calls
- Update UserVmJoinDaoImpl to use uvo.getNicNetworkRate() directly
- Expose network_rate in NicResponse as Integer (null = unlimited)
- Refresh NIC rates on VM start via refreshNicNetworkRates in UserVmManagerImpl
@sudo87

sudo87 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@sudo87 a [SL] Jenkins job has been kicked to build packages. It will be bundled with no 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 19103

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@sudo87

sudo87 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@sudo87 a [SL] Jenkins job has been kicked to build packages. It will be bundled with no 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 19139

@sudo87

sudo87 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@sudo87 a [SL] Jenkins job has been kicked to build packages. It will be bundled with no 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 19236

…orkOffering APIs

Align networkrate field type and unlimited semantics (-1) across
NetworkResponse and NicResponse with the existing NetworkOfferingResponse
convention, instead of using a String unlimited value or omitting the
field entirely.
Instance NICs now derive rate solely from the VM's own offering. VR
guest interfaces check the router's own system offering first, then
fall back to the network offering. Persist rate once in prepareNic()
for all VM types. Also surface NIC network rate on listRouters.

Existing NICs won't reflect the new precedence until their VM/router
is restarted; a DB backfill for pre-existing NICs is tracked as a
separate follow-up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: conflict/waiting

Development

Successfully merging this pull request may close these issues.

4 participants