[VMOwnedVolumes][Draft]Introduce new CNS apis#4027
Draft
deepakkinni wants to merge 1 commit into
Draft
Conversation
Contributor
|
Needs a |
deepakkinni
force-pushed
the
topic/dk016388/vmown-govmomi-v1
branch
from
May 31, 2026 06:28
53e6c07 to
bccc216
Compare
deepakkinni
marked this pull request as draft
May 31, 2026 06:37
Signed-off-by: Deepak Kinni <deepak.kinni@broadcom.com>
deepakkinni
force-pushed
the
topic/dk016388/vmown-govmomi-v1
branch
from
June 22, 2026 06:03
bccc216 to
1101ef5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds govmomi Go bindings for three new CNS
VolumeManagerAPIs that implement a two-phase FCD unregister protocol, required for the VM-owned volumes feature (VMOwnedVolumes):CnsUnregisterVolumeEx(async, returnsvim.Task): Phase 1 of the two-phase unregister. Removes the FCD catalog/DDB entries and persists aPENDING_UNREGISTERrecord in the CNS database containing thebackingDiskPathanddiskUUID. The task result is aCnsUnregisterVolumeResult(new type extendingCnsVolumeOperationResult) with those fields populated.CnsAcknowledgeUnregister(synchronous, void): Phase 2. Deletes thePENDING_UNREGISTERrecord from the CNS database. Idempotent — safe to call multiple times.CnsQueryPendingUnregisters(synchronous): Crash-recovery query. Returns all outstandingPENDING_UNREGISTERrecords so the caller can resume any in-flight two-phase operations after a restart.Changes:
cns/types/types.go: NewCnsUnregisterVolumeResultstruct (embedsCnsVolumeOperationResult, addsBackingDiskPathandDiskUUID); request/response types for all three APIs.cns/methods/methods.go: SOAPBodystructs andRoundTripwrapper functions for all three APIs.cns/client.go: High-level client methodsUnregisterVolumeEx,AcknowledgeUnregister, andQueryPendingUnregisters.cns/simulator/simulator.go: In-memory simulator handlers for all three APIs, including apendingUnregistersmap onCnsVolumeManagerthat tracks phase-1 records until acknowledged.cns/simulator/simulator_test.go:TestUnregisterVolumeExexercising the full two-phase lifecycle: create volume → unregister (phase 1, verifyBackingDiskPath/DiskUUIDin 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
CnsUnregisterVolumeResulttype is registered in the type system without thevsan:prefix (consistent with other result types likeCnsVolumeCreateResult,CnsVolumeAttachResult) so that SOAP XML deserialization of the polymorphicvolumeResultsarray 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
CONTRIBUTIONguidelines of this project.