Skip to content

Commit dac9c2c

Browse files
Merge pull request #34 from SamyCoenen/feature/scsi-bus-sharing
scsi bus sharing parameter
2 parents 479bd26 + 89233b8 commit dac9c2c

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ module "example-server-windowsvm-advanced" {
119119
data_disk_label = ["label1", "label2"]
120120
disk_datastore = "vsanDatastore" // This will store Template disk in the defined disk_datastore
121121
data_disk_datastore = ["vsanDatastore", "nfsDatastore"] // Datastores for additional data disks
122+
scsi_bus_sharing = "physicalSharing" // The modes are physicalSharing, virtualSharing, and noSharing
122123
scsi_type = "lsilogic" // Other acceptable value "pvscsi"
123124
scsi_controller = 0 // This will assign OS disk to controller 0
124125
data_disk_scsi_controller = [0, 1] // This will create a new controller and assign second data disk to controller 1

main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ resource "vsphere_virtual_machine" "Linux" {
8787
memory = var.ram_size
8888
memory_hot_add_enabled = var.memory_hot_add_enabled
8989
guest_id = data.vsphere_virtual_machine.template.guest_id
90+
scsi_bus_sharing = var.scsi_bus_sharing
9091
scsi_type = var.scsi_type != "" ? var.scsi_type : data.vsphere_virtual_machine.template.scsi_type
9192
scsi_controller_count = length(var.data_disk_scsi_controller) > 0 ? max(max(var.data_disk_scsi_controller...) + 1, var.scsi_controller) : 1
9293

@@ -182,6 +183,7 @@ resource "vsphere_virtual_machine" "Windows" {
182183
memory = var.ram_size
183184
memory_hot_add_enabled = var.memory_hot_add_enabled
184185
guest_id = data.vsphere_virtual_machine.template.guest_id
186+
scsi_bus_sharing = var.scsi_bus_sharing
185187
scsi_type = var.scsi_type != "" ? var.scsi_type : data.vsphere_virtual_machine.template.scsi_type
186188
scsi_controller_count = length(var.data_disk_scsi_controller) > 0 ? max(max(var.data_disk_scsi_controller...) + 1, var.scsi_controller) : 1
187189

variables.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,13 @@ variable "data_disk_scsi_controller" {
204204
# error_message = "The scsi_controller must be between 0 and 3"
205205
# }
206206
}
207+
208+
variable "scsi_bus_sharing" {
209+
description = "scsi_bus_sharing mode, acceptable values physicalSharing,virtualSharing,noSharing"
210+
type = string
211+
default = null
212+
}
213+
207214
variable "scsi_type" {
208215
description = "scsi_controller type, acceptable values lsilogic,pvscsi "
209216
type = string

0 commit comments

Comments
 (0)