-
Notifications
You must be signed in to change notification settings - Fork 106
feat: add support for datastore clusters #574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6a7cad1 to
2f939ee
Compare
52d6365 to
ea36fdf
Compare
3aa758e to
bf66278
Compare
|
Can we see this merged? It scratches an itch I've got and I'd prefer to not maintain my own downstream branch. |
@Gazzonyx, As the developer, once I have completed end testing of each builder and post processor, it will be removed from draft status and marked ready for review and merging. Your patience is greatly appreciated, as the majority of this work was completed my personal capacity. |
|
No worries! I just wanted to make sure it didn't get dropped on the floor. I noticed after commenting that it's tagged for the next 2.X release, so I know which release I'm waiting for. That greatly resolves my anxiety. Thank you for your effort and time, it's much appreciated. |
@Gazzonyx It's defintely not going to be dropped. 😉 In fact, this is a priority feature I developed for a customer that I directly support for on behalf of Broadcom. |
4c1fae7 to
5510a80
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds support for specifying datastore_cluster in addition to the existing datastore option for virtual machine builds in both vsphere-iso and vsphere-clone builders, as well as the vsphere post-processor. The feature integrates Storage DRS (Distributed Resource Scheduler) to automatically select optimal datastores from a cluster, with proper fallback handling. The implementation includes comprehensive validation, documentation updates, and test coverage for the new functionality.
Key Changes:
- Added
datastore_clusterconfiguration field with mutual exclusivity validation againstdatastoreacross all relevant components - Implemented Storage DRS integration with intelligent multi-disk placement recommendations and fallback to first-available datastore when DRS fails
- Updated file upload and cleanup operations to use resolved datastores from either direct specification or cluster selection
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
post-processor/vsphere/post-processor.go |
Added DatastoreCluster config field, validation logic, Storage DRS resolution, and vCenter connection for datastore selection |
post-processor/vsphere/post-processor.hcl2spec.go |
Added HCL2 spec for datastore_cluster field |
post-processor/vsphere/post-processor_test.go |
Updated test to set resolvedDatastore field |
builder/vsphere/common/config_location.go |
Added DatastoreCluster field with documentation and mutual exclusivity validation |
builder/vsphere/common/config_location.hcl2spec.go |
Added HCL2 spec for datastore_cluster field in LocationConfig |
builder/vsphere/common/step_resolve_datastore.go |
New step to resolve datastore from either direct name or cluster using Storage DRS |
builder/vsphere/common/step_resolve_datastore_test.go |
Comprehensive tests for datastore resolution step covering DRS, fallback, and error scenarios |
builder/vsphere/common/step_add_floppy.go |
Updated to use resolved datastore from state bag |
builder/vsphere/common/step_remove_floppy.go |
Updated to use resolved datastore from state bag |
builder/vsphere/common/step_remote_upload.go |
Updated to use resolved datastore from state bag |
builder/vsphere/common/step_download.go |
Updated to use resolved datastore from state bag |
builder/vsphere/iso/step_create.go |
Added multi-disk Storage DRS placement logic with fallback handling |
builder/vsphere/iso/config.hcl2spec.go |
Added HCL2 spec for datastore_cluster field |
builder/vsphere/iso/builder.go |
Added StepResolveDatastore to build pipeline |
builder/vsphere/clone/step_clone.go |
Added multi-disk Storage DRS placement logic with fallback handling |
builder/vsphere/clone/config.hcl2spec.go |
Added HCL2 spec for datastore_cluster field |
builder/vsphere/clone/builder.go |
Added StepResolveDatastore to build pipeline |
builder/vsphere/driver/storage_drs.go |
New file implementing Storage DRS API calls and datastore selection logic for single and multi-disk scenarios |
builder/vsphere/driver/datastore_cluster.go |
New file implementing datastore cluster interface and driver with methods to find clusters and list datastores |
builder/vsphere/driver/datastore_cluster_mock.go |
Mock implementation for testing datastore cluster operations |
builder/vsphere/driver/disk.go |
Updated to support per-disk datastore references for multi-disk placement |
docs-partials/post-processor/vsphere/Config-required.mdx |
Removed datastore from required fields documentation |
docs-partials/post-processor/vsphere/Config-not-required.mdx |
Added datastore and datastore_cluster to optional fields with descriptions |
docs-partials/builder/vsphere/common/LocationConfig-not-required.mdx |
Added datastore_cluster documentation and updated datastore requirements |
.web-docs/components/post-processor/vsphere/README.md |
Updated documentation with new datastore cluster option |
.web-docs/components/builder/vsphere-iso/README.md |
Updated documentation with new datastore cluster option |
.web-docs/components/builder/vsphere-clone/README.md |
Updated documentation with new datastore cluster option |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds support for the use of datastore clusters in the applicable builders and post-processors. Signed-off-by: Ryan Johnson <[email protected]>
5510a80 to
7f9c7ec
Compare
|
This one is now ready for your review, Karthik (@kp2099)! 🚀 Testing completed for the associated builders ( |
Signed-off-by: Ryan Johnson <[email protected]>
|
Sorry I missed the PR! Holiday season had me away from my inboxes. Thanks so much for getting this in so quickly! Cheers and Happy New Year! |
Description
Adds support for specifying a
datastore_cluster(in addition to the existingdatastoreoption) for virtual machine builds and post-processing. It ensures thatdatastoreanddatastore_clusterare mutually exclusive, updates documentation, and adjusts the build logic to handle Storage DRS recommendations for multi-disk VMs. Several steps in the build and upload process are updated to respect the resolved datastore selection.Configuration and Validation Updates:
datastore_clusteras a configuration option in builder and post-processor config structs, with validation to ensure only one ofdatastoreordatastore_clusteris specified. [1] [2] [3] [4] [5] [6]Documentation Improvements:
vsphere-clone,vsphere-iso, andvspherepost-processor components to describe the newdatastore_clusteroption, its mutual exclusivity withdatastore, and Storage DRS behavior. [1] [2] [3] [4]Build and Clone Logic Enhancements:
datastore_clusteris specified, including handling for multiple disks and fallback logic. [1] [2] [3] [4]Upload and Cleanup Step Adjustments:
datastoreordatastore_clusterthroughout the build and cleanup process. (F1d22be6L35R35, [1] [2] [3] [4] [5] [6] [7] [8]Resolved Issues
Adds support for the use of datastore clusters in the applicable builders and post-processors.
Closes #9
Rollback Plan
Revert commit.
Changes to Security Controls
None.