-
-
Notifications
You must be signed in to change notification settings - Fork 368
feat: support NFS storage pools #2025
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
base: main
Are you sure you want to change the base?
Conversation
|
@stgraber if you have any opinions or pointers to the checkboxes feel free to look over and I can investigate a bit. I suspect some research needs to be done to figure out how we should interact with the uid/gid and squashing behavior of NFS mounts. |
|
Hi! Is this PR stalled? Do you need help? |
|
Ah, I just left a few comments in the Info function now. |
Well now you’re served :þ I can help review, fix stuff, and even write tests, don’t hesitate to ping me. I’d actually be happy to see it working pretty soon. |
|
@bensmrs thanks! I'll probably not touch this in July, and there is a hackercamp and work stuff happening in August on my end that might not allow me a lot of energy to pick this up after hours. I'd appreciate some pointers on the id remapping incus does and how that should play with the ID squashing NFS does. I think there should be some guidance and testing there to make sure it behaves as expected. It also takes a bunch of time which might not be needed if nfs reassings UID/GID anyway. If you have time to write tests and stuff I'd be happy to give you access to my fork. |
|
I don't believe that VFS idmap works on top of NFS at this point, so we'd be dealing with traditional shifting where Incus rewrites all the uid/gid as needed. What you want to ensure is that NFS is mounted the same way on all machines and that no uid/gid squashing is performed, then that should work fine. |
|
Should we call the driver |
|
I think we should stick to Exactly what kind of server version and configuration we can handle is probably something that's best addressed through the documentation for the driver. |
|
NFS would be SO nice. Just an interested party! |
b617326 to
49f1676
Compare
|
I did some changes so we can pass ipv6 What sort of testing do we want on this? Locally creating pools and creating contianers and VMs work. Also attaching additional volumes. |
We’d basically extend the available filesystem drivers in the test matrix, to test everything we’re already testing: incus/.github/workflows/tests.yml Lines 137 to 144 in f614b4c
The tests initialization routines allow you to define how your driver should be initialized in |
0080a77 to
7070ad5
Compare
|
I started looking at the tests and am a bit confused by the following error: Did I do something wrong here? |
Uhh, so it turns out that the
I was thinking mimicking the behavior of |
No problem, I ended up using
Ok I can’t beat this argument :) I’m getting some permission denied errors in my tests, I’m investigating. |
|
So, maybe I’m missing something when initializing the pool, but I can’t get past permission errors. Container creation and launch work well, but that’s not enough, see https://github.com/bensmrs/incus/actions/runs/18648669885/job/53161380407?pr=4 Am I missing something in my setup? See incus/.github/workflows/tests.yml Lines 394 to 395 in 5733ce8
|
|
Hmmm, I've only tried |
|
Container launch works, so regular operations don’t seem to cause any problem. |
|
Well I’m currently out of ideas. |
|
And couldn’t an idmapped bind mount be a solution? The host mounts the NFS shares somewhere, then bind-mounts it to Or maybe it’s bindfs-specific, in which case we’re back to using FUSE… |
That's 1), idmap bind-mount requires per-filesystem kernel code to handle it. NFS does not have support for it. FUSE in general does but requires each filesystem to add some logic, which is why I also brought up 2) as a quicker option to get something done. |
|
Ok, I had in mind bindfs’ I’ll have a quick look at fuse-nfs. |
|
https://github.com/bensmrs/fuse-nfs should be ok-ish for FUSE3; I’ll try to implement VFS idmap tomorrow. |
|
My patches should now work (I also integrated a long-waiting PR that I feel is desirable for us), but testing it will probably be painful. Are there quick ways for me to test the patched libfuse, or do I have to compile @mihalicyn’s tree? (in which case, big meh on my side as I have little time for it). |
|
Cool! If we get this working, we'd probably do a scheme like |
|
@stgraber thanks for investigating the issue! Whats the proper way forward for this? Try the |
|
I think the next steps should be:
Given the new FUSE client is going to take a little while to be packed in all distros, I don't want us to be hard depending on it. On my end, I'll be happy to just build and ship the client as part of the Zabbly package, so we can at least get it out to a whole bunch of users (including folks using IncusOS) pretty rapidly while the distro packagers get it through to the other distros. |
I’d half-confidently say that my fork does that already. The blocker for me is to have a kernel with the necessary patches to make it run. I don’t really have time planned to build such a kernel before, say, december. I’d be more than happy to steal a disk image to deploy on my staging environment though ^^ |
Ah, what do you need on the kernel side? I thought we'd had FUSE VFS idmap for a bit now (6.12 apparently). |
|
I adapted the code from the patch you linked, which uses |
That's odd because I'm definitely seeing the commits in my clone of Linus' tree. |
|
I remember the build breaking when removing the version condition. Checking libfuse source code, d393ffa85b0926374c8df543a9ffc81b1d0ce232 suggests some kind of idmap support, but I’m not comfortable with Incus/Zabbly providing patched libfuse, though, so maybe a nudge to upstream would be good. |
|
Yeah, I don't mind doing the patched libfuse dance in /opt/incus/lib like we do some other libraries but that would be something I'd only really want to do after upstream has merged the needed support. I pinged @mihalicyn about it. |
|
And to think that it just started with “it would be nice to have NFS support” :D |
|
Yeah, that one became complicated pretty quick :) |
|
I took your word for it when you said it would "probably" be easy 🫠 |
|
It’s always nice when the issue on which you’ve been working for 6 month is marked “Easy” (which, may I remind the description, means “Good for new contributors”) :) |
Haha, yeah, the storage logic really should have been pretty easy, take the Now the underlying NFS protocol being annoying with idmap wasn't something I had seen coming ;) |
Said… no one? ever? |
Well, in this case it coming from more of a Windows world where UIDs/GIDs are not really a thing makes me hopeful that the protocol doesn't just carry the user cred and file details but instead has the kernel module handle the checks and then tells the remote storage what to write. If that's the case, then it should work fine here. NFS is only broken because it's too UNIX :) |
|
Ok, interesting. Now I’m curious too! |
|
@mihalicyn provided this one as an example of conversion https://gitlab.com/virtio-fs/virtiofsd/-/merge_requests/245/diffs |
|
I’m confused. What question are you answering with this message? |
How to get a FUSE filesystem to use the VFS idmap stuff without needing libfuse changes. |
|
Ok, I’ll see how this can be translated to my code then. |
|
So, after a frustrating attempt at making it work, I realized that even though the needed patches are in the main branch of libfuse, it’s not in any released version, so I need to compile libfuse myself. It also looks like Trixie’s stock kernel is not fit for these patches, so I also had to install the backported kernel. I should be nearing something that might work pretty soon (yeah, that doesn’t exude confidence). |
|
Well, I give up, I can’t get any of my attempts to work, even though the proper capabilities are advertised to and by FUSE. Either I’m missing a pretty obvious wiring, or something’s just not ready yet. I’ve left two branches on my fork, in case someone wants to have a look. |
WIP draft PR for the feature. So far it works, a bit slow on my machine due to the id remapping which should probably be investigated.
vers=4.2, should be fine?sourceInfoarray needs some QA. Not sure I understand all of it.nfscan't supportxattr, do we need to handle this in other places than migrate?Fixes: #1311