Skip to content

Add note about DM_DISABLE_UDEV to README. #129

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

Merged
merged 1 commit into from
Mar 7, 2019

Conversation

sipsma
Copy link
Contributor

@sipsma sipsma commented Mar 7, 2019

Signed-off-by: Erik Sipsma [email protected]

When working on running our tests in a container, I encountered a bunch of strange race-conditions related to device node creation during the snapshotter tests. This turned out to be due to the udev daemon not being accessible inside the container even though I was bind-mounting /dev from the host to the container.

Another possible fix to this issue would be to change our snapshotter code to use the --verifyudev flag for all dmsetup operations. However, it turns out there is an environment variable DM_DISABLE_UDEV (documented on the lvm(8) man-page only, not dmsetup(8) man-page for some reason), that appears to be a catch-all for making dmsetup and other tools under the lvm umbrella behave well in an environment where udev is not accessible.

Given the flexibility of environment variables relative to hardcoding flags in our code, just documenting this behavior feels like the best fix, so this PR is just a README update.

I tested this by running the tests in a docker container (docker run --rm -it --privileged -v /local/container-tmp:/tmp firecracker-containerd) where I started the snapshotter inside with DM_DISABLE_UDEV=1 and saw the tests pass consistently:

ok      github.com/firecracker-microvm/firecracker-containerd/snapshotter       0.008s [no tests to run]
ok      github.com/firecracker-microvm/firecracker-containerd/snapshotter/cmd/devmapper 0.008s
?       github.com/firecracker-microvm/firecracker-containerd/snapshotter/cmd/naive     [no test files]
ok      github.com/firecracker-microvm/firecracker-containerd/snapshotter/devmapper     72.819s
ok      github.com/firecracker-microvm/firecracker-containerd/snapshotter/naive 300.045s
ok      github.com/firecracker-microvm/firecracker-containerd/snapshotter/pkg/dmsetup   33.658s
ok      github.com/firecracker-microvm/firecracker-containerd/snapshotter/pkg/losetup   36.016s

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@nmeyerhans nmeyerhans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sipsma sipsma merged commit a455aa5 into firecracker-microvm:master Mar 7, 2019
fangn2 pushed a commit to fangn2/firecracker-containerd that referenced this pull request Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants