Control the collection of lvm grains via config - #63115
Conversation
dfac6d9 to
a4bb635
Compare
a4bb635 to
20368ac
Compare
|
I did a first implementation of |
There was a problem hiding this comment.
Given that the schema can have extra options, is it ok to remove the settings from it?
There was a problem hiding this comment.
I think its okay to put them on a deprecation path in favor of the new disabled_grains.
Can you make sure you add a comment:
# salt.utils.versions.warn_until(Potassium, "enabled_fqdns_grains is deprecated in favor of.......)
The only reason being is we grep the cod for warn_until and version name each time we work on removing deprecations.
Also add changelog files for each setting you are removing with the filename deprecated stating the details on what users can now use instead.
20368ac to
3710c84
Compare
|
Looks like htere are some doc and lint test failures. When those are resolved i'll give this a full review. Thanks for implementing this. |
badc70b to
4c4c083
Compare
|
I still have to do the requested changes for the deprecation. If possible, it would be great to have a review for the code changes. I'm a bit conflicted on having the grains do the "disabling" in |
|
ping @s0undt3ch any thoughts here? I think I tend to agree it would be nice if this logic was in the loader instead of having to add it to each |
|
Closing this due to inactivity. Anyone should feel free to re-open it if they want to see it through to the end in one release cycle. |
I would like to get this in, I think a multiple minutes grain collection time is pretty bad. I still don't know if my current approach is fine by you or if you'd rather do this in the loader. |
|
Great, and thanks for the reply. Please re-base and fix the conflicts so we can see if all tests pass. |
4c4c083 to
1908eab
Compare
|
Please address the conflicts above |
7afe6b8 to
35e4315
Compare
35e4315 to
30f9d53
Compare
This option unifies the existing options to en-/disable grain computation. Instead of having one option per grains module/function, we have a single list now. The old options are automatically translated into `disabled_grains` entries.
lvm grain collection can take a long time on systems with a lot of volumes and volume groups. On one server we measured ~3 minutes, which is way too long for grains. This change is backwards-compatible, leaving the lvm grain collection enabled by default. Users with a lot of lvm volumes/volume groups can disable these grains in the minion config by adding "lvm" to disabled_grains: disabled_grains: ... - lvm
Fix lvm.__virtual__() to return __virtualname__ (string) when enabled rather than True (boolean), matching Salt grain loader conventions. Add unit tests for __virtual__ enable/disable behavior via disabled_grains. Add deprecated changelog entry for per-grain enable_* options. Add deprecation warnings in _update_disabled_grains for Calcium removal.
What does this PR do?
Refactor options to control grain computation into a single
disabled_grainslist and makelvmaware of it.lvm grain collection can take a long time on systems with a lot of volumes and volume groups. On one server we measured ~3 minutes, which is way too long for grains.
This change is backwards-compatible, leaving the lvm grain collection enabled by default.
What issues does this PR fix or reference?
Fixes: #63114
Previous Behavior
lvm grains are always loaded
New Behavior
lvm grains are not loaded when disabled in minion configuration
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
disabled_grainsDoes this need a grains/lvm.conf specific test, or is this covered by the
__virtual__()/ Salt loader tests?Commits signed with GPG?
Yes
Please review Salt's Contributing Guide for best practices.
See GitHub's page on GPG signing for more information about signing commits with GPG.