Skip to content

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

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

Persist and expose effective network rate for NIC, Network and compute offering#13325
sudo87 wants to merge 5 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 6.84932% with 68 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.78%. Comparing base (a723d44) to head (b684b88).

Files with missing lines Patch % Lines
...ava/com/cloud/upgrade/dao/Upgrade42300to42400.java 21.05% 15 Missing ⚠️
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 0.00% 11 Missing ⚠️
...tack/engine/orchestration/NetworkOrchestrator.java 0.00% 8 Missing ⚠️
...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 ⚠️
server/src/main/java/com/cloud/api/ApiDBUtils.java 0.00% 4 Missing ⚠️
...src/main/java/com/cloud/api/ApiResponseHelper.java 0.00% 4 Missing ⚠️
...main/java/com/cloud/api/query/vo/UserVmJoinVO.java 0.00% 3 Missing ⚠️
...ain/java/com/cloud/network/NetworkServiceImpl.java 0.00% 3 Missing ⚠️
... and 1 more
Additional details and impacted files
@@             Coverage Diff              @@
##              main   #13325       +/-   ##
============================================
+ Coverage     3.53%   19.78%   +16.24%     
- Complexity       0    19993    +19993     
============================================
  Files          487     6372     +5885     
  Lines        41867   575974   +534107     
  Branches      7913    70503    +62590     
============================================
+ Hits          1479   113933   +112454     
- Misses       40173   449611   +409438     
- Partials       215    12430    +12215     
Flag Coverage Δ
uitests 3.53% <ø> (ø)
unittests 21.05% <6.84%> (?)

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.

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