-
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
Add support for USB Disks #8159
Conversation
/retest-required |
Hey @acardace I am curious, what are the use-cases for usb disks? |
/retest-required |
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.
Looks pretty good. Two minor things.
//In ppc64le usb devices like mouse / keyboard are set by default, | ||
//so we can't disable the controller otherwise we run into the following error: | ||
//"unsupported configuration: USB is disabled for this domain, but USB devices are present in the domain XML" | ||
if !isAMD64(c.Architecture) { |
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.
@zhlhahaha I wonder if we thought about this place also for arm.
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.
Yes, that'd be interesting, I've left it as it was but this check could be specialized for ppc64le if there's no need for it in other arches different than x86_64.
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.
Usb storage is not supported by the qemu-kvm binary on Arm64, we only support following storage devices.
Storage devices:
name "scsi-block", bus SCSI, desc "SCSI block device passthrough"
name "scsi-cd", bus SCSI, desc "virtual SCSI CD-ROM"
name "scsi-disk", bus SCSI, desc "virtual SCSI disk or CD-ROM (legacy)"
name "scsi-generic", bus SCSI, desc "pass through generic scsi device (/dev/sg*)"
name "scsi-hd", bus SCSI, desc "virtual SCSI disk"
name "vhost-user-fs-device", bus virtio-bus
name "vhost-user-fs-pci", bus PCI
name "virtio-blk-device", bus virtio-bus
name "virtio-blk-pci", bus PCI, alias "virtio-blk"
name "virtio-blk-pci-non-transitional", bus PCI
name "virtio-blk-pci-transitional", bus PCI
name "virtio-scsi-device", bus virtio-bus
name "virtio-scsi-pci", bus PCI, alias "virtio-scsi"
name "virtio-scsi-pci-non-transitional", bus PCI
name "virtio-scsi-pci-transitional", bus PCI
So I think USB Disks
may not work on Arm64.
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.
There are so many limitation caused by qemu-kvm binary on Arm64, so I think if it is possible to build qemu-kvm in a normal way rather than removing so many devices. @rmohr
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.
@zhlhahaha do we need to fail admission of VMIs with USB disks on Arm64 then?
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.
@zhlhahaha do we need to fail admission of VMIs with USB disks on Arm64 then?
I think so.
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.
Ah! I think this PR will do: #7007
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.
Ah! I think this PR will do: #7007
Yes
Thanks for the details, I was hoping for some more concrete examples where we saw someone blocked or where adding an usb disk upfront helped debugging somehow. Do you know about some cases? |
The best example I can think of is debugging a USB device kernel driver or the USB emulation code in qemu. |
/lgtm lgtm for the code. Not approving yet. Adding @davidvossel and @vladikr to hear their opinion about this, since we don't seem to have an immediate use-case for this. |
/cc @davidvossel |
/test pull-kubevirt-e2e-k8s-1.22-sig-compute-migrations |
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.
Code LGTM, just a couple concerns about ARM and comment wording.
Also, functional tests are failing because of an obsolete helper function.
tests/migration_test.go
Outdated
) | ||
|
||
By("Starting the VirtualMachineInstance") | ||
vmi = runVMIAndExpectLaunch(vmi, 240) |
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.
@acardace this function doesn't exist anymore, which is why the tests fail
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.
thanks, didn't rebase against master in my local workspace :)
|
||
//usb controller is turned on, only when user specify input device with usb bus, | ||
//otherwise it is turned off | ||
//In ppc64le usb devices like mouse / keyboard are set by default, |
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.
This comment seems to assume that the only USB devices are input devices, which is not true anymore.
It's also hard to read, probably worth reworking...
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.
I just removed the first 2 lines, thanks for noticing that.
Signed-off-by: Antonio Cardace <acardace@redhat.com>
Legit failure: https://prow.ci.kubevirt.io/view/gs/kubevirt-prow/pr-logs/pull/kubevirt_kubevirt/8159/pull-kubevirt-e2e-k8s-1.23-sig-compute-migrations/1559846596550594560 |
With this patch volumes can be attached to a VMI as USB mass storage devices. adjust existing Disk tests and add a new e2e one specific to USB disks. Signed-off-by: Antonio Cardace <acardace@redhat.com>
/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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jean-edouard 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 |
@rmohr can you take another look? I just had to rebase pretty much. |
Seems like no objections to adding usb disk support. /lgtm |
/retest |
@acardace: The following test failed, say
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. I understand the commands that are listed here. |
/retest-required |
What this PR does / why we need it:
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:
Release note: