Skip to content

[x-port] [9.1.2] Changes to allow admin driven mobility with safety rails - #1858

Open
aruneshpa wants to merge 3 commits into
vmware-tanzu:release/vc-9.1.0from
aruneshpa:minor/x-port/admin-driven-mobility-changes-combined
Open

[x-port] [9.1.2] Changes to allow admin driven mobility with safety rails#1858
aruneshpa wants to merge 3 commits into
vmware-tanzu:release/vc-9.1.0from
aruneshpa:minor/x-port/admin-driven-mobility-changes-combined

Conversation

@aruneshpa

Copy link
Copy Markdown
Collaborator

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:

Changes to allow admin driven mobility with safety rails

…#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
@github-actions github-actions Bot added the size/XL Denotes a PR that changes 500-999 lines. label Aug 27, 2026
…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
aruneshpa force-pushed the minor/x-port/admin-driven-mobility-changes-combined branch from 5a20da2 to d11d0c3 Compare August 27, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Denotes a PR that changes 500-999 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant