Skip to content

✨ Mount vm snapshot disk - #1857

Draft
cc005511 wants to merge 3 commits into
vmware-tanzu:mainfrom
cc005511:mount_vm_snapshot_disk
Draft

✨ Mount vm snapshot disk#1857
cc005511 wants to merge 3 commits into
vmware-tanzu:mainfrom
cc005511:mount_vm_snapshot_disk

Conversation

@cc005511

@cc005511 cc005511 commented Aug 27, 2026

Copy link
Copy Markdown

What does this PR do, and why is it needed?
VirtualMachineSnapshotDiskSpec is used to define a specific disk from a VirtualMachineSnapshot. VirtualMachineSnapshotDiskSpec field added in VirtualMachineVolumeSource is to support mounting a VirtualMachine snapshot disk as a volume of the VM service VM.

  • Only one member (virtualMachineSnapshot or persistentVolumeClaim) of VirtualMachineVolumeSource could be specified at a time. The webhook validation will reject a VirtualMachineVolume whose source sets both persistentVolumeClaim and virtualMachineSnapshot.
  • If virtualMachineSnapshot is set in VirtualMachineVolumeSource, the requester must have the permission to get, create, or delete VM snapshot in the VM snapshot namespace.
  • The name or the diskID of VirtualMachineSnapshotDiskSpec must not be empty.
  • If virtualMachineSnapshot is set in VirtualMachineVolumeSource but the VirtualMachineSnapshot is not-found or not-ready, the specific error will be set in status.volumes[].error.
  • Once the volume is attached (VirtualMachine.status.volumes[].attached = true), changes on the volume source (the name or the diskID) is not allowed.

PASS
go test -v ./pkg/providers/vsphere/session/...
go test -v ./webhooks/virtualmachine/validation/...
go test -v ./controllers/virtualmachine/volume/...

Are there any special notes for your reviewer:
Expose the disk list in VirtualMachineSnapshot: #1744
CRD change of supporting VM snapshot disk as the volume source: #1751

Please add a release note if necessary:
Support mounting a VM snapshot disk as a VM volume. When using the VM Snapshot disk as the volume source, diskMode must be set to "IndependentNonPersistent" and removable must be set to true.

@github-actions github-actions Bot added the size/XXL Denotes a PR that changes 1000+ lines. label Aug 27, 2026
@cc005511
cc005511 force-pushed the mount_vm_snapshot_disk branch 3 times, most recently from fc01553 to c74b40e Compare September 7, 2026 06:45
@cc005511
cc005511 force-pushed the mount_vm_snapshot_disk branch 2 times, most recently from 22a2e4d to bf97481 Compare September 7, 2026 10:10
@cc005511 cc005511 changed the title Mount vm snapshot disk ✨ Mount vm snapshot disk Sep 7, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
@cc005511
cc005511 force-pushed the mount_vm_snapshot_disk branch from bf97481 to 661ea04 Compare September 8, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XXL Denotes a PR that changes 1000+ lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant