✨ Implement compute config reconciliation for VirtualMachine#1644
Open
hpannem wants to merge 1 commit into
Open
✨ Implement compute config reconciliation for VirtualMachine#1644hpannem wants to merge 1 commit into
hpannem wants to merge 1 commit into
Conversation
remove vmx-23 fields removed ExposeVNUMAOnCPUHotAdd backward compatibility class resize status population guaranteed <==> besteffort class resize
a11ca63 to
ae95378
Compare
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.
✨ Implement compute config reconciliation for VirtualMachine spec
What does this PR do, and why is it needed?
This PR introduces a unified compute configuration reconciliation path for
VirtualMachineobjects. Previously, compute fields (CPU topology, resourceallocation, CPU/memory flags, latency sensitivity) were either not managed or
applied inconsistently across powered-on and powered-off reconfigure paths.
Key changes:
OverwriteSpecComputeConfig— new core function using acomputeFieldDeffunction-table pattern. Each field carries its own
minHWVer,hotPluggable,differs, andapplycallbacks. A 3-way comparison (spec vs. live vSpherestate vs. class-derived ConfigSpec) determines whether to emit a change.
hwVeris derived internally fromliveCI.Versionrather than passed as aparameter.
Spec semantics — VM Operator fully owns every compute field it exposes.
nilmeans "reset to platform default." The only exception isresources.size.cpu/memorywherenildefers to the VirtualMachineClass.0is a sentinel forcoresPerSocket/vnumaNodeCountmeaning "auto."-1is a sentinel forlimits.cpu/limits.memorymeaning "unlimited."API validation (
api/v1alpha6, webhooks) —coresPerSocketandvnumaNodeCountminimum changed to0(allow "auto"sentinel).
vnumaNodeCount > 0requirescoresPerSocket > 0(an explicit non-zero value).-1allowed forlimits.cpuandlimits.memoryas the "unlimited"sentinel;
0is still rejected for limits.SyncClassComputeToSpec/SyncClassSizeAndAllocationToSpec— newfunctions that copy the class's compute fields into
vm.Specwhen aclass-based resize is triggered (
ResizeNeededreturns true). This restoresbackward compatibility: during a resize the class is authoritative and
overrides all spec fields (backfilled or user-specified) that it defines.
The sync is performed in the reconciler — not the mutating webhook — because
the VirtualMachineClass may not exist yet when the webhook fires.
VMResizefeature):SyncClassComputeToSpecsyncs allcompute fields, and device changes are applied atomically in the same
vSphere reconfigure call. The subsequent reconcile is a no-op.
VMResizeCPUMemoryfeature):SyncClassSizeAndAllocationToSpecsyncs only size and allocation fields,matching the narrow scope of that path.
Which issue(s) is/are addressed by this PR? (optional):
Fixes #
Are there any special notes for your reviewer:
TelcoVMServiceAPIfeature flag sinceOverwriteSpecComputeConfigonly runs when that flag is enabled.Please add a release note if necessary: