Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KVM: add vm setting for nic multiqueue number and packed virtqueues #7333

Conversation

weizhouapache
Copy link
Member

Description

This PR adds two vm setting for user vms on KVM

  • nic multiqueue number
  • packed virtqueues enabled . optional are true and false (false by default). It requires qemu>=4.2.0 and libvirt >=6.3.0

Tested ok on ubuntu 22 and rocky 8.4

(See test results in Screenshots part)

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)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Screenshots (if appropriate):

  • Deploy a vm
    There are two new options in "Advanced mode" part.
    image

  • Start the vm. check qemu process on kvm host
    image
    it shows

-netdev tap,fds=57:59:60:61:62:63,id=hostnet0,vhost=on,vhostfds=64:65:66:67:68:69 
-device virtio-net-pci,packed=on,mq=on,vectors=14,netdev=hostnet0,id=net0,mac=02:00:3f:4f:00:0a,bus=pci.0,addr=0x3

(vectors = 2 * queue number + 2)

  • virsh dumpxml shows <driver queues='6' packed='on'/>
    image

  • log into the vm, and run some commands
    image

image

image

  • enable multiqueue inside user vm
    image

image

@weizhouapache
Copy link
Member Author

This works on centos7 as well.

but centos7 with tap device does not work. got an exception

org.libvirt.LibvirtException: Unable to create tap device tap0200492f0004: Invalid argument

@codecov
Copy link

codecov bot commented Mar 14, 2023

Codecov Report

Merging #7333 (b2a1b9c) into main (f64f7b9) will increase coverage by 0.00%.
The diff coverage is 30.00%.

@@            Coverage Diff            @@
##               main    #7333   +/-   ##
=========================================
  Coverage     12.68%   12.69%           
- Complexity     8654     8656    +2     
=========================================
  Files          2716     2716           
  Lines        256117   256165   +48     
  Branches      39928    39944   +16     
=========================================
+ Hits          32499    32520   +21     
- Misses       219485   219501   +16     
- Partials       4133     4144   +11     
Impacted Files Coverage Δ
...ervisor/kvm/resource/LibvirtComputingResource.java 18.16% <0.00%> (-0.14%) ⬇️
...resource/wrapper/LibvirtPlugNicCommandWrapper.java 78.04% <0.00%> (-4.01%) ⬇️
...source/wrapper/LibvirtReplugNicCommandWrapper.java 79.24% <0.00%> (-3.11%) ⬇️
...ain/java/com/cloud/api/query/QueryManagerImpl.java 2.94% <0.00%> (-0.01%) ⬇️
...ypervisor/kvm/resource/LibvirtDomainXMLParser.java 50.19% <33.33%> (-0.42%) ⬇️
...pper/LibvirtPrepareForMigrationCommandWrapper.java 43.33% <50.00%> (+0.22%) ⬆️
...om/cloud/hypervisor/kvm/resource/LibvirtVMDef.java 67.35% <85.71%> (+0.21%) ⬆️

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 5723

Libvirt will automatically create the tap device.

This fixes the issue with tungsten vm with multi_queue on centos7
"Unable to create tap device tap1e002c000008: Invalid argument"
@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 5724

@sonarcloud
Copy link

sonarcloud bot commented Mar 15, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

30.2% 30.2% Coverage
0.0% 0.0% Duplication

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 5912

@borisstoyanov
Copy link
Contributor

@blueorangutan test keepEnv

@blueorangutan
Copy link

@borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@borisstoyanov
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@borisstoyanov a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@borisstoyanov
Copy link
Contributor

@blueorangutan test keepEnv

@blueorangutan
Copy link

@borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6016

@blueorangutan
Copy link

Trillian test result (tid-6499)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 45937 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7333-t6499-kvm-centos7.zip
Smoke tests completed. 109 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_10_reboot_cpvm_forced Error 6.28 test_ssvm.py

Copy link
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

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

LGTM, I've manually tested it and confirmed the failing test was passing in a separate run

Test force reboot CPVM ... === TestName: test_10_reboot_cpvm_forced | Status : SUCCESS ===

@weizhouapache weizhouapache marked this pull request as ready for review May 4, 2023 12:44
@weizhouapache
Copy link
Member Author

LGTM, I've manually tested it and confirmed the failing test was passing in a separate run

Test force reboot CPVM ... === TestName: test_10_reboot_cpvm_forced | Status : SUCCESS ===

great, thanks @borisstoyanov for the testing !

@rohityadavcloud rohityadavcloud added this to the 4.19.0.0 milestone May 8, 2023
Copy link
Member

@rohityadavcloud rohityadavcloud left a comment

Choose a reason for hiding this comment

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

LGTM did n't test it

@rohityadavcloud
Copy link
Member

Merging based on manual tests by @borisstoyanov, CI tests and reviews.

@rohityadavcloud rohityadavcloud merged commit 9d46df5 into apache:main May 9, 2023
@weizhouapache weizhouapache deleted the 4.18-kvm-support-multiqueue-and-packed branch June 23, 2023 13:10
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.

None yet

4 participants