OCPBUGS-126898: Don't default vSphere numCoresPerSocket to numCPUs - #1557
nikhilprajapati-world wants to merge 1 commit into
Conversation
Omitted numCoresPerSocket must leave the clone spec unset so vCenter uses the template analogue, matching the API. Defaulting it to numCPUs forced a single socket and can fail clone on smaller ESXi hosts. Signed-off-by: Nikhil Prajapati <109680449+nikhilprajapati-world@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@nikhilprajapati-world: This pull request references Jira Issue OCPBUGS-126898, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. WalkthroughThe vSphere clone path no longer defaults zero cores per socket to the CPU count. It leaves the clone field unset for zero and preserves explicit values. New tests verify both cases. ChangesvSphere clone CPU topology
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: 🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 golangci-lint (2.13.2)Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@nikhilprajapati-world @coderabbitai I think you are forgetting something - we should have less numa nodes not more, and your tests left out the odd number of cores case, which customers' have used in the past. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
ast-grep outline pkg/controller/vsphere/reconciler.go --items all --match 'clone|coresPerSocketForClone' || true
ast-grep outline pkg/controller/vsphere/reconciler_test.go --items all --match 'TestCoresPerSocketForClone|clone' || true
printf '\n--- clone helper and focused test context ---\n'
rg -n -A35 -B20 'coresPerSocketForClone|NumCoresPerSocket|TestCoresPerSocketForClone' \
pkg/controller/vsphere/reconciler.go pkg/controller/vsphere/reconciler_test.go || true
printf '\n--- topology and validation references ---\n'
rg -n -i -C4 'numCoresPerSocket|NumCoresPerSocket|numa|topology|cores.?per.?socket' \
--glob '*.go' . || trueLength of output: 27134
[plan_code_changes]
You are interacting with an AI system. |
@coderabbitai you are wrong, if you increase the number of sockets that directly increases numa nodes, which incurs a latency cost |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🤖 web_search executed:
Length of output: 11776
When vSphere derives virtual NUMA topology from The validation must therefore confirm that an omitted
You are interacting with an AI system. |
|
/test unit /lgtm I think the change is fine, it gets us back to the contract defined in the API. vsphere CI needs to pass, I would like to see the odd case. |
|
Scheduling tests matching the |
|
@nikhilprajapati-world: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary
providerSpec.numCoresPerSocketis omitted (0), clone no longer sets it equal tonumCPUs.NumCoresPerSocketunset so vSphere uses the template analogue, which is what the API documents.Fixes OCPBUGS-126898
Test plan
go test ./pkg/controller/vsphere/ -count=1 -run TestCoresPerSocketForClonenumCPUs: 8, omitnumCoresPerSocket. Before this change, guestlscpuwas 8 CPUs / 8 cores/socket / 1 socket (IPI workers 4/4/1). After this change, omitted field must follow the template (4 cores/socket → 2 sockets for 8 vCPU), not 1×8.Made with Cursor
Summary by CodeRabbit