Enhance govc Relocate Volume command #4122
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 313 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.344
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #4122"
general
weight: 0.35
chethanv28
Description
The govc volume.relocate command has been enhanced to:
1. Accept an optional input CSV file containing a list of volume IDs and optional target datastores.
2. Print the CNS opid, if applicable.
3. Print error information (fault or task info) to the log file.
4. Accept an optional log file path input, defaulting to relocate.log in the current working directory.
5. Provide a tabular summary of the relocation operation results.
Testing Done: Manually tested these changes running volume.relocate command with different options.
Closes: #(issue-number) None
How Has This Been Tested?
Verified by running volume.relocate command with the existing and newly introduced optional parameters.
govc volume.relocate -ds vsanDatastore f75989dc-95b9-4db7-af96-8583f24bc59d
govc volume.relocate -ds vsanDatastore id1 id2 id3
govc volume.relocate -file volumes.csv
govc volume.relocate -ds vsanDatastore -file volumes.csv
govc volume.relocate -ds vsanDatastore -log-file /var/log/relocate.log id1
govc volume.relocate -ds vsanDatastore -file volumes.csv -log-file /var/log/relocate.log
<img width="1089" height="167" alt="Screenshot 2026-09-01 at 1 22 13 PM" src="https://github.com/user-attachments/assets/8962d500-0d85-49a2-ac11-5c084560a92f" />
Unit test results:
[ss028541@lvn-dbc2461 govmomi]$ go test ./cli/volume/... -run TestRelocate -v
=== RUN TestRelocateEntriesFromFile_NoHeader
--- PASS: TestRelocateEntriesFromFile_NoHeader (0.00s)
=== RUN TestRelocateEntriesFromFile_WithDatastore
--- PASS: TestRelocateEntriesFromFile_WithDatastore (0.00s)
=== RUN TestRelocateEntriesFromFile_HeaderRowSkippedAndWarned
--- PASS: TestRelocateEntriesFromFile_HeaderRowSkippedAndWarned (0.00s)
=== RUN TestRelocateEntriesFromFile_NonUUIDFirstRowWarns
--- PASS: TestRelocateEntriesFromFile_NonUUIDFirstRowWarns (0.00s)
=== RUN TestRelocateEntriesFromFile_Empty
--- PASS: TestRelocateEntriesFromFile_Empty (0.00s)
=== RUN TestRelocateEntriesFromFile_MissingFile
--- PASS: TestRelocateEntriesFromFile_MissingFile (0.00s)
=== RUN TestRelocateResultCounts
--- PASS: TestRelocateResultCounts (0.00s)
PASS
ok github.com/vmware/govmomi/cli/volume 0.007s
? github.com/vmware/govmomi/cli/volume/snapshot [no test files]
Guidelines
Please read and follow the
CONTRIBUTION[guidelines] of this project.[guidelines]: https://github.com/vmware/govmomi/blob/main/CONTRIBUTING.md