Multiple scsi controller and disk

hello everyone
our VM template setup is
OS: RHEL
Version: 7.6

Our template comprises of 2 disk -
1st disk - 1GB for /boot
2nd disk - 15GB for /, /var, …
The above are all on scsi0

we would like to add disk 3, disk 4 and disk 5 as follows
disk3 - scsi1:0
disk 4 - scsi1:1

disk5 - scsi2:0

We tried using the unit number, but i dont think we are interpreting the documentation very well.

  • unit_number - (Optional) The disk number on the storage bus. The maximum value for this setting is the value of the controller count times the controller capacity (15 for SCSI, 30 for SATA, and 2 for IDE). The default is 0 , for which one disk must be set to. Duplicate unit numbers are not allowed.

scsi_controller_count - (Optional) The number of SCSI controllers that Terraform manages on this virtual machine. This directly affects the amount of disks you can add to the virtual machine and the maximum disk unit number. Note that lowering this value does not remove controllers.

so if our disk 3 is scsi1:0
would our scsi controller will be 3
what would be our unit number?? and how will this correlate to scsi1:0

Thanks everyone

Don’t know if you got an answer to this question, but you are on the right track.

The unit number is s(15)+b=n where “s” equals the scsi controller, “b” equals bus, and n equals unit_number. examples:
scsi0:4
0(15)+4=4

scsi1:0
1(15)+0=15

scsi2:0
2(15)+0=30

The below section will give you two VMs with the names test-01 and test-02. Both will have a total of 6 disk and 3 scsi controllers and the drives on the requested scsi controll/bus

resource “vsphere_virtual_machine” “test” {
count = 2
name = “test-0${count.index + 1}”
resource_pool_id = data.vsphere_compute_cluster.compute_cluster.resource_pool_id
datastore_id = data.vsphere_datastore.ds.id
folder = var.vsphere_folder
num_cpus = var.vm_cpu
memory = var.vm_ram
guest_id = data.vsphere_virtual_machine.source_template.guest_id
scsi_controller_count = 3
scsi_type = data.vsphere_virtual_machine.source_template.scsi_type

network_interface {
network_id = data.vsphere_network.network.id
adapter_type = data.vsphere_virtual_machine.source_template.network_interface_types[0]
}

disk {
label = “disk0”
size = data.vsphere_virtual_machine.windows_template.disks.0.size
}

disk {
label = “disk1”
size = var.disk1_size_gb
unit_number = “2”

}

disk {
label = “disk2”
size = var.disk2_size_gb
unit_number = “3”

}

disk {
label = “disk3”
size = var.disk3_size_gb
unit_number = “15”

}

disk {
label = “disk4”
size = var.disk4_size_gb
unit_number = “16”

}

disk {
label = “disk5”
size = var.disk5_size_gb
unit_number = “30”

}