-
-
Notifications
You must be signed in to change notification settings - Fork 165
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 io.bus
and io.cache
for shared filesystems with VMs
#599
Comments
I was told that incus did not support passthrough of block devices into VMs. which is why I've been using filesystems instead. Will love trying to switch this way between 9p and virtiofs anyway. |
@gl-yziquel Not sure who told you that :) You can definitely do:
Which will expose the disk at /dev/XYZ as an NVME device inside of the VM. Just the usual caution around not using the same disk from both host and guest or with multiple guests, unless you're using a clustered filesystem or use it read-only everywhere. |
Various blog posts. Don't remember precisely which.
Thank you. I'll try it as soon as possible. Though I've been reluctant to do so as I fear using a raw block device through a stack I don't fully understand. And I'd need to buy hardware to back up that disk behind the block device if I had to things properly. Any "risk" of corrupting a 40 TiB USB ZFS drive by passing it through a block device into incus without a backup ? (Why do I believe this is silly question, all the more an off topic one...)
Not quite an NVME...
I don't plan to. Anyhow, the Thank you very much. Sidenote: when playing with what will become
Bummer: I need both rust code and big IO... can't have both. I'm really not an expert in such issues, but I'm under the impression that this mmap stuff over virtiofs is what is called the "DAX window" allowing qemu's process to allocate memory for such an mmap. Some kind of dance played by qemu and virtiofsd there that I do not understand. Links to where I analysed this issue very much superficially: cross-rs/cross#1313 (comment) (If I can't have both, I'll have to try the block device pasthrough.) |
So long as it's not mounted anywhere but inside the VM, it'll be fine.
That doesn't matter, io.bus refers to how it will appear inside of the VM, not how it's connected to the host. So you can totally use NVME for a floppy disk if you want ;)
I'm also no expert on virtiofs but I know that they have a special |
Any reference to where these patches are would be highly appreciated. Here ? https://gitlab.com/virtio-fs/qemu/-/tree/dax-2022-05-17-qemu7.0 If so, 2022 seems indeed to not quite be up to date. Trying out a quick build of it, just to see... |
I just pulled out a fix for rustc itself: We'll see if it gets merged. A member of the rust team seems pretty hostile to "buggy filesystems" (i.e. virtio-fs) and seems to believe it's ok if rustc doesn't run with virtiofsd --cache=never. Anyhow, MAP_SHARED in mmap() is not supported with virtiofsd --cache=never, which is a wider issue than rust (where it just so happens that it materialises more often because it's more of a default.) |
https://lists.gnu.org/archive/html/qemu-devel/2021-04/msg05680.html is what I had found, yours looks a bit more recent but still quite out of date :) |
No. I do not see a /dev/XYZ. I do see some /dev/nvme0n1p1, this I do, but I see nowhere this xyz device name. I'm wondering if that xyz even means something and is observable in the guest. I can't spot any xyz in the guest. |
The source path isn't visible in the guest, you can however see the device name in the guest.
The source path ( |
I've multiple devices that I try to make passthroughs for in that VM. The device that are assigned, like /dev/nvme[012]n1 are assigned randomly when it comes to the mapping with the host. How do I get them assigned predictively ? Is it even possible ? EDIT: ah ! yes... that is what /dev/disk/by-id can be used for... |
Hi, my group and I are looking to take on this issue for our Virtualization class. Can you please assign it to me and offer any insight as to how to best approach this implementation? |
This should be reasonably straightforward, it's all changes to be done in |
@sharkman424 do you still intend to work on this one or should I clear the assignee? |
You can clear the assignee, apologies. |
No worries! |
Hey @stgraber, I'd like to work on this issue, could you assign this issue for me?🙇🏻♂️ |
Done! |
Closes lxc#599 Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Closes #599 Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Currently
io.bus
andio.cache
are restricted to block volumes being exposed to VMs.io.bus
offersnvme
,virtio-scsi
andvirtio-blk
whileio.cache
offersnone
,writeback
andunsafe
.That's all fine for blocks, but we've recently had requests to do something similar for filesystems.
In those cases,
io.bus
should be:auto
(default, both9p
andvirtiofs
but silently skipvirtiofs
if not available)9p
(9p
only)virtiofs
(virtiofs
only, fail if not available)And
io.cache
should be made to map tovirtiofsd
cache options:none
(default, map tocache=never
)metadata
(map tocache=metadata
)unsafe
(map tocache=always
)The text was updated successfully, but these errors were encountered: