Skip to content

Multi-queue for VRs - #14378

Open
bernardodemarco wants to merge 6 commits into
apache:mainfrom
scclouds:multiqueue-for-vrs
Open

bernardodemarco wants to merge 6 commits into
apache:mainfrom
scclouds:multiqueue-for-vrs

Conversation

@bernardodemarco

@bernardodemarco bernardodemarco commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Description

By default, virtio-net network adapters of VMs created on KVM provide only one transmit (TX) queue and one receive (RX) queue for network packets. However, it is possible to scale network performance on VMs with multiple vCPUs by leveraging the multi-queue feature. With multi-queue, multiple queue pairs can be configured to enable parallel packet processing, potentially increasing network performance depending on the characteristics of the workloads running on the VM.

Currently, ACS supports multi-queue configuration for end-user VMs. However, this configuration cannot be defined for VRs. Therefore, ACS has been extended to support granular multi-queue configuration for the different NIC types of VRs in guest networks and VPCs. To achieve this, new parameters have been added to the createVPCOffering, createNetworkOffering, cloneNetworkOffering and cloneVPCOffering APIs, and a new global setting has been introduced, as described below:

New createVPCOffering and cloneVPCOffering API parameters
Parameter Description
publicmultiqueuenumber The number of queues for the public NIC of VRs belonging to VPCs.
privategatewaymultiqueuenumber The number of queues for the private gateway NIC of VRs belonging to VPCs.
New createNetworkOffering and cloneNetworkOffering API parameters
Parameter Description
publicmultiqueuenumber The number of queues for the public NIC of VRs belonging to guest networks. This parameter is not allowed for L2 network and VPC tier offerings.
privatemultiqueuenumber The number of queues for the private NIC of VRs belonging to guest networks and VPC tiers. This parameter is not allowed for L2 network offerings.
New global setting
Setting Scope Dynamic Default Description
router.nic.multiqueue.number Global Yes 1 Default number of queues for the NICs of VRs (KVM only), used when the corresponding multi-queue parameter of the network or VPC offering is not set.

Similarly to multi-queue support for end-user VMs, if these parameters (or the global setting) are set to -1, ACS automatically configures the number of queues to match the number of vCPUs assigned to the VR. The accepted values are -1 or an integer from 1 to 256; any other value is rejected by the offering APIs and by the updateConfiguration API.

The number of queues applied to each VR NIC is resolved as follows:

  1. The multi-queue parameter of the network or VPC offering corresponding to the NIC, if defined;
  2. Otherwise, the value of the router.nic.multiqueue.number global setting.

As the setting is dynamic, changes to its value are applied to VR NICs that are plugged after the update (e.g., when a VR is recreated, or when a new tier or private gateway is added to a VPC). NICs of running VRs keep their current number of queues.

The ACS UI has also been extended to support configuring these parameters in the VPC and network offering creation/clone forms.

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

Screenshots (if appropriate):

VPC offering creation form image
Clone VPC offering form Image
Network offering creation form image
Clone network offering form Image

How Has This Been Tested?

Regression Tests

  • Verified the creation of end-user VMs without multi-queue
  • Verified the creation of end-user VMs with multi-queue
  • Verified the possibility of unplugging NICs for end-user VMs

Validations for the multi-queue parameters

  • Verified new validations added for the createNetworkOffering and cloneNetworkOffering commands, including:
    • When multi-queue parameters are informed for L2 network offerings
    • When the publicmultiqueuenumber parameter is informed for tier offerings
    • When non-positive values different than -1 are informed for multi-queue parameters
  • Verified new validations added for the createVpcOffering and cloneVpcOffering commands, including:
    • When invalid values are specified for the publicmultiqueuenumber and privategatewaymultiqueuenumber parameters

Multi-queue for isolated networks VRs

  • Created a network offering with private multi-queue equal to 2 and public multi-queue equal to 5
    • Created a network with this offering
    • Verified that multi-queue was correctly applied for the VR NICs
    • Cleaned up the network and verified that multi-queue was applied correctly for the new VR
  • Created a system offering for VRs with 2 vCPUs
    • Created a network offering with private and public multi-queue equal to -1 and associated the offering with the VR offering
    • Created a network with this offering
    • Verified that the multi-queue applied to the VR's NICs was equal to 2
    • Cleaned up the network and verified that multi-queue was applied correctly for the new VR

