[VMOwnedVolumes][Draft]Core Workflows — Attach, Snapshot, Detach, Snapshot Deletion, Revert Re-adoption#4058
Open
deepakkinni wants to merge 3 commits into
Conversation
Signed-off-by: Deepak Kinni <deepak.kinni@broadcom.com>
Signed-off-by: Deepak Kinni <deepak.kinni@broadcom.com>
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deepakkinni The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…pshot Deletion, Revert Re-adoption Signed-off-by: Deepak Kinni <deepak.kinni@broadcom.com>
99e15e2 to
0872e3c
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.
What this PR does / why we need it:
Phase 2 — Workflow A: Attach (Section 7)
Greenfield/Brownfield Branching in BA Controller (A.3) — In cnsnodevmbatchattachment_controller.go, for each new dependent-persistent volume in BA spec, read the parent VM's vmoperator.vmware.com/vm-owned-volumes annotation and check CVI existence/state; if greenfield + CVI CSI_MANAGED, take the new path; otherwise fall through to legacy CnsAttachVolume (AttachMethod=CnsAttach).
CnsUnregisterVolume Call (A.3) — Implement the call to CnsUnregisterVolume(volumeID, targetType=LEGACY_DISK) via cns-lib/volume/manager.go, handling the two-phase PENDING_UNREGISTER result (backingDiskPath, diskUUID) and error cases (snapshots, CBT, linked clone).
CVI Transition + BA Signal + CNS ACK (A.4) — After successful unregister: (1) patch CVI to TRANSFERRING_TO_VM with vmName, vmInstanceUUID, refreshed diskPath, and cvi-protection finalizer; (2) write diskPath/diskUUID and AttachMethod=Reconfig condition on BA status; (3) call AckUnregister to delete the CNS PENDING_UNREGISTER row.
PENDING_UNREGISTER Crash Recovery (A.3/A.4) — On CSI pod restart, scan CNS for volumes in PENDING_UNREGISTER state that correspond to greenfield BA spec entries, and resume from step A.4 (CVI patch, BA update, ACK).
Mid-Attach Cancellation (Section 7.5) — When a volume is removed from vm.spec.volumes while CVI is in TRANSFERRING_TO_VM, drive Workflow C from the transient state: skip ReconfigVM (disk not yet on VM), query vCenter snapshot tree, and re-register FCD back to CSI_MANAGED.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close that issue when PR gets merged): fixes #Testing done:
A PR must be marked "[WIP]", if no test result is provided. A WIP PR won't be reviewed, nor merged.
The requester can determine a sufficient test, e.g. build for a cosmetic change, E2E test in a predeployed setup, etc.
For new features, new tests should be done, in addition to regression tests.
If jtest is used to trigger precheckin tests, paste the result after jtest completes and remove [WIP] in the PR subject.
The review cycle will start, only after "[WIP]" is removed from the PR subject.
Special notes for your reviewer:
Release note: