Skip to content

[VMOwnedVolumes][Draft]Introduce new CNS apis#4027

Draft
deepakkinni wants to merge 1 commit into
vmware:mainfrom
deepakkinni:topic/dk016388/vmown-govmomi-v1
Draft

[VMOwnedVolumes][Draft]Introduce new CNS apis#4027
deepakkinni wants to merge 1 commit into
vmware:mainfrom
deepakkinni:topic/dk016388/vmown-govmomi-v1

Conversation

@deepakkinni

Copy link
Copy Markdown
Contributor

Description

Adds govmomi Go bindings for three new CNS VolumeManager APIs that implement a two-phase FCD unregister protocol, required for the VM-owned volumes feature (VMOwnedVolumes):

  • CnsUnregisterVolumeEx (async, returns vim.Task): Phase 1 of the two-phase unregister. Removes the FCD catalog/DDB entries and persists a PENDING_UNREGISTER record in the CNS database containing the backingDiskPath and diskUUID. The task result is a CnsUnregisterVolumeResult (new type extending CnsVolumeOperationResult) with those fields populated.
  • CnsAcknowledgeUnregister (synchronous, void): Phase 2. Deletes the PENDING_UNREGISTER record from the CNS database. Idempotent — safe to call multiple times.
  • CnsQueryPendingUnregisters (synchronous): Crash-recovery query. Returns all outstanding PENDING_UNREGISTER records so the caller can resume any in-flight two-phase operations after a restart.

Changes:

  • cns/types/types.go: New CnsUnregisterVolumeResult struct (embeds CnsVolumeOperationResult, adds BackingDiskPath and DiskUUID); request/response types for all three APIs.
  • cns/methods/methods.go: SOAP Body structs and RoundTrip wrapper functions for all three APIs.
  • cns/client.go: High-level client methods UnregisterVolumeEx, AcknowledgeUnregister, and QueryPendingUnregisters.
  • cns/simulator/simulator.go: In-memory simulator handlers for all three APIs, including a pendingUnregisters map on CnsVolumeManager that tracks phase-1 records until acknowledged.
  • cns/simulator/simulator_test.go: TestUnregisterVolumeEx exercising the full two-phase lifecycle: create volume → unregister (phase 1, verify BackingDiskPath/DiskUUID in result) → query pending (verify record present) → acknowledge (phase 2) → query pending (verify empty) → idempotent re-acknowledge (verify no error).
    Are there any special notes for your reviewer:
    The CnsUnregisterVolumeResult type is registered in the type system without the vsan: prefix (consistent with other result types like CnsVolumeCreateResult, CnsVolumeAttachResult) so that SOAP XML deserialization of the polymorphic volumeResults array works correctly.

Closes: #(issue-number)

How Has This Been Tested?

Please describe any manual tests done to verify your changes.

Guidelines

Please read and follow the CONTRIBUTION guidelines of this project.

@tenthirtyam

Copy link
Copy Markdown
Contributor

Needs a gofmt.

@deepakkinni
deepakkinni force-pushed the topic/dk016388/vmown-govmomi-v1 branch from 53e6c07 to bccc216 Compare May 31, 2026 06:28
@deepakkinni
deepakkinni marked this pull request as draft May 31, 2026 06:37
Signed-off-by: Deepak Kinni <deepak.kinni@broadcom.com>
@deepakkinni
deepakkinni force-pushed the topic/dk016388/vmown-govmomi-v1 branch from bccc216 to 1101ef5 Compare June 22, 2026 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants