Skip to content

Conversation

nvazquez
Copy link
Contributor

@nvazquez nvazquez commented Sep 3, 2025

Description

This PR allows passing the OS type machine for KVM XML domains through the VM setting with name: kvm.guest.os.machine.type.

Fixes: #11512

Specifically, this allows fixing UUID retrieval of Windows VMs on Ubuntu 24 when passing the machine type = 'pc-i440fx-8.0' (see #11512 and https://gitlab.com/libvirt/libvirt/-/issues/807#note_2724045702)

Screenshot 2025-09-03 at 1 05 01 PM
# virsh dumpxml 108 | grep machine
    <partition>/machine</partition>
    <type arch='x86_64' machine='pc-i440fx-8.0'>hvm</type>
Screenshot 2025-09-03 at 11 58 40 AM

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?

Tested on Ubuntu 24 KVM host - deploying Windows VM and retrieving the UUID through the wmic command

How did you try to break this feature and the system with this change?

Copy link

codecov bot commented Sep 3, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.36%. Comparing base (3d6ec29) to head (3c1064b).

Files with missing lines Patch % Lines
...ervisor/kvm/resource/LibvirtComputingResource.java 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11569      +/-   ##
============================================
- Coverage     17.36%   17.36%   -0.01%     
+ Complexity    15237    15236       -1     
============================================
  Files          5888     5888              
  Lines        525741   525743       +2     
  Branches      64164    64165       +1     
============================================
- Hits          91274    91270       -4     
- Misses       424167   424172       +5     
- Partials      10300    10301       +1     
Flag Coverage Δ
uitests 3.63% <ø> (ø)
unittests 18.39% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@nvazquez nvazquez force-pushed the 420-ub24-fix-uuid-winvm branch from cd9929f to 019c925 Compare September 3, 2025 15:52
@nvazquez nvazquez marked this pull request as ready for review September 3, 2025 15:59
@nvazquez
Copy link
Contributor Author

nvazquez commented Sep 3, 2025

@blueorangutan package

@blueorangutan
Copy link

@nvazquez a [SL] 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.

@nvazquez nvazquez changed the title [KVM] Fix for UUID retrieval of Windows VMs on Ubuntu 24 [KVM] Allow passing the OS type machine for KVM XML domains through VM setting Sep 3, 2025
Copy link

github-actions bot commented Sep 3, 2025

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

@nvazquez nvazquez changed the base branch from 4.20 to main September 3, 2025 16:19
@nvazquez
Copy link
Contributor Author

nvazquez commented Sep 3, 2025

@blueorangutan package

@blueorangutan
Copy link

@nvazquez a [SL] 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 [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 14836

@blueorangutan
Copy link

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

@nvazquez
Copy link
Contributor Author

nvazquez commented Sep 3, 2025

@blueorangutan test

@blueorangutan
Copy link

@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@weizhouapache
Copy link
Member

@nvazquez
maybe machine.type, not type.machine

Can it be set by regular user ?

@Pearl1594
Copy link
Contributor

Pearl1594 commented Sep 3, 2025

Would it make sense to have a documentation PR - adding a note on the limitation with retrieving UUID on a Windows VM, and how it can be mitigated using this @nvazquez.

@weizhouapache
Copy link
Member

@nvazquez
should the target branch be 4.20 ?

@weizhouapache weizhouapache added this to the 4.20.2 milestone Sep 3, 2025
@nvazquez
Copy link
Contributor Author

nvazquez commented Sep 4, 2025

Thanks @Pearl1594 I'll create a doc PR for that.

@weizhouapache as discussed offline let's keep it targeted to main branch to avoid feature loss on upgrade to 4.21

@rohityadavcloud rohityadavcloud changed the base branch from main to 4.20 September 4, 2025 11:05
@rohityadavcloud rohityadavcloud changed the base branch from 4.20 to main September 4, 2025 11:05
@rohityadavcloud
Copy link
Member

@nvazquez is this worth raising the PR for 4.20 branch, could you check & change the base branch?

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; ideally the machine type could be detected automatically though?

@blueorangutan
Copy link

[SF] Trillian test result (tid-14206)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 55385 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11569-t14206-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@jmgsky
Copy link

jmgsky commented Sep 4, 2025

This looks like it will fix my issue with booting a Juniper VSRX on cloudstack, but I think an option to set other parameters on the underlying qemu virtual machine would be more sustainable.

Specifically, you can set smbios-entry-point-type on the machine (even newer i440fx-8.2 and beyond) and have it still use the older 32-bit smbios 2.x interface. Here is the best example I can find of it's usage with qemu.

@weizhouapache
Copy link
Member

@nvazquez is this worth raising the PR for 4.20 branch, could you check & change the base branch?

@rohityadavcloud
I have discussed with @nvazquez , our concern is, when users upgrade from 4.20.2 (assume this PR is included) to 4.21.0 (released already), the setting will be gone.

my opinion is, unless very necessary, let's not introduce new api params, api responses, settings or db changes in minor versions.

@nvazquez
Copy link
Contributor Author

nvazquez commented Sep 4, 2025

Hi @jmgsky thanks for your input. I think that can be addressed on a separate PR.
I couldn't find references for this attribute on the libvirt documentation, but seems it should be wrapped as a feature on the XML domain. Can you please confirm if this snippet looks correct for a running domain?

<type arch='x86_64' machine='pc-i440fx-8.0'>hvm</type>
<features>
   <sm-bios-entry-point-type value='32'/>
</features>

@jmgsky
Copy link

jmgsky commented Sep 4, 2025

@nvazquez - I'm actually not sure if that's right or not. I was trying to do it with extraconfig and qemu:args, but my VM wouldn't even start at that point. I switched to testing using virsh edit manually, and it doesn't like that xml snippet or qemu:args, so I'm honestly not even sure if there's a way to achieve that with libvirt.

@nvazquez
Copy link
Contributor Author

nvazquez commented Sep 4, 2025

@jmgsky thanks, the extraconfig will attempt to append the snippet as well on the XML domain, should have similar results than editing the XML directly. I couldn't find it mentioned on: https://libvirt.org/formatdomain.html, however checking the example you mentioned can you try the following?

<type arch='x86_64' machine='pc-i440fx-8.0' sm-bios-entry-point-type='32'>hvm</type>

@weizhouapache weizhouapache modified the milestones: 4.20.2, 4.22.0 Sep 5, 2025
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.

Unable to retrieve UUID of windows VM using wmic command
6 participants