-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Pass network firewall driver in use to the runtime for checkpoint/restore #24799
Comments
I not sure how checkpoint restore comes into play here. The netns inside does not contain any of our firewall rules so there is no reason whatsoever for criu to even attempt to store them. Same for the interfaces. I filled containers/crun#1210 a while ago for that and AFAIK runc already does not checkpoint the netns so there it should just work. Logically speaking I don't think it makes sense for podman to pass this info down as we do not want the netns to be checkpointed. |
I believe this is an issue because criu tries to do the "right" thing and drops all packets for a checkpointed container, so it might very well be that criu isn't checkpointing the netns but still attempting to drop packets for a checkpionted container.
FWIW, criu allows "skipping" [un]locking the network if you pass Either criu could simply default to skipping network locking or podman could implicitly instruct the runtime to "skip" by passing |
Ah I see I was assuming it is calling this in the netns but it actually tries to create the rule on the host namesapce! The issue is there is no easy way for podman to know the firewall driver, we do have We can certainly do that if deemed necessary but I rather avoid that.
IMO it likely would be best if criu itself does not hard depend on iptables default. Either let distro packages set the default or have some logic in criu to do But yeah I have no idea about user expectation here and how important such rule is. If we start setting skip from podman it means there is a chance for regressions for existing users wanting this. Also https://criu.org/TCP_connection#Checkpoint_and_restore_TCP_connection
I don't really understand that part. We are using a network namespace so that this mean it should not lock via iptables/nftables in that case? cc @adrianreber @rst0git Any opinions/suggestions here? |
Network locking and containers is a complicated discussion if it is necessary or not. It is necessary for migrating TCP connections at least. For Fedora we will switch CRIU to the nftables backend so that CRIU will do the right thing. I am not convinced about the new crun option. Does runc have it? I am not convinced this needs to be an option passed down through the stack. It is kind of the work a distribution does. Making sure the packages work together correctly. |
Is it possible to do both? I agree with letting the distros setting defaults for packages and having them play well together. At the same time, it'd be nice for criu to have a simple heuristic as mentioned by Paul where it tries the available backends in order and if nothing is available, skip locking altogether?
I'm testing the runc changes currently. |
A friendly reminder that this issue had no activity for 30 days. |
@adrianreber I'm probably missing something but aren't we using iptables as the default network lock method in criu unless until specified otherwise? We're also building our criu package with nftables support but I don't think that translates to criu simply using nftables as default. When podman tries to c/r, and given that we don't pass the network lock method down the stack presently, criu tends to fall back to iptables. |
@danishprakash you are right. Take a look at what I have been doing with CentOS Stream 10 RPMS: My plan is to provide an option to select the backend during build time so that it is not necessary to patch the source code. There have been a couple of important changes in CRIU upstream to correctly work with nftables. Please use them for your package also. If you have any more questions please reach out to me via email or via a CRIU github issue. |
Thanks for sharing that link. We could carry the same patch for now, but having a build time option, perhaps a makefile arg, would be quite helpful. |
Netavark supports nftables out of the box and it has also been set as default conditionally at least for fedora 41. At the same time, criu supports
--network-lock
to allow users to set the firewall driver of choice but defaults to iptables to perform network [un]locking. But which firewall driver is being used isn't being passed onto criu currently and so, if you build netavark with nftables on a system that doesn't have iptables installed, upon trying to checkpoint/restore a container, criu tries to use iptables utils and fails.--network-lock
support has been added to crun, and I'm testing the same changes for runc. What remains is to pass the firewall driver to the runtime from podman, @Luap99 on IRC mentioned that it's possible to get this info but it might not be straightforward, can we discussion possible solutions?The issue was caught during [open]QA when we started building netavark with nftables by default in Tumbleweed and removed our iptables dependency from podman in the process.
The text was updated successfully, but these errors were encountered: