-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
checkpoint restore: netns is not configured when a custom userns is used #18502
Comments
This comment was marked as resolved.
This comment was marked as resolved.
Ok I think #18468 should address it, however I still have problems with crun. crun can checkpoint but it fails to restore because the netns link is missing which is correct as podman will now only configure the netns after the oci runtime creates the container.
I am not sure how checkpoint/restore is exactly supposed to work with the netns. Does podman have to create these netns before we restore? I assume not because the same thing works with runc only crun complains. |
I think at this point nobody tested if checkpoint/restore works in combination with user namespaces. CRIU has support for user namespaces but I am not aware in how far it has been enabled in runc/crun. What you describe seems to be as expected. It is not implemented in crun and the runc implementations exists but has not been used much or at all. If used without user namespaces Podman has to create the network namespace and tell CRIU which network namespace is used and CRIU will restore the processes into that network namespace. |
That seems to be the case for crun but not runc. runc works fine with adding an empty netns and restore into that. Then podman configures the netns later. As this is the only way to ensure the netns is owned by the right userns, I would love if we could make crun work the same? |
In the case of runc is it in combination with a user namespace or without? Not sure if you are talking about the situation with or without a user namespace. Because for crun there is just no code at all to handle user namespace with checkpoint/restore.
Also for a restore? The container starts to run after the restore and the network namespace if changed while the container is running? That does sound like it will break things.
As mentioned before, crun has no user namespace support in combination with checkpoint/restore and the runc user namespace implementation is not really used. |
Both, in #18468 I try to make podman only use one code path for the network setup and obviously that means I have to go with the userns path every time.
Yes, ok this is a big blocker. I did not know restore would start it right away. So that means userns with netns + restore is impossible to support then.
Yes understood, with #18468 we do not use a userns but still try to setup the netns after the oci runtime. So based on the statement above this is something we should never do. I guess I have to revert to the previous behaviour for restore then. |
CRIU has the ability to restore a process into a stopped state. This is not exposed in runc/crun, but theoretically you could restore a process using A combination with the cgroup freezer could also be possible, although I am not sure if that will work. Never tried it and I am not sure you can restore a process in a frozen cgroup. If the cgroup frozen can CRIU run? CRIU uses the cgroup freezer (if available) during checkpointing to stop all processes at the same time. Another idea would be to extend CRIU to support restoring processes but instead of leave them all stopped put them in a frozen cgroup which Podman could then unfreeze. All these ideas, except the existing |
OK, thanks for the info. So far all I care about is #18468. I definitely have little interesting in addressing this in crun and runc. But it good to know that CRIU could do it. |
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
@Luap99 What should we do with this issue? |
Well it is up to oci runtimes to support this correctly so far crun does not seem support it (containers/crun#1207). I only found this while working on the network code, so far looks like no real users complained so I don't think this is a priority. |
Issue Description
The restore of a checkpoint for a container with uses a custom userns is not working correctly. The netns is not setup at all.
Also the checkpoint is only working for runc, with crun checkpoint fails in this case. (I will file a crun bug).
Steps to reproduce the issue
Describe the results you received
The netns was not setup on restore.
Describe the results you expected
Netns setup with same mac and ip.
podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
No response
Additional information
Found while working on #18468.
The problem is that I try to use the userns case all the time which is causing tests failures.
The text was updated successfully, but these errors were encountered: