Skip to content

Conversation

@akutz
Copy link
Collaborator

@akutz akutz commented Dec 1, 2025

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

This patch includes:

  1. Live-reload when mkdocs serve - Improves documentation development workflow by enabling automatic reloading when documentation files change during local preview.

  2. Document enhanced storage controller and volume APIs - Adds detailed documentation for storage controller and volume management features:

    • Controller types (IDE, NVME, SATA, SCSI) with capabilities and limits
    • Controller sharing modes for specialized workloads (Oracle RAC, Microsoft WSFC)
    • Volume specification fields for precise disk placement control
    • Disk modes and sharing modes for different use cases
    • Application-specific volume configurations with automatic defaults
    • Enhanced status reporting for controller topology
  3. Document automatic PVC creation for VM image disks - Adds comprehensive coverage of automatic disk registration:

    • Schema upgrade process for existing VMs
    • Automatic PVC creation workflow with CnsRegisterVolume mechanism
    • Mapping spec.volumes to image disks using controller placement
    • Linked clone promotion for template-based deployments
    • PVC lifecycle management and troubleshooting guidance
    • CNS volume registration technical details and monitoring
  4. Document schema upgrade -- Adds documentation for VM schema upgrade.

Which issue(s) is/are addressed by this PR? (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):

Fixes NA

Are there any special notes for your reviewer:

Please add a release note if necessary:

Documentation for enhanced storage APIs and automatic volume registration.

📚 Documentation preview 📚: https://vm-operator--1355.org.readthedocs.build/en/1355/

This patch ensures "mkdocs serve" live-reloads when the docs changes.
Add comprehensive documentation for the new storage controller and
volume management capabilities in VirtualMachine resources. This
documentation covers features that were previously undocumented,
making it difficult for users to understand and utilize the advanced
storage configuration options.

The documentation includes:

- Controller types (IDE, NVME, SATA, SCSI) with their capabilities,
  limits, and SCSI adapter type variations
- Controller sharing modes (None, Physical, Virtual) for specialized
  workloads like Microsoft WSFC and clustering scenarios
- Explicit controller configuration in spec.hardware section
- Volume specification fields including placement control via
  controllerType, controllerBusNumber, and unitNumber
- Disk modes (Persistent, IndependentPersistent, NonPersistent,
  IndependentNonPersistent) with their snapshot behavior
- Sharing modes for multi-writer scenarios
- Application-specific configurations for OracleRAC and MicrosoftWSFC
  workloads with automatic defaults
- Volume placement logic for automatic and explicit controller
  assignment
- Enhanced status reporting showing controller topology and volume
  placement details
Add comprehensive documentation for the automatic disk registration
feature that converts classic disks from VM images into PVC-backed
managed volumes. This functionality was previously undocumented,
making it difficult for users to understand storage lifecycle
management, troubleshoot registration issues, or customize disk
configurations.

The documentation covers:

- Schema upgrade process that backfills unmanaged disks into
  spec.volumes with controller placement information
- Automatic PVC creation workflow including CnsRegisterVolume
  mechanism for in-place disk registration without data movement
- Mapping spec.volumes entries to image disks using controllerType,
  controllerBusNumber, and unitNumber for explicit PVC control
- Linked clone promotion behavior for VMs deployed from templates
- Differences between OVF and VM image types during conversion
- Managing automatically created PVCs including ownership, storage
  class inheritance, and lifecycle
- CNS volume registration technical details with workflow phases,
  status tracking, and CnsRegisterVolume custom resource usage
- Volume removal procedures distinguishing between user-added and
  image-based volumes with data preservation guidelines
- Troubleshooting guidance for registration failures with specific
  conditions, commands, and common issues

This enables platform administrators and developers to:
1. Understand how image disks are automatically converted to PVCs
2. Customize PVC assignments by pre-populating spec.volumes
3. Monitor registration progress via status conditions
4. Troubleshoot registration failures using CnsRegisterVolume resources
5. Manage storage lifecycle for VM disks through Kubernetes APIs
6. Control storage classes and disk placement for image-based volumes
@github-actions github-actions bot added the size/XL Denotes a PR that changes 500-999 lines. label Dec 1, 2025
Add comprehensive documentation explaining how VM Operator automatically
upgrades VirtualMachine resources to match the current schema version
and activated features. This process was previously undocumented,
making it difficult for users to understand why their VMs were being
modified during reconciliation or how to verify upgrade completion.

The documentation covers:

- Upgrade tracking using three annotations: build version, schema
  version, and feature version bitmask
- Feature version bits (Base, VMSharedDisks, AllDisksArePVCs) and how
  they compose into the overall feature version
- Upgrade process stages: base UUID reconciliation, volume backfill,
  controller reconciliation, and device placement reconciliation
- Volume backfill process that adds classic disks to spec.volumes
  with controller placement information
