[pve-devel] [PATCH pve-manager v2] postinst: filter rbds in lvm

Stefan Hanreich s.hanreich at proxmox.com
Tue Dec 19 14:13:15 CET 2023

Although already shortly discussed off-list, here the summary of the
discussion. v3 coming soon.

On 12/19/23 12:54, Fabian Grünbichler wrote:
> this part is now a lot stricter then before (e.g., if the user has
> added multipath devices or something else to the filter for whatever
> reason, the filter won't be extended).

Yes indeed, although if I stuck with the previous logic the filter would
have just gotten replaced which is arguably worse (imo). That's what I
wanted to prevent with the change.

> should we at least print a warning in that case?

> iff
> - the config is not default (OLD_VALUE is set)
> - the old value is neither our expected old value nor our new value
> echo "non-default 'global_filter' value '$OLD_VALUE' in /etc/lvm/lvm.conf, not setting '$NEW_VALUE' automatically"
> echo "consider adapting your 'global_filter' manually."

Yes, that sounds sensible - I'll add printing a warning as else

> also, the combination of marker found, but no $OLD_VALUE would indicate
> that the user explicitly disabled/commented our previously set value -
> maybe in that case we also should just print a warning instead of
> overriding that choice?

Yes indeed I hadn't thought of that - so we need to change the logic to

$MARKER_FOUND = grep -qLF "$LVM_CONF_MARKER" /etc/lvm/lvm.conf

(!$MARKER_FOUND && test -z "$OLD_VALUE")
|| (echo "$OLD_VALUE" | grep -qF '"r|/dev/zd.*|"')

More information about the pve-devel mailing list