Fix SCSI max disk limit to support PVSCSI controller capacity#2698
Fix SCSI max disk limit to support PVSCSI controller capacity#2698Dwayne75 wants to merge 3 commits intovmware:mainfrom
Conversation
The SCSI disk unit number validation, bus/unit mapping, and controller info lookup all hardcoded 15 usable units per controller, which is only correct for LSI Logic/SAS. PVSCSI controllers support 64 devices (63 usable). Added scsiUsableUnitsPerController() helper and updated DiffGeneral, assignDisk, and findControllerInfo to use controller-type aware limits. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates SCSI disk unit-number validation and controller/unit mapping so that PVSCSI controllers can use their full supported device capacity (63 usable slots per controller), instead of being limited to the LSI Logic/SAS default (15 usable).
Changes:
- Add
scsiUsableUnitsPerController(scsi_type)helper to determine per-controller usable unit capacity. - Update
DiffGeneral()SCSI unit-number maximum validation to use the computed usable-unit limit and includescsi_typein the error message. - Update SCSI bus/unit mapping in
assignDisk()and reverse mapping infindControllerInfo()to use the computed usable-unit limit.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates SCSI disk unit-number validation and controller/unit mapping so the provider correctly supports PVSCSI’s larger device capacity (63 usable disk slots per controller vs 15 for LSI Logic / LSI Logic SAS).
Changes:
- Add
scsiUsableUnitsPerController(scsiType)helper to centralize per-controller usable slot limits. - Update
DiffGeneral(),assignDisk(), andfindControllerInfo()to use the new per-SCSI-type usable unit count instead of a hardcoded15. - Add a unit test covering
scsiUsableUnitsPerController()for PVSCSI and LSI controller types.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
vsphere/internal/virtualdevice/virtual_machine_disk_subresource.go |
Replaces hardcoded SCSI unit math with SCSI-type-aware limits across validation, assignment, and reverse mapping. |
vsphere/internal/virtualdevice/virtual_machine_disk_subresource_test.go |
Adds unit test for the new helper that returns per-controller usable SCSI slots. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vsphere/internal/virtualdevice/virtual_machine_disk_subresource.go
Outdated
Show resolved
Hide resolved
|
Hey @Dwayne75 thanks for your contribution. There's a couple of items in the backlog specifically about SCSI controllers and max devices. Please make sure to run all acceptance tests for |
Instead of relying on the global scsi_type setting, determine the controller sub-type from the actual controller device object. This handles mixed-controller VMs correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
hey @spacegospod, I fixed that issue mentioned by copilot, I ran all the tests I can, my vsphere is a very controlled environment and I do not currently have the ability to run the full acceptance tests. |


Summary
assignDisk(), and reverse mapping infindControllerInfo()all hardcoded 15 usable units per controller, which is only correct for LSI Logic / LSI Logic SAS controllersscsiUsableUnitsPerController()helper that returns the correct limit based onscsi_type, and updatedDiffGeneral,assignDisk, andfindControllerInfoto use itTest plan
🤖 Generated with Claude Code