Bug 2109643

Summary: [RFE] Mechanism for determining preferred CPU model
Product: Red Hat Enterprise Linux 9 Reporter: sgott
Component: libvirtAssignee: Tim Wiederhake <twiederh>
libvirt sub component: General QA Contact: Luyao Huang <lhuang>
Status: CLOSED NOTABUG Docs Contact:
Severity: urgent    
Priority: unspecified CC: ailan, fdeutsch, jsuchane, lmen, twiederh, virt-maint, xuzhang
Version: unspecifiedKeywords: FutureFeature, Triaged
Target Milestone: rcFlags: ailan: needinfo? (twiederh)
ailan: needinfo? (twiederh)
ailan: needinfo? (jsuchane)
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-12 09:56:24 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1856522    
Bug Blocks:    

Description sgott 2022-07-21 16:56:44 UTC
Description of problem:

In the context of migration, CNV is trying to determine the best baseline CPU model to use. The idea would be that all nodes could default to this model if one is not otherwise defined for a VM. This would ensure a higher degree of compatibility with respect to migrating VMs between nodes. It's possible with existing APIs to determine the common subset of CPU models that nodes might have, but past that there's no hint to help decide which one might be preferred. For instance, newer CPUs generally have more features than older ones.

While an arbitrary static list of prefered models could be determined at the CNV level, it's going to get out of date over time. It would likely be better if libvirt or qemu were able to provide some mechanism for helping decide which CPU model would be preferred from a group of models.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 3 Tim Wiederhake 2022-10-07 17:52:42 UTC
I am not sure that I understand the question correctly. The nodes' domain capabilities (`virsh domcapabilities > domcap_$HOSTNAME.xml`) can be used to calculate the baseline cpu model that is compatible with all nodes (`cat domcap_*.xml | virsh hypervisor-cpu-baseline /dev/stdin --migratable`). This cpu model enables all features that are present on all nodes and would be the "best".

Comment 4 Fabian Deutsch 2022-10-10 07:52:49 UTC
Hi Tim, a fair point.

Will the baseline CPU recommendation always only be one CPU?
If it might recommend multiple, then we'll need the ability to understand which the most recent one is.

Comment 5 Tim Wiederhake 2022-10-10 17:08:17 UTC
There will always be exactly one baseline (or none, in case there is no cpu model that is compatible with all nodes).

Note that this cpu model might not have a physical counterpart, ie. not be exactly one of the named cpu models. It will most likely be something equivalent to "CPU XYZ plus features A, B, and C". Append "--features" to the call to "virsh hypervisor-cpu-baseline ..." to get a full list of features in the resulting cpu models.

Comment 7 Jaroslav Suchanek 2023-07-12 09:56:24 UTC
There is nothing actionable here, I believe Tim's comment 5 provided the required answer. Please note that the cpu models handling in libvirt is being refactored and will be part of large scale of changes. Related feature requests will be created accordingly.