Skip to content

Commit

Permalink
Merge pull request #34 from SamyCoenen/feature/scsi-bus-sharing
Browse files Browse the repository at this point in the history
scsi bus sharing parameter
  • Loading branch information
Arman-Keyoumarsi authored Jul 20, 2020
2 parents 479bd26 + 89233b8 commit dac9c2c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dac9c2c

Please sign in to comment.