Multi-queue for shared networks

  • Created a shared network with the built-in ACS offering
    • Verified that multi-queue was not applied for the VRs NICs
  • Created a shared network offering with NAT, public multi-queue equal to -1 and private multi-queue equal to 3
    • Created a network with this offering
    • Verified that multi-queue was correctly applied for the VR's NICs
    • Cleaned up the network and verified that multi-queue was applied correctly for the new VR

Multi-queue for VPCs

  • Created a VPC with the built-in ACS offering
    • Verified the creation of tiers
    • Verified the creation of private gateways
  • Created a VPC offering with public multi-queue equal to -1 and private gateway multi-queue equal to 6
    • Created a VPC with this offering
    • Verified the multi-queue value applied to the public NIC
    • Added a private gateway and verified the applied multi-queue NIC
    • Created a tier offering with multi-queue equal to 3
    • Verified that the VR's NIC corresponding to the tier had the correct multi-queue value
    • Cleaned up the VPC and verified that multi-queue was applied correctly
    • Created another tier offering with multi-queue equal to -1
    • Verified the multi-queue value applied to the NIC corresponding to the new tier

@bernardodemarco

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 15.91837% with 206 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.91%. Comparing base (58fda71) to head (281c155).

Files with missing lines Patch % Lines
...tack/engine/orchestration/NetworkOrchestrator.java 0.00% 75 Missing ⚠️
...ain/java/com/cloud/network/vpc/VpcManagerImpl.java 19.23% 20 Missing and 1 partial ⚠️
.../router/VpcVirtualNetworkApplianceManagerImpl.java 0.00% 20 Missing ⚠️
...ervisor/kvm/resource/LibvirtComputingResource.java 26.08% 13 Missing and 4 partials ⚠️
.../cloud/configuration/ConfigurationManagerImpl.java 61.90% 10 Missing and 6 partials ⚠️
api/src/main/java/com/cloud/vm/NicProfile.java 0.00% 6 Missing ⚠️
.../command/admin/network/NetworkOfferingBaseCmd.java 0.00% 6 Missing ⚠️
...ck/api/command/admin/vpc/CreateVPCOfferingCmd.java 0.00% 6 Missing ⚠️
...oudstack/api/response/NetworkOfferingResponse.java 0.00% 6 Missing ⚠️
...e/cloudstack/api/response/VpcOfferingResponse.java 0.00% 6 Missing ⚠️
... and 12 more
Additional details and impacted files
@@             Coverage Diff              @@
##              main   #14378       +/-   ##
============================================
+ Coverage     3.86%   20.91%   +17.05%     
- Complexity       0    21149    +21149     
============================================
  Files          494     6057     +5563     
  Lines        42888   549789   +506901     
  Branches      8141    73531    +65390     
============================================
+ Hits          1657   115010   +113353     
- Misses       40999   421327   +380328     
- Partials       232    13452    +13220     
Flag Coverage Δ
uitests 3.85% <ø> (-0.01%) ⬇️
unittests 22.36% <15.91%> (?)

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.

@blueorangutan

Copy link
Copy Markdown

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

@bernardodemarco

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@Damans227

Damans227 commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

thanks @bernardodemarco, the 256 cap and the -1 guard look right. nothing else from me

@blueorangutan

Copy link
Copy Markdown

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

@bhouse-nexthop

Copy link
Copy Markdown
Collaborator

@bernardodemarco could we also have a global/zone setting as the fallback when the offering leaves these unset? Right now every existing offering (including the defaults) is NULL, there's no update API for the new fields, so turning this on fleet-wide means cloning every offering or editing the DB.

Something like:

static final ConfigKey<Integer> VrNicMultiqueueNumber = new ConfigKey<>(Integer.class, "router.nic.multiqueue.number",
        "Advanced", null, "Multiqueue number for VR NICs when the offering does not set one. -1 = one queue per vCPU; unset = single queue.",
        true, ConfigKey.Scope.Zone, null);

Order would be: offering value → this setting → single queue.

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

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

@bernardodemarco

Copy link
Copy Markdown
Member Author

@bhouse-nexthop, thanks for the review! I believe I addressed all suggestions... Is there anything else from your side?

@bernardodemarco

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@bernardodemarco

bernardodemarco commented Nov 26, 2026 •

Copy link
Copy Markdown
Member Author

@RosiKyu, @nvazquez, since the 4.24 release will be kept opened for new features until the last week of December, I'll change the milestone for this one. I hope we'll be able to merge it by then...

@blueorangutan

Copy link
Copy Markdown

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

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.

5 participants