Skip to content

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

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

sudo87 wants to merge 12 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

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 3.71%. Comparing base (dc0ba1c) to head (4c8b4ef).
⚠️ Report is 2 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (dc0ba1c) and HEAD (4c8b4ef). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (dc0ba1c) HEAD (4c8b4ef)
unittests 1 0
Additional details and impacted files
@@              Coverage Diff              @@
##               main   #13325       +/-   ##
=============================================
- Coverage     19.89%    3.71%   -16.19%     
=============================================
  Files          6371      487     -5884     
  Lines        576829    41992   -534837     
  Branches      70627     7942    -62685     
=============================================
- Hits         114778     1558   -113220     
+ Misses       449507    40208   -409299     
+ Partials      12544      226    -12318     
Flag Coverage Δ
uitests 3.71% <ø> (ø)
unittests ?

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.
…gration

Add an upgrade-time backfill for nics.network_rate and the network_details
networkrate entry, frozen to pre-feature precedence so existing bandwidth
doesn't change. Also refresh network_details rate during
migrateGuestNetwork, and add unit tests for getNetworkRate precedence.
@sudo87

sudo87 commented Sep 16, 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 19262

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