- Controller reconciliation that populates spec.hardware with IDE,
  NVME, SATA, and SCSI controllers from vSphere
- Device reconciliation using CnsNodeVmAttachment to map PVCs to
  disk UUIDs for placement backfill
- Mutation webhook behavior for setting volume and controller defaults
  based on applicationType and upgrade status
- Validation webhook enforcement of placement and application-specific
  constraints after upgrade
- Complete upgrade lifecycle example showing progression through
  feature versions

This enables users to:
1. Understand why VMs are modified during reconciliation
2. Track upgrade progress using annotations and feature versions
3. Verify when a VM is fully upgraded and ready for new features
4. Predict webhook behavior based on upgrade state
5. Debug upgrade issues by checking feature version bits
@github-actions
Copy link

github-actions bot commented Dec 1, 2025

Code Coverage

Package Line Rate Health
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 46%
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/zone 73%
github.com/vmware-tanzu/vm-operator/controllers/storageclass 95%
github.com/vmware-tanzu/vm-operator/controllers/storagepolicyquota 98%
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 69%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/volume 87%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/volumebatch 86%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineclass 73%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinegroup 89%
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 83%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinereplicaset 68%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice 83%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/providers 92%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinesetresourcepolicy 81%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinesnapshot 92%
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 93%
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 98%
github.com/vmware-tanzu/vm-operator/pkg/config/env 100%
github.com/vmware-tanzu/vm-operator/pkg/context 22%
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 76%
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 75%
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 76%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/credentials 100%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/network 81%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/placement 74%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/session 55%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/storage 44%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/upgrade/virtualmachine 95%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/vcenter 85%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/virtualmachine 86%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/vmlifecycle 72%
github.com/vmware-tanzu/vm-operator/pkg/record 87%
github.com/vmware-tanzu/vm-operator/pkg/topology 91%
github.com/vmware-tanzu/vm-operator/pkg/util 70%
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 94%
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/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 90%
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/library 96%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/vm 79%
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 91%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/diskpromo 100%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/policy 95%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/virtualcontroller 86%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/volumes/unmanaged/backfill 100%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/volumes/unmanaged/register 96%
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/persistentvolumeclaim/validation 95%
github.com/vmware-tanzu/vm-operator/webhooks/unifiedstoragequota/validation 88%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/mutation 87%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/validation 95%
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/virtualmachinegroup/mutation 87%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinegroup/validation 92%
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 93%
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 83%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinesnapshot/validation 89%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinewebconsolerequest/v1alpha1/validation 92%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinewebconsolerequest/validation 92%
Summary 82% (17714 / 21473)

Minimum allowed line rate is 79%

Copy link
Collaborator

@aruneshpa aruneshpa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this looks mega. It is helpful to see all these volume and controller constraints in plain English and will definitely help users.

A few minor points that I noted down when reviewing:

  • Mixed use of the work "classic" and "unmanaged" for volumes. Do you think it is worthwhile to make these consistent? For the most part, "classic" is used for disks and "unmanaged" is used for volumes. But I still think it might be a good idea to consolidate to "unmanaged disk".
  • Sharing Mode: Since controllers and volumes both have sharing modes, it can be confusing to figure out which one we are referring to. Your doc heading indentation is organized well, but the reader has to look at their heading structure to figure out which sharing mode we are referring to. Maybe prefix "controller" or "volume" everywhere sharing mode is referenced?

3. **Automatic Registration**: During the first reconciliation after deployment, the system:
- Detects any unmanaged (non-PVC) disks attached to the VM
- Creates a PVC for each disk with appropriate metadata
- Registers the existing disk with the CNS storage provider
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we call out that we wait for the volume to be bound? You do that elsewhere in the docs.

- Creates a PVC for each disk with appropriate metadata
- Registers the existing disk with the CNS storage provider
- Updates `spec.volumes` to reference the newly created PVC

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, do we care enough to explain that this type of volume is a "static" volume and how it is different from a dynamic volume?

!!! tip "Pre-mapping Image Disks"
To control the PVC names or storage classes for image disks, create `spec.volumes` entries before deploying the VM with `controllerType`, `controllerBusNumber`, and `unitNumber` values matching the disks in the image's `status.disks`. See [Mapping spec.volumes to Image Disks](#mapping-specvolumes-to-image-disks) for details.

##### Linked Clone Promotion
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this section (or at least most of the content) is duplicated?


2. **Automatic generation if not specified**: If you don't pre-populate `spec.volumes` for image disks, VM Operator automatically creates entries during the backfill process.

3. **PVC reference is optional**: You can provide a `persistentVolumeClaim.claimName` to use a specific PVC for the image disk. If omitted, a PVC will be automatically created with a generated name.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering. If a user specifies a PVC that already exists and does not have DataSourceRef but is an actual, dynamic volume -- what happens? Do we need to call that out here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will actually apply the DS ref.

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.

3 participants