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
Make sure all the necessary HyperV enlightements can be configured #1919
Comments
@davidvossel @rmohr @vladikr Guys, do you have any recommendation about what to do about englightements that need to be part of the API, but are not yet supported by our qemu/libvirt? We need to expose those in common templates, but we must not put them to libvirt XML until all the nodes are updated to recent enough versions of kernel / qemu / libvirt. Otherwise we would compromise the ability to start or migrate VMs. oVirt has a "feature gate" for synic for example. Or we could use Node feature discovery approach and expose the supported features on nodes. The launcher would then use proper nodeSelector to make sure the VM will never end up on a node that does not support the necessary flags. Would one or both approaches combined be acceptable for kubevirt? |
NFD approach sounds good to me, though I wouldn't do it just yet for this particular case, we still do not have to bother much with upgrades. But in general yeah, NFD-like discovery of capabilities of kubevirt/libvirt/qemu sounds like a reasonable idea. I would eventually suggest to use some sort of grouping (likein oVirt case the cluster levels) to not have too many of them. It might be a good idea to expose "kubevirt_1.4" or something like that and implement a similar feature gate using that single label |
We control what version of qemu and libvirt we ship. We shouldn't be in a situation where we add something to our API that isn't supported by our version of qemu/libvirt. So from a qemu/libvirt perspective, I don't see a problem. The API updates will be coupled with the qemu/libvirt update. The only thing I'd be concerned about detecting is node level kernel features that are required for these features to work. Thats where NFD makes sense to me. |
not on upgrades. In upgraded environments you will have VMs running with older images. They should keep running (i.e. stop/start, suspend/resume) with guest ABI being preserved - with older qemu/libvirt image - until VMs are explicitly "upgraded" to new version by admin/user. |
@davidvossel Michal already mentioned the issue with long running older VMs. But there is another issue as well. You might not have enough nodes with the proper kernel version to be able to get the synic support for the VMs you want to start. In that case you should be able to disable the feature to be able to start the VMs everywhere even though some optimization would be off. Also the templates in general do not know which version of kubevirt is used and whether the feature is or is not supported by the node. So I would prefer if we could consider some of those flags (not just hyperv btw) a soft requests - meaning supported by API, but used only when all components align properly. |
how is this an issue? The if the VM is running, then it's already been scheduled. If the VM running is old (before the API update occurred) then it couldn't be using new features added after an update. If the VM's offline config is changed to use the new features, then when the VM is restarted, the new container/scheduling that supports the api is used from the update. There's no situation where the admin has control over the VM's container image between restarts on a per VM basis. The container image associated with the KubeVirt release that is installed will always be used.
If the templates attempt to set an API field that the current kubevirt install doesn't know about, that template will get rejected at validation.
that's fine if we need to do that, but we'll have to be certain to structure these flags in the API in a way that communicates that these flags are Requests and not Requirements. It's possible for this field we may want to have two structures, one that flag requests and one for flag requirements. This would allow the user to explicitly define what their intent is. |
right, that is something which needs to be done in a controlled way, separately from the time of kubevirt infra upgrade. I guess it's rather a problem for templates and how/when they are applied than kubevirt core. |
@MarSik : I want to hide HyperV from kubevirt VM, how can I achieve that? To do so, in libvirt XML I would add something like:
For QEMU the option is Is it supported by kubevirt features yet? |
@x8091 right now you can use a side-car to manipulate the resulting domain xml. We have an example which modifies the domain XML here: https://github.com/kubevirt/kubevirt/tree/master/cmd/example-hook-sidecar. In order to have a more "supportable" solution, we would need to add it to kubevirt. Why exactly do you need this? |
Thank you very much @rmohr. So I'm testing GPU passthrough feature using kubevirt, the GPU is visible to the VM (using I have verified the solution by using virt-manager and virsh tool to edit domain XML. Back to this, besides side-car you mentioned do we have another way/trick to pass this parameter to QEMU inside virt-launcher? I would like to verify if it works first before going to a complete solution. Thanks again. |
I fear that this is our "quick" way. You can just checkout this repo, change the portion of the code which modifies the domain XML, push the sidecar to a container registry and use it when starting the VM. |
Thanks for confirming. I'm going to try that now to see if it help. |
This is the first time I try Sidecar feature-gate, I have problem create a sample VMI
Here is VMI yaml file
I have tried with different version of docker images but got the same issue. What am I doing wrong here? I enabled Sidecar feature gate already. Assuming this sample works, for my case, I need to write my own sidecar-hook container image to modify domain XML file, is that correct? |
We currently have 2 API versions of the hook,
yes |
Perfect @slintes. It works nicely now. Thanks a lot. |
testing NVIDIA GPU passthrough , driver error code 43 . |
kubevirt not support set features.kvm.hidden = on |
/kind enhancement
Windows guest's performance depends on the configuration of the HyperV enlightements. There are quite a few that might need to be or not to be enabled for different Windows versions to perform properly.
Kubevirt API exposes those using the
VM.spec.template.spec.domain.features.hyperv
dictionary.You can get the idea from couple of Red Hat bugs like:
To make this easier to read, the current list of qemu names for the englightements are:
Please note some of those can only be enabled when the qemu + libvirt + host kernel provide the necessary support or the guest VM will not start (synic, stimer are such example).
Also it might be a good idea to make this a bit more generic to allow adding new ones in an easy way.
The text was updated successfully, but these errors were encountered: