Skip to content

Support VPC public gateway rate throttling, built on NIC/network rate persistence and precedence fixes - #13325

Open
sudo87 wants to merge 50 commits into
apache:mainfrom
shapeblue:networkThrottling
Open

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

Conversation

@sudo87

@sudo87 sudo87 commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds an operator-configurable data transfer rate for a VPC's public/internet-facing gateway, independent of the per-tier rates that network offerings already control.

Precedence:

VPC offering  rate >  vpc.public.network.throttling.rate (default unlimited)

In addition to vpc, there is a change in precedence order for network rate for NIC and VRs being added in this PR.

For NICs:

Default used to select network rate based on below:

Bandwidth from compute offering  > "vm.network.throttling.rate" config

Other NICs use:

Bandwidth from Network offering > "network.throttling.rate" config

Going forward Default NIC precedence will be used for all NICs

For VR's guest interface:

Old precendence:

Bandwidth from Network offering > "network.throttling.rate" config

New one:

Bandwidth from System offering > Network offering > "network.throttling.rate" config

Also persists the effective network rate per NIC and Network and exposes the effective network rate (bandwidth throttling) configured for NICs and guest networks in the 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?

Verified end-to-end in a lab: API responses, the actual libvirt bandwidth configuration on the router, and measured live throughput across a multi-tier VPC confirming tiers correctly share one capped public-gateway.

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.70%. Comparing base (d3f0700) to head (a1d80a9).

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

HEAD has 1 upload less than BASE
Flag BASE (d3f0700) HEAD (a1d80a9)
unittests 1 0
Additional details and impacted files
@@              Coverage Diff              @@
##               main   #13325       +/-   ##
=============================================
- Coverage     20.39%    3.70%   -16.70%     
=============================================
  Files          6481      493     -5988     
  Lines        588040    42549   -545491     
  Branches      72021     8067    -63954     
=============================================
- Hits         119957     1577   -118380     
+ Misses       455052    40746   -414306     
+ Partials      13031      226    -12805     
Flag Coverage Δ
uitests 3.70% <ø> (-0.01%) ⬇️
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

@blueorangutan

Copy link
Copy Markdown

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

@weizhouapache weizhouapache left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

code lgtm

Copilot AI lite review requested due to automatic review settings October 8, 2026 06:27

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

Four moderate issues remain unresolved, including stale NIC rates, partial VPC persistence, an N+1 query, and fractional-rate validation.

2 open findings

🧠 Review effort: Lite


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread server/src/main/java/com/cloud/api/ApiResponseHelper.java
Comment thread server/src/main/java/com/cloud/network/NetworkServiceImpl.java
@sudo87

sudo87 commented Oct 8, 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 19463

@github-actions

github-actions Bot commented Oct 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.

Copilot AI lite review requested due to automatic review settings October 9, 2026 11:53

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

0 open findings

2 resolved since last review

🧠 Review effort: Lite

Copilot AI lite review requested due to automatic review settings October 9, 2026 12:11
@sudo87

sudo87 commented Oct 9, 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.

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

2 open findings

🧠 Review effort: Lite

Comment thread server/src/main/java/com/cloud/api/ApiResponseHelper.java
Comment thread server/src/main/java/com/cloud/api/ApiResponseHelper.java
@blueorangutan

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

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

Copilot AI lite review requested due to automatic review settings October 15, 2026 06:43

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.

🔵 Needs a closer look

The form validation needs correction, and the broad rate-precedence and data-migration changes warrant final human review.

1 open finding
2 resolved since last review

🧠 Review effort: Lite

Comment on lines +772 to +774
if (value && (isNaN(value) || value < -1)) {
return Promise.reject(this.$t('message.error.number'))
}

This branch has not been deployed

No deployments
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.

7 participants