Skip to content

Commit 5c3d3a6

Browse files
Merge pull request #111 from ptucholski/disk_mode_support
2 parents 0917fce + 5a44610 commit 5c3d3a6

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ resource "vsphere_virtual_machine" "vm" {
134134
io_reservation = length(var.io_reservation) > 0 ? var.io_reservation[template_disks.key] : null
135135
io_share_level = length(var.io_share_level) > 0 ? var.io_share_level[template_disks.key] : "normal"
136136
io_share_count = length(var.io_share_level) > 0 && var.io_share_level[template_disks.key] == "custom" ? var.io_share_count[template_disks.key] : null
137+
disk_mode = length(var.disk_mode) > 0 ? var.disk_mode[template_disks.key] : null
137138
}
138139
}
139140
// Additional disks defined by Terraform config
@@ -171,6 +172,7 @@ resource "vsphere_virtual_machine" "vm" {
171172
io_reservation = lookup(terraform_disks.value, "io_reservation", null)
172173
io_share_level = lookup(terraform_disks.value, "io_share_level", "normal")
173174
io_share_count = lookup(terraform_disks.value, "io_share_level", null) == "custom" ? lookup(terraform_disks.value, "io_share_count") : null
175+
disk_mode = lookup(terraform_disks.value, "disk_mode", null)
174176
}
175177
}
176178
clone {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ variable "io_share_count" {
6969
default = []
7070
}
7171

72+
variable "disk_mode" {
73+
description = "The disk mode for the disk."
74+
type = list(string)
75+
default = []
76+
}
77+
7278
variable "template_storage_policy_id" {
7379
description = "List of UUIDs of the storage policy to assign to the template disk."
7480
type = list(any)

0 commit comments

Comments
 (0)