[x-port] [9.1.2] Changes to allow admin driven mobility with safety rails - #1858
Open
aruneshpa wants to merge 3 commits into
Open
Conversation
…#1813) Register the 6 INVARIANT extension compatibility constraints (SERVICE, FOLDER, POOL, VM_STORAGE_POLICY, DISK_STORAGE_POLICY, DEVICE) on every VM's ConfigSpec at create time, gated behind the new ExtensionCompatConstraint capability/feature flag. This lets vpxd's Safety Rails mechanism reject admin-initiated relocate/reconfigure operations that would break Supervisor's namespace, storage-class, and network-identity invariants, while still allowing host and datastore changes within the same cluster and StorageClass. Bump govmomi to the pseudo-version that carries the new VirtualMachineExtensionCompatibilityConstraint(Set) types and the SkipExtensionCompatibilityChecks field, matching the commit Mobility Operator already depends on for its own bypass ticket.
) Fold a generic, level-triggered check into the existing config reconfigure path: compare a VM's current config.extensionCompatibilityConstraint set against the desired 6 INVARIANTs (ignoring the cosmetic ConstraintName and array order), and re-send the full desired set whenever they differ. This is folded into doReconfigure's shared ConfigSpec rather than given its own standalone Reconfigure call, so it batches with other pending config changes into a single vCenter round trip. The trade-off is that reconcileConfig's existing verifyConnectionState check means this fix-up is skipped for VMs with a disconnected host, same as the rest of config reconciliation. vmop-3779
…tanzu#1837) VM Operator registers extension compatibility constraints on managed VMs (VMSVC-3778/3779), but without this change its own subsequent ReconfigVM_Task calls (PVC attach/detach, CPU/memory resize, NIC reconfiguration, last-restart-time bookkeeping, cleanup on delete) could be blocked by the very constraints it just set. VM Operator already holds the ExtensionCompat.Bypass privilege, so setting SkipExtensionCompatibilityChecks lets vpxd honor the bypass. Gate the flag on Features.ExtensionCompatConstraint at every ReconfigVM_Task call site that reaches vCenter directly: resources.VirtualMachine.Reconfigure (covers backup, bootstrap, and session update paths), vm.setLastRestartTimeInExtraConfigAndWait, and virtualmachine.reconfigureVM used during VM cleanup. The last of these sets the flag after the existing no-op guard so an unchanged cleanup config spec still short-circuits without an extra reconfigure. Also clear the registered constraint set itself when VM Operator unregisters a VM (CleanupVMServiceState), via the new ClearConfigSpecExtensionCompatibilityConstraint. A reconfigure's constraint set is a full-set-replace, so a non-nil empty set clears it; this rides along in the same bypassed Reconfigure call that already clears ManagedBy and ExtraConfig, so there is no ordering problem between clearing the constraint and being blocked by it. The clear only fires when ManagedBy still identifies VM Operator, since the constraint set is attributed to the VM's managing extension as a whole. vmop-3780
aruneshpa
force-pushed
the
minor/x-port/admin-driven-mobility-changes-combined
branch
from
August 27, 2026 21:35
5a20da2 to
d11d0c3
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.
What does this PR do, and why is it needed?
This is an x-port of three changes:
Together, these changes allow infrastructure admins on the platform to perform maintenance operations bypassing Supervisor.
Please add a release note if necessary: