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
Support virtio-transitional for old guests #4730
Conversation
/cc @dankenigsberg |
/cc @vladikr |
/cc @maiqueb @AlonaKaplan This seems like a replacement of pull #3510. |
/retest |
1 similar comment
/retest |
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.
The commit msg heading in bbcb652 has a small typo - s/Table/Tablet/
Other than that, you've duplicated a parameter in the RNG 'converter' function.
Everything else lgtm.
@@ -659,10 +663,10 @@ func Convert_v1_Watchdog_To_api_Watchdog(source *v1.Watchdog, watchdog *Watchdog | |||
return fmt.Errorf("watchdog %s can't be mapped, no watchdog type specified", source.Name) | |||
} | |||
|
|||
func Convert_v1_Rng_To_api_Rng(source *v1.Rng, rng *Rng, _ *ConverterContext) error { | |||
func Convert_v1_Rng_To_api_Rng(c *ConverterContext, _ *v1.Rng, rng *Rng, _ *ConverterContext) error { |
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.
You already have here a *ConverterContext
as a nameless parameter - last parameter in the signature.
Shouldn't you just rename that one ?
I'm OK with reordering the parameters, but not w/ duplicating them.
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.
Fixed. I missed that it was there already.
Add the boolean flag to the API. If unset or set to false, `virtio` bus will internally converted to `virtio_non_transitional` for all devices. If set to true, `virtio_transitional` will internally be selected for all `virtio` buses. Signed-off-by: Roman Mohr <rmohr@redhat.com>
It is a replacement for the aforementioned PR.
The suggested solution is in-line with what was discussed in the aforementioned PR. |
The converter will set the model to `virtio-non-transitional` if `useVirtioTransitional` is undefined or false. If set to true, `virtio-transitional` models will be set. The only exception is `virtio-scsi` on the scsi controller which needs to stay this way. Additionally there exist newer devices which have no `virtio-transitional` implementation. KubeVirt does not support any of these devices at the moment. Therefore no extra protication is added for that. Signed-off-by: Roman Mohr <rmohr@redhat.com>
Signed-off-by: Roman Mohr <rmohr@redhat.com>
The converter is moved out of the package where the API is, to allow sharing validation methods between converter unit tests and functional tests. Without this change we have import cycles since importing the Domain API means importing the converter. Signed-off-by: Roman Mohr <rmohr@redhat.com>
Ensure that all components with virtio model are set to virto-transitional if requested and that the VM can still boot successfully. Signed-off-by: Roman Mohr <rmohr@redhat.com>
Signed-off-by: Roman Mohr <rmohr@redhat.com>
Tablet input devices always need to set virtio as model. Signed-off-by: Roman Mohr <rmohr@redhat.com>
virtio-transitional and virtio-non-transitional both lead to ``` {"component":"virt-launcher","level":"error","msg":"internal error: Cannot determine balloon device path","pos":"qemuMonitorInitBalloonObjectPath:1022","subcomponent":"libvirt","thread":"32","timestamp":"2020-12-31T08:40:38.917000Z"} ``` when trying to get memory stats. See https://bugzilla.redhat.com/show_bug.cgi?id=1911786 for details. Signed-off-by: Roman Mohr <rmohr@redhat.com>
cb7386f
to
9e08fd1
Compare
/retest |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vladikr The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
/cherrypick release-0.36 |
@rmohr: #4730 failed to apply on top of branch "release-0.36":
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. |
@rmohr sorry for being late to the party, I only found out about this PR now.
virtio-tablet is modern-only, so this makes sense. I wonder what will happen if you have
The bug has already been addressed upstream. Should we backport the fix to libvirt 6.6.0 and remove this special case? Is there enough time for that? IIUC this PR is going to be included in the upcoming 0.37, plus it has been backported to the already-released 0.36, but I have no idea what that means timeline-wise.
What's the rationale for treating virtio-scsi differently?
I might have missed it, but it doesn't look like there's any check on the machine type being performed. While it's true that for q35 machines virtio and virtio-non-transitional will behave the same, for pc machines virtio will behave like virtio-transitional instead, and I'm afraid explicitly choosing virtio-non-transitional will result in broken pc machines. But perhaps that's not considered a concern for KubeVirt? |
Yes, one can choose
The documentation (https://libvirt.org/formatdomain.html#virtio-transitional-devices) said:
I may have misunderstood it. It probably just meant that it never had
I did not know that. I probably missed it in the documentation. We only support |
Does that have to happen explicitly, though? My point is that setting
Yeah, the documentation is not very clear on the topic. I've just pushed a commit that improves upon it. https://gitlab.com/libvirt/libvirt/-/commit/85523cfae0be52868df26463650dd8e40a156fb9 The change should be reflected to the website in a while.
I'm not sure what the best course of action would be for KubeVirt, but I wanted to make sure you were aware of the potential issues with this implementation. |
@andreabolognani I will prepare a follow-up PR. Thanks for all the details. |
@rmohr great! What about the fix for RHBZ#1911786? Should I try to prepare a backport and update the virt-launcher container image accordingly? That'd force me to get at least somewhat familiar with the new bazel-based image building process O:-) |
A backport would be great. The more we can do to ensure the RHEL6 and CentOS6 is happy, the better.
Looking forward to your honest feedback ;) |
I am under the impression that transitional virtio supports both virtio<1.0 and virtio>=1.0 |
virtio-transitional is the implementation of the virtio 0.9x specification. virtio-non-transitional is virtio 1.0. We basically present different hardware to the guest. |
virtio transitional is magically both 0.9 and >=1.0. |
You are right, but still, from https://libvirt.org/formatdomain.html#virtio-transitional-devices:
if we don't want to manage the PCI topology completely ourselves, we should choose based on the OS. |
The new libvirt build contains a fix for https://bugzilla.redhat.com/show_bug.cgi?id=1918364 which is what forced virtio-balloon to be special-cased in kubevirt#4730 The new QEMU build contains assorted fixes, so let's bring that along for the ride. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
/cherrypick release-0.37 |
@enp0s3: new pull request created: #4872 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. |
The new libvirt build contains a fix for https://bugzilla.redhat.com/show_bug.cgi?id=1918364 which is what forced virtio-balloon to be special-cased in kubevirt#4730 The new QEMU build contains assorted fixes, so let's bring that along for the ride. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
The new libvirt build contains a fix for https://bugzilla.redhat.com/show_bug.cgi?id=1918364 which is what forced virtio-balloon to be special-cased in kubevirt#4730 The new QEMU build contains assorted fixes, so let's bring that along for the ride. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
The new libvirt build contains a fix for https://bugzilla.redhat.com/show_bug.cgi?id=1918364 which is what forced virtio-balloon to be special-cased in kubevirt#4730 The new QEMU build contains assorted fixes, so let's bring that along for the ride. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
What this PR does / why we need it:
Old guests like RHEL6 or CentOS6 require
virtio-transitional
in newer libvirt/qemu versions.Add a
spec.domain.devices.useVirtioTransitional
boolean which indicats which version ofvirtio
the virtual machine needs. It will then usevirtio-transitional
for all virtio devices of type:The following stay with their current value:
virtio-scsi
controllers have to stick withvirtio-scsi
tablet
input devices have to stick withvirtio
Finally if the
useVirtioTransitional
boolean is unset or false, we now exclititly translatevirtio
from the API tovirtio-non-transitional
to avoid ambiguities, since the termvirtio
is in most cases deprecated now in libvirt and can lead to different results based on different PCI(e) layouts.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
A big chunk of the code changes only extract the domain converter from the domain
api
package into theconverter
package. This was necessary to properly share validation code without import cycles (and improves the code structure).Release note: