Open ravatheodor opened 11 months ago
Hello, ravatheodor! 🖐
Thank you for submitting an issue for this provider. The issue will now enter into the issue lifecycle.
If you want to contribute to this project, please review the contributing guidelines and information on submitting pull requests.
Could you please use the Markdown tools to format the example for readability? Thanks!
Hope it helps now. It's basically a clone from template, but done in a convoluted way.
Hi, I am having the same issue now. Is there any news regarding this?
The issue lies in https://github.com/hashicorp/terraform-provider-vsphere/blob/db8347d25cb30d13700b75f36ee23c564c1ec200/vsphere/internal/virtualdevice/virtual_machine_disk_subresource.go#L1623 this line.
Since in the next line it just compares current > max, this line should be adjusted to 16-1
Working on this one, it's a little more complicated that just changing maxUnit := ctlrCount*15 - 1
to maxUnit := ctlrCount*16 - 1
.
I've got a local branch that has changes to account for 0:7 being reserved in the range and throwing an error it unit_number == 7
.
I have the code working but during the provision it's erroring on the clone - just need to work past that next.
Community Guidelines
Terraform
v1.6.5
Terraform Provider
v2.6.1
VMware vSphere
v7.0.3
Description
In vSphere SCSI X:7 is reserved. A VM with more than 7 disks on a single controller will have disks assigned from 0:0 to 0:6 and from 0:8 to 0:15 (for SCSI controller 0). The maximum of 15 disks per SCSI controller is respected. vCenter Server Appliance has 15 disks on SCSI 0 controller. Terraform plan fails because of checking Hard disk number instead of counting the disks │ Error: disk.14: unit_number on disk "Hard disk 15" too high (15) - maximum value is 14 with 1 SCSI controller(s)
Affected Resources or Data Sources
resource vsphere_virtual_machine
Debug Output
https://gist.github.com/ravatheodor/e70b7865fbb9e6b21d25c7a38a16e457#file-gistfile1-txt
Panic Output
No response
Expected Behavior
terraform plan successful
Actual Behavior
terraform plan failed
Steps to Reproduce
create an empty VM with 15 disks on SCSI controller 0 create a resource vsphere_virtual_machine cloning the VM using dynamic disk run terraform plan
Environment Details
No response
Screenshots
References
No response