]> git.proxmox.com Git - pve-manager.git/commit
postinst: filter rbds in lvm
authorStefan Hanreich <s.hanreich@proxmox.com>
Fri, 22 Dec 2023 09:58:06 +0000 (10:58 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 9 Jan 2024 09:33:27 +0000 (10:33 +0100)
commit250d7b07f12fd737cc349e70218a01e88b7d1e2c
treee0b1aec301505febae06c9a03e09f420b38c7243
parentc75ee959c5bc7f48ea1619bd61fb903f91dcea03
postinst: filter rbds in lvm

Since LVM 2.03.15 RBD devices are also scanned by default [1]. This
can lead to guest volumes being recognized and displayed on the host
when using KRBD for RBD-backed disks. In order to prevent this we add
an additional filter to the LVM config to avoid scanning rbds.

This also prevents a bug where LVM created a very high amount of
archive entries when there were logical volumes with the same path
available. This could happen when two guests with RBD disks had the
same LVM layout or a guest and host had the same layout.

previous behavior:
If there is no marker in the LVM conf and global_filter does not
contain '/dev/zd.*': replace the global_filter with our version

new behavior:
Replace the global_filter iff:
- There is no marker and global_filter is empty
- The global_filter is exactly the old default

If we don't replace the filter and it is a non-default value: We print
a warning. Addtionally we force this function to run once when
upgrading from older versions.

The previous versions could replace custom global_filters where the
comment had been removed and the zvol directive removed. The new
behavior is slightly more conservative, but works the same in other
cases.

[1] https://gitlab.com/lvmteam/lvm2/-/commit/6a431eb24241caf2277d3e5b4718782d92650a2a

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
debian/postinst