-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
VM: Add CPU model struct to domain #11852
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @crazytaxii. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: HF <crazytaxii666@gmail.com>
type CPU struct { | ||
Check string `xml:"check,attr,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this value populated somewhere in the converter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently there is none, but libvirt domain XML has this value.
@@ -273,9 +273,16 @@ type VCPUs struct { | |||
VCPU []VCPUsVCPU `xml:"vcpu"` | |||
} | |||
|
|||
type CPUModel struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this struct? Or at least all the values. You are only setting the Value in the converting and not the rest
@crazytaxii why do we need this? Can you give us some details? Are you worry that the CPUModel info is parsed wrongly? |
/cc @victortoso seems like another change who would need libvirtxml |
@alicefr: GitHub didn't allow me to request PR reviews from the following users: need, would, another, change, who, seems, like. Note that only kubevirt members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
+1 |
about I export a domain XML from actual running VMI: <cpu mode='custom' match='exact' check='full'>
<model fallback='forbid'>Cascadelake-Server</model>
<vendor>Intel</vendor>
</cpu> about We found Windows VMs running on Hygon CPU, libvirt domain XML must be written as: <cpu mode='custom' match='exact' check='none'>
<model fallback='forbid' vendor_id='AuthenticAMD'>EPYC</model>
</cpu> Otherwise, The Windows will blue screen. The Original CPU model field is too simple to do that. |
In our customized KubeVirt codes, I firstly detect CPU vendor of the host and define special domain XML on hosts with Hygon processors: <cpu mode='custom' match='exact' check='none'>
<model fallback='forbid' vendor_id='AuthenticAMD'>EPYC</model>
</cpu> The Vendor ID and CPU model value is clearly customized, but the model struct is common, according to https://libvirt.org/formatdomain.html#cpu-model-and-topology. So I want to improve the scalability of |
The problem is published on my blog, but it's written in Chinese 😥. |
Hi @crazytaxii thanks for clarifying your use case.
Just to be 100%, that means that using plain I'm inclined to think this is a libvirt bug or at least we should understand why you need to set check to
Are you using sidecars for that? That is, even without adding extra fields to schema.go you could apply these configs with a sidecar and that should work as well. |
No, we use
No, we just change the virt-launcher's convertor code. |
libvirt and qemu will pass-through the CPU vendor of host if it's undefined in domain XML. For example: <cpu mode='custom' match='exact' check='full'>
<model fallback='forbid'>Cascadelake-Server</model>
<vendor>Intel</vendor>
</cpu> The CPU vendor of VM will be the same as host. |
Instead of modify virt-launcher code you should rely on sidecars as Victor suggested. |
OK |
What this PR does
Add latest CPU model struct to domain.
Before this PR:
After this PR:
According to https://libvirt.org/formatdomain.html#cpu-model-and-topology:
Why we need it and why it was done in this way
Update CPU model struct to latest.
Release note