Skip to content

📖 Add vim.vmware.com partner integration guide - #1792

Draft
faisalabujabal wants to merge 2 commits into
vmware-tanzu:mainfrom
faisalabujabal:faisal/vmop-3739-vim-integration-guide
Draft

📖 Add vim.vmware.com partner integration guide#1792
faisalabujabal wants to merge 2 commits into
vmware-tanzu:mainfrom
faisalabujabal:faisal/vmop-3739-vim-integration-guide

Conversation

@faisalabujabal

Copy link
Copy Markdown
Contributor

What does this PR do, and why is it needed?

Authors external/vim/doc/integration-guide.md, the partner-facing integration doc for the vim.vmware.com APIs (vmop-3739, Story S2 of vmop-3331). The audience is teams consuming these APIs from outside VM Operator — UI/CLI surfaces, placement and quota tooling — so it is written as a contract rather than a tour: what you can rely on, what is not populated yet, and what will reject your request.

Contents:

  • The capability gate (supports_vm_service_vm_config_policy), and why CRD presence is not a signal the feature is on.
  • The four CRDs: scope, plural/short names, metadata.name conventions, who writes them, what they derive from.
  • The reconcile pipeline (corrected mermaid), with the eventual-consistency and Ready-gating caveats a consumer needs.
  • The ConfigTarget.status capability surface, including maxHardwareVersion and an explicit "do not build on status.sriov, it is empty today" warning.
  • VirtualMachineConfigPolicy: syncMode semantics, which spec fields are synced vs. administrator-owned, the multi-cluster intersection merge, the Min > Max refusal, and every Ready condition reason.
  • The enforcement contract: both enforcement points, the per-mode gating table, the full checked/not-checked field matrix, range and extraConfig matching semantics, and what a denial looks like on each path.
  • A worked policy-denial example, end to end.
  • The CEL rules and webhook rules a caller will hit.

Written against the merged end state of the stack. The guide describes behavior from five PRs still in review, so it should merge after them:

PR Behavior documented
#1738 Both enforcement points, spec.hardwareVersions, the VirtualMachineConfigPolicyVerified condition
#1783 VirtualMachineConfigPolicy validation webhook
#1784 Sync controller, intersection merge, Ready reasons
#1785 CEL migration; configtarget / virtualmachineconfigoptions webhooks removed
#1782, #1789 VirtualMachineGuestOptions GC semantics

Marked draft for that reason. Nothing here needs to change if those merge as-is; if #1738's enforcement shifts in review, the "Enforcement" section is one contiguous block to amend.

Three corrections to the sibling docs

Writing this surfaced claims in controller-workflows.md and deploying-a-vm.md that the merged code contradicts. Fixed here rather than propagated into a new partner-facing doc:

  1. Cluster MoID derivation. Both docs derived cluster MoIDs from the Zone's spec.namespace.poolMoIDs. The merged Zone controller and the sync controller in Add VirtualMachineConfigPolicy sync controller #1784 both use spec.managedVMs.clusterMoIDs. Fixed in the mermaid node text and in the prose of both controller sections.
  2. ConfigTarget name examples. deploying-a-vm.md used cluster-1 / cluster-2. vmop-3766: Move ConfigTarget/VirtualMachineConfigOptions validation to CEL #1785 adds a CEL rule requiring ^domain-c[0-9]+$, so those examples would be rejected by the API server. Now domain-c52.
  3. Enforcement scope — the substantive one. deploying-a-vm.md stated that admission lists every VirtualMachineConfigPolicy in the namespace and denies only if no zone permits the VM. ✨ Enforce VirtualMachineConfigPolicy in webhook and power-on reconcile #1738 does the opposite: it resolves exactly one policy, named after the VM's assigned topology.kubernetes.io/zone label, via a single Get, and a VM with no zone label is not enforced at all. Its worked example and sequence diagram are rewritten to match, and the guide calls out that any-zone reasoning is the consumer's job, not admission's.

Also fixes external/vim/README.md, which linked to a doc/environment_browser.md that has never existed, and now links the three real pages.

Which issue(s) is/are addressed by this PR?

Addresses vmop-3739.

Are there any special notes for your reviewer:

  • Docs-only. No pkg/, api/, or test/ changes.
  • T021 is deliberately left open. It asks to link the guide from the public RTD site, but mkdocs.yml sets docs_dir: docs with no include/monorepo plugin, so nothing under external/vim/doc/ is reachable by the RTD build today — that is true of all three pages there, not just this one. Publishing means relocating the tree into docs/, adding a build dependency, or symlinking: a docs-site structural decision worth its own change. T021's other half (review by PM and a downstream consumer team) is a process step no PR can close. tasks.md records both.
  • Two bullets of T020's original scope are documented as their opposite, because the design they described was retired. The task asked for "enriched sriov" and "per-host iteration inside the ConfigTarget controller (PropertyCollector RPC strategy, partial-failure handling)". Per T066b/T066c and the Story S4 closure, there is no host enumeration, no PropertyCollector call, and status.sriov ships empty pending spec 003. The guide says so plainly and warns consumers off the field; tasks.md records the divergence.

Please add a release note if necessary:

NONE

Author external/vim/doc/integration-guide.md, the consumer-facing
contract for the vim.vmware.com APIs (vmop-3739 / Story S2 of
vmop-3331): capability gate, the four CRDs and their name
conventions, the reconcile pipeline, the ConfigTarget capability
surface, VirtualMachineConfigPolicy syncMode and field ownership,
both policy enforcement points, a worked denial example, and the
CEL/webhook rules a caller will hit.

The guide is written against the merged end state of the config
policy work, including the enforcement, sync controller, policy
webhook, and CEL-migration changes still in review.

Writing it surfaced three claims in the sibling docs that the
merged code contradicts, corrected here rather than propagated:

- controller-workflows.md derived cluster MoIDs from the Zone's
  spec.namespace.poolMoIDs. Both the Zone controller and the
  policy sync controller use spec.managedVMs.clusterMoIDs.

- deploying-a-vm.md used cluster-1 as a ConfigTarget name. A CEL
  rule on the CRD requires ^domain-c[0-9]+$, so that example
  would be rejected by the API server.

- deploying-a-vm.md described admission as consulting every zone
  policy in the namespace and denying only if no zone permits the
  VM. Enforcement resolves exactly one policy, named after the
  VM's assigned zone label, and an unplaced VM is not enforced at
  all. Its worked example is rewritten accordingly.

Also fixes the README's link to a doc/environment_browser.md that
does not exist, and records in tasks.md that two bullets of T020's
original scope (enriched sriov, per-host PropertyCollector
iteration) describe a design retired by Story S4's closure.
@github-actions github-actions Bot added the size/L Denotes a PR that changes 100-499 lines. label Jul 31, 2026
Three accuracy fixes to the integration guide, each verified
against source rather than inferred:

- The worked example's denial text quoted invented message tails.
  Replaced with the real ErrMemoryViolation and
  ErrExtraConfigViolation strings, and with the real response
  shape: webhooks/common/response.go returns HTTP 422 with every
  field error joined into one reason string, not one line each.

- status.defaultHardwareVersion and status.vMotionBandwidth are
  never written by pkg/util/vsphere/configtarget. Moved out of
  the populated-field list and into the same "do not build on
  this yet" warning that already covered status.sriov.

- Reverted an unverified 422 to 403 edit in deploying-a-vm.md.
  422 was correct.
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

Code Coverage

Package Line Rate Health
github.com/vmware-tanzu/vm-operator/controllers/configtarget 74%
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/clustercontentlibraryitem 67%
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/contentlibraryitem 67%
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/utils 85%
github.com/vmware-tanzu/vm-operator/controllers/infra/capability/configmap 92%
github.com/vmware-tanzu/vm-operator/controllers/infra/capability/crd 100%
github.com/vmware-tanzu/vm-operator/controllers/infra/configmap 75%
github.com/vmware-tanzu/vm-operator/controllers/infra/node 77%
github.com/vmware-tanzu/vm-operator/controllers/infra/secret 76%
github.com/vmware-tanzu/vm-operator/controllers/infra/validatingwebhookconfiguration 87%
github.com/vmware-tanzu/vm-operator/controllers/infra/workloadnetworkconfig 86%
github.com/vmware-tanzu/vm-operator/controllers/infra/zone 76%
github.com/vmware-tanzu/vm-operator/controllers/storage/storageclass 93%
github.com/vmware-tanzu/vm-operator/controllers/storage/storagepolicy 96%
github.com/vmware-tanzu/vm-operator/controllers/storage/storagepolicyquota 91%
github.com/vmware-tanzu/vm-operator/controllers/storage/volumeattributesclass 93%
github.com/vmware-tanzu/vm-operator/controllers/util/encoding 73%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/storagepolicyusage 96%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/virtualmachine 64%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/volume 86%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/volumebatch 89%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineclass 73%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineconfigoptions 88%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinegroup 90%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinegrouppublishrequest 88%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineimagecache 89%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinepublishrequest 84%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinereplicaset 68%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice 91%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/providers 93%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinesetresourcepolicy 81%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinesnapshot 91%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest 72%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1 72%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions 88%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1/patch 78%
github.com/vmware-tanzu/vm-operator/controllers/vspherepolicy/policyevaluation 85%
github.com/vmware-tanzu/vm-operator/pkg/bitmask 100%
github.com/vmware-tanzu/vm-operator/pkg/builder 89%
github.com/vmware-tanzu/vm-operator/pkg/conditions 90%
github.com/vmware-tanzu/vm-operator/pkg/config 100%
github.com/vmware-tanzu/vm-operator/pkg/config/capabilities 97%
github.com/vmware-tanzu/vm-operator/pkg/config/env 100%
github.com/vmware-tanzu/vm-operator/pkg/context 37%
github.com/vmware-tanzu/vm-operator/pkg/context/generic 100%
github.com/vmware-tanzu/vm-operator/pkg/context/operation 100%
github.com/vmware-tanzu/vm-operator/pkg/crd 77%
github.com/vmware-tanzu/vm-operator/pkg/errors 74%
github.com/vmware-tanzu/vm-operator/pkg/exit 100%
github.com/vmware-tanzu/vm-operator/pkg/log 100%
github.com/vmware-tanzu/vm-operator/pkg/mem 100%
github.com/vmware-tanzu/vm-operator/pkg/patch 78%
github.com/vmware-tanzu/vm-operator/pkg/prober 89%
github.com/vmware-tanzu/vm-operator/pkg/prober/probe 90%
github.com/vmware-tanzu/vm-operator/pkg/prober/worker 77%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere 74%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/clustermodules 73%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/config 88%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/contentlibrary 75%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/credentials 100%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/network 83%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/placement 70%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/session 60%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/storage 44%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/upgrade/virtualmachine 96%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/upgrade/virtualmachine/backfill 96%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/vcenter 86%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/virtualmachine 84%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/virtualmachine/extraconfig 87%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/vmlifecycle 75%
github.com/vmware-tanzu/vm-operator/pkg/record 84%
github.com/vmware-tanzu/vm-operator/pkg/topology 91%
github.com/vmware-tanzu/vm-operator/pkg/util 79%
github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit 89%
github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit/validate 91%
github.com/vmware-tanzu/vm-operator/pkg/util/image 100%
github.com/vmware-tanzu/vm-operator/pkg/util/kube 91%
github.com/vmware-tanzu/vm-operator/pkg/util/kube/cource 100%
github.com/vmware-tanzu/vm-operator/pkg/util/kube/internal 100%
github.com/vmware-tanzu/vm-operator/pkg/util/kube/networksettings 100%
github.com/vmware-tanzu/vm-operator/pkg/util/kube/proxyaddr 73%
github.com/vmware-tanzu/vm-operator/pkg/util/kube/spq 99%
github.com/vmware-tanzu/vm-operator/pkg/util/linuxprep 97%
github.com/vmware-tanzu/vm-operator/pkg/util/netplan 100%
github.com/vmware-tanzu/vm-operator/pkg/util/nil 100%
github.com/vmware-tanzu/vm-operator/pkg/util/ovfcache 75%
github.com/vmware-tanzu/vm-operator/pkg/util/ovfcache/internal 100%
github.com/vmware-tanzu/vm-operator/pkg/util/paused 100%
github.com/vmware-tanzu/vm-operator/pkg/util/ptr 100%
github.com/vmware-tanzu/vm-operator/pkg/util/resize 98%
github.com/vmware-tanzu/vm-operator/pkg/util/sysprep 98%
github.com/vmware-tanzu/vm-operator/pkg/util/vmopv1 88%
github.com/vmware-tanzu/vm-operator/pkg/util/volumes 100%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/client 66%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/datastore 100%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/fault 100%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/library 95%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/storage 82%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/task 100%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/vm 78%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/watcher 85%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig 95%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/anno2extraconfig 100%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/bootoptions 88%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/cdrom 88%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/crypto 92%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/diskpromo 100%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/extraconfig 100%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/networkextraconfig 71%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/policy 97%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/virtualcontroller 93%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/volumes/unmanaged/backfill 98%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/volumes/unmanaged/register 92%
github.com/vmware-tanzu/vm-operator/pkg/webconsolevalidation 100%
github.com/vmware-tanzu/vm-operator/services/vm-watcher 85%
github.com/vmware-tanzu/vm-operator/webhooks/common 98%
github.com/vmware-tanzu/vm-operator/webhooks/configtarget/validation 87%
github.com/vmware-tanzu/vm-operator/webhooks/persistentvolumeclaim/validation 95%
github.com/vmware-tanzu/vm-operator/webhooks/unifiedstoragequota/validation 89%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/mutation 86%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/validation 96%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/mutation 62%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/validation 89%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineconfigoptions/validation 88%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinegroup/mutation 87%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinegroup/validation 93%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinegrouppublishrequest/mutation 86%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinegrouppublishrequest/validation 88%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinepublishrequest/validation 90%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinereplicaset/validation 90%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/mutation 67%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/validation 92%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinesetresourcepolicy/validation 89%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinesnapshot/mutation 86%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinesnapshot/validation 91%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinewebconsolerequest/v1alpha1/validation 92%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinewebconsolerequest/validation 92%
Summary 84% (21445 / 25516)

Minimum allowed line rate is 79%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant