Skip to content

Commit 496f688

Browse files
committed
Add scsi_bus_sharing parameter
1 parent 406d8c3 commit 496f688

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
@@ -118,6 +118,7 @@ module "example-server-windowsvm-advanced" {
118118
data_disk_label = ["label1", "label2"]
119119
disk_datastore = "vsanDatastore" // This will store Template disk in the defined disk_datastore
120120
data_disk_datastore = ["vsanDatastore", "nfsDatastore"] // Datastores for additional data disks
121+
scsi_bus_sharing = "physicalSharing" // The modes are physicalSharing, virtualSharing, and noSharing
121122
scsi_type = "lsilogic" // Other acceptable value "pvscsi"
122123
scsi_controller = 0 // This will assign OS disk to controller 0
123124
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
@@ -85,6 +85,7 @@ resource "vsphere_virtual_machine" "Linux" {
8585
memory = var.ram_size
8686
memory_hot_add_enabled = var.memory_hot_add_enabled
8787
guest_id = data.vsphere_virtual_machine.template.guest_id
88+
scsi_bus_sharing = var.scsi_bus_sharing
8889
scsi_type = var.scsi_type != "" ? var.scsi_type : data.vsphere_virtual_machine.template.scsi_type
8990
scsi_controller_count = length(var.data_disk_scsi_controller) > 0 ? max(max(var.data_disk_scsi_controller...) + 1, var.scsi_controller) : 1
9091

@@ -178,6 +179,7 @@ resource "vsphere_virtual_machine" "Windows" {
178179
memory = var.ram_size
179180
memory_hot_add_enabled = var.memory_hot_add_enabled
180181
guest_id = data.vsphere_virtual_machine.template.guest_id
182+
scsi_bus_sharing = var.scsi_bus_sharing
181183
scsi_type = var.scsi_type != "" ? var.scsi_type : data.vsphere_virtual_machine.template.scsi_type
182184
scsi_controller_count = length(var.data_disk_scsi_controller) > 0 ? max(max(var.data_disk_scsi_controller...) + 1, var.scsi_controller) : 1
183185

variables.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,13 @@ variable "data_disk_scsi_controller" {
193193
# error_message = "The scsi_controller must be between 0 and 3"
194194
# }
195195
}
196+
197+
variable "scsi_bus_sharing" {
198+
description = "scsi_bus_sharing mode, acceptable values physicalSharing,virtualSharing,noSharing"
199+
type = string
200+
default = ""
201+
}
202+
196203
variable "scsi_type" {
197204
description = "scsi_controller type, acceptable values lsilogic,pvscsi "
198205
type = string

0 commit comments

Comments
 (0)