fix(vmclass): make sizing policy validation messages actionable and close gaps#2602
Open
fl64 wants to merge 2 commits into
Open
fix(vmclass): make sizing policy validation messages actionable and close gaps#2602fl64 wants to merge 2 commits into
fl64 wants to merge 2 commits into
Conversation
…lose gaps Sizing policy validation reported per-core memory limits, but users set total memory (spec.memory.size), so the suggested values were unusable without manually multiplying them by the number of cores. Errors now report the total memory to set for the current number of cores, name the field to change, and render multiple violations as a single readable list. Also close silent gaps: the CPU cores step was never enforced, and a memory / per-core minimum was ignored when no maximum was set. Signed-off-by: Pavel Tishkov <pavel.tishkov@flant.com>
651837f to
71fddd4
Compare
Signed-off-by: Pavel Tishkov <pavel.tishkov@flant.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Sizing policy validation errors were confusing and, in some cases, missing. When a
VirtualMachineClasssets per-core memory limits, the error reported the allowed values per CPU core, while users configure the total memory — so the suggested numbers matched nothing they could actually set. Messages now report the total memory to set for the current number of cores, name the field to change, and combine multiple violations into a single readable list.This also fixes cases where the policy was silently not enforced: the CPU cores step was never validated, and a memory / per-core minimum was ignored when no maximum was set.
Why do we need it, and what problem does it solve?
Users hit an admission error like
requested VM per core memory ... nearest valid values are [1536Mi, 2Gi]and could not tell that those were per-core values to be multiplied by the number of cores. They would set the shown value as total memory and fail again. On top of that, some misconfigurations passed validation entirely because parts of the policy were never checked.What is the expected result?
set the memory size (spec.memory.size) to 2Gi or 4Gi, with changing the number of cores offered as an alternative.Note: on clusters where an administrator already uses
cores.stepor a memory minimum without a maximum, VMs that slipped through while these checks were missing will now be reported as not matching the sizing policy on their next update. This is the intended effect of the fix. The defaultgenericVMClass does not use these fields and is unaffected.Checklist
Changelog entries