diff --git a/README.md b/README.md index 90a4110..1509ae1 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,7 @@ module "example-server-windowsvm-advanced" { data_disk_label = ["label1", "label2"] disk_datastore = "vsanDatastore" // This will store Template disk in the defined disk_datastore data_disk_datastore = ["vsanDatastore", "nfsDatastore"] // Datastores for additional data disks + scsi_bus_sharing = "physicalSharing" // The modes are physicalSharing, virtualSharing, and noSharing scsi_type = "lsilogic" // Other acceptable value "pvscsi" scsi_controller = 0 // This will assign OS disk to controller 0 data_disk_scsi_controller = [0, 1] // This will create a new controller and assign second data disk to controller 1 diff --git a/main.tf b/main.tf index 3f2b9c9..3fbbd4d 100644 --- a/main.tf +++ b/main.tf @@ -87,6 +87,7 @@ resource "vsphere_virtual_machine" "Linux" { memory = var.ram_size memory_hot_add_enabled = var.memory_hot_add_enabled guest_id = data.vsphere_virtual_machine.template.guest_id + scsi_bus_sharing = var.scsi_bus_sharing scsi_type = var.scsi_type != "" ? var.scsi_type : data.vsphere_virtual_machine.template.scsi_type scsi_controller_count = length(var.data_disk_scsi_controller) > 0 ? max(max(var.data_disk_scsi_controller...) + 1, var.scsi_controller) : 1 @@ -182,6 +183,7 @@ resource "vsphere_virtual_machine" "Windows" { memory = var.ram_size memory_hot_add_enabled = var.memory_hot_add_enabled guest_id = data.vsphere_virtual_machine.template.guest_id + scsi_bus_sharing = var.scsi_bus_sharing scsi_type = var.scsi_type != "" ? var.scsi_type : data.vsphere_virtual_machine.template.scsi_type scsi_controller_count = length(var.data_disk_scsi_controller) > 0 ? max(max(var.data_disk_scsi_controller...) + 1, var.scsi_controller) : 1 diff --git a/variables.tf b/variables.tf index da17b90..cd83d07 100644 --- a/variables.tf +++ b/variables.tf @@ -204,6 +204,13 @@ variable "data_disk_scsi_controller" { # error_message = "The scsi_controller must be between 0 and 3" # } } + +variable "scsi_bus_sharing" { + description = "scsi_bus_sharing mode, acceptable values physicalSharing,virtualSharing,noSharing" + type = string + default = null +} + variable "scsi_type" { description = "scsi_controller type, acceptable values lsilogic,pvscsi " type = string