Skip to content
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

satellite: try to integrate with host LVM/udevd #728

Merged
merged 2 commits into from
Nov 6, 2024

Conversation

WanzenBug
Copy link
Member

There is a race condition when running lvm tools in containers with other lvm tools running on the host. Most notably, in certain situations symlinks to the LVs could suddently disappear.

To prevent this, we try our best to integrate with the hosts LVM/udev tools:

  • Reuse /run/lock/lvm and /run/lvm from the host.
  • Run the container with hostIPC, some lvm tools use sysV semaphores.
  • Create per-host lvmconfig:
    • If there is no lvm.conf on the host, create one where we disable all udev interactions: most likely the rules are not installed.
    • If there is a lvm.conf on the host, create one where we only disable monitoring with dmeventd.

There is a race condition when running lvm tools in containers with other
lvm tools running on the host. Most notably, in certain situations symlinks
to the LVs could suddently disappear.

To prevent this, we try our best to integrate with the hosts LVM/udev tools:

* Reuse /run/lock/lvm and /run/lvm from the host.
* Run the container with hostIPC, some lvm tools use sysV semaphores.
* Create per-host lvmconfig:
  * If there is no lvm.conf on the host, create one where we disable all udev
    interactions: most likely the rules are not installed.
  * If there is a lvm.conf on the host, create one where we only disable
    monitoring with dmeventd.

Signed-off-by: Moritz Wanzenböck <[email protected]>
@WanzenBug WanzenBug linked an issue Nov 5, 2024 that may be closed by this pull request
Signed-off-by: Moritz Wanzenböck <[email protected]>
@WanzenBug
Copy link
Member Author

Surprisingly, this actually worked when I tested it on:

  • RHEL 7/8/9
  • Ubuntu 18.04/20.04/22.04/24.04
  • Debian 11/12
  • Talos Linux 1.8.2

Both with LVM and just to make sure also with ZFS pools (as there are some udev interactions with ZFS, too)

Copy link
Collaborator

@JoelColledge JoelColledge left a comment

Choose a reason for hiding this comment

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

Deep details 👍

@JoelColledge JoelColledge merged commit 9f3f2ad into v2 Nov 6, 2024
5 checks passed
@JoelColledge JoelColledge deleted the use-host-lvm-config branch November 6, 2024 13:15
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.

Resizing of LVM after Host-Reboot not working
2 participants