-
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
Podman doesn't update device major/minor number on machine reboot #21255
Comments
Hm. We bake the major/minor number into the container at creation time, so there's no real way to update if it changes after reboot. That doesn't match what Docker does, so our current implementation is definitely incorrect. As a workaround, you can bind-mount a folder containing the device in question into the container. That will track any changes to the device node. |
Solution: we'll have to stop resolving devices on container creation and instead add a field to ContainerConfig and stick them there, then resolve them during OCI spec generation. This will only affect new containers (old ones will still use the baked-in OCI spec devices) but will handle things correctly in the future. |
SGTM |
@mheon yes, it make sense to have a flag on this. |
A friendly reminder that this issue had no activity for 30 days. |
Hi, can we get a fix for this issue ? I think the issue here is that podman is storing the device names like /dev/sdc in the container config instead of the persistent device names. These device names can change after reboot, hence the container config should actually store the persistent device names and not the ephemeral ones which can change depending on kernel discovering devices in a certain order. |
Care to open a PR to fix? |
Issue Description
We are testing our application on Podman which requires devices to be assigned to Podman container. We assign disks using --device and Podman records the major and minor number and resolve the symlink to the host device as per the documentation: https://docs.podman.io/en/v2.2.1/markdown/podman-build.1.html.
However, on reboot of the machine the disk major and minor number changes and Podman does update the previously stored information of major and minor number. Because of this situation, our application kept on failing as Podman doesn't have correct disk allocation on machine reboot.
How to handle this situation?
Steps to reproduce the issue
Steps to reproduce the issue
Describe the results you received
Describe the results you received
Describe the results you expected
Podman must update major and minor number on reboot.
podman info output
Podman in a container
Yes
Privileged Or Rootless
Privileged
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting
The text was updated successfully, but these errors were encountered: