Skip to content

fix: populate NumCPUs and MemoryMB in createFromLibraryName's StorageDRS spec#361

Merged
HarrisonWAffel merged 3 commits intomasterfrom
copilot/fix-rke2-cluster-provisioning
Mar 2, 2026
Merged

fix: populate NumCPUs and MemoryMB in createFromLibraryName's StorageDRS spec#361
HarrisonWAffel merged 3 commits intomasterfrom
copilot/fix-rke2-cluster-provisioning

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 28, 2026

Issue: rancher/rancher#47145

vSphere 8 added strict validation to the RecommendDatastores API, rejecting StoragePlacementSpec.ConfigSpec with NumCPUs = 0. This breaks content library-based VM deployment (RKE2 provisioning path) when a datastore cluster (Storage DRS) is configured.

  • Fix createFromLibraryName() to pass NumCPUs and MemoryMB in the VirtualMachineConfigSpec passed to getDatastore()
  • Consolidate into a single spec variable (moved up before getDatastore()) reused for both datastore selection and VM reconfiguration

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…store call

Co-authored-by: snasovich <85187633+snasovich@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix provisioning error for RKE2 clusters on vSphere 8 fix: populate NumCPUs and MemoryMB in createFromLibraryName's StorageDRS spec Feb 28, 2026
@snasovich snasovich requested a review from a team February 28, 2026 02:18
@snasovich snasovich marked this pull request as ready for review February 28, 2026 02:20
Copy link
Copy Markdown
Collaborator

@snasovich snasovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look sane provided the fix is tested on actual vSphere environment
Not that my approval counts since I'm the one who kicked off Copilot agent to open this PR

@snasovich snasovich requested a review from a team February 28, 2026 02:22
@HarrisonWAffel
Copy link
Copy Markdown

I tested these changes out locally and they work as expected when using the Rancher UI.

@copilot, on line 392 we're defining a VirtualMachineConfigSpec variable already. Lets just move that up in the function and also use it when finding the datastore cluster, so that we only have one config to manage.

…n createFromLibraryName

Co-authored-by: HarrisonWAffel <25062254+HarrisonWAffel@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Mar 2, 2026

I tested these changes out locally and they work as expected when using the Rancher UI.

@copilot, on line 392 we're defining a VirtualMachineConfigSpec variable already. Lets just move that up in...

Done in 2bb5f83. Moved the spec variable up before getDatastore() and reused it for both the datastore selection and the subsequent vm.Reconfigure() call, so there's only one config to manage.

@HarrisonWAffel HarrisonWAffel requested a review from a team March 2, 2026 16:28
Copy link
Copy Markdown
Member

@jiaqiluo jiaqiluo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@HarrisonWAffel HarrisonWAffel merged commit 2121a72 into master Mar 2, 2026
1 check passed
@jiaqiluo jiaqiluo deleted the copilot/fix-rke2-cluster-provisioning branch April 7, 2026 18:42
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.

4 participants