Skip to content

Commit

Permalink
Add data datastore after merge, add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
SamyCoenen committed May 13, 2020
1 parent 1927021 commit 20216ec
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/linux/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ module "example-server-linuxvm-advanced" {
"VM Network" = ["192.168.0.4", ""] // Here the first instance will use Static Ip and Second set to DHCP
"test" = ["", "192.168.0.3"]
}
disk_datastore = "vsanDatastore"
data_disk_datastore = ["vsanDatastore", "nfsDatastore"]
data_disk_size_gb = [10, 5] // Aditional Disks to be used
thin_provisioned = ["true", "false"]
vmdns = ["192.168.0.2", "192.168.0.1"]
Expand Down
2 changes: 2 additions & 0 deletions examples/windows/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ module "example-server-windowsvm-advanced" {
"VM Network" = ["192.168.0.4", ""] // Here the first instance will use Static Ip and Second DHCP
"test" = ["", "192.168.0.3"]
}
disk_datastore = "vsanDatastore"
data_disk_datastore = ["vsanDatastore", "nfsDatastore"]
data_disk_size_gb = [10, 5] // Aditional Disks to be used
thin_provisioned = ["true", "false"]
vmdns = ["192.168.0.2", "192.168.0.1"]
Expand Down
12 changes: 12 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ data "vsphere_datastore" "datastore" {
datacenter_id = data.vsphere_datacenter.dc.id
}

data "vsphere_datastore" "disk_datastore" {
count = var.disk_datastore != "" ? 1 : 0
name = var.disk_datastore
datacenter_id = data.vsphere_datacenter.dc.id
}

data "vsphere_datastore" "data_disk_datastore" {
for_each = toset(var.data_disk_datastore)
name = each.key
datacenter_id = data.vsphere_datacenter.dc.id
}

data "vsphere_resource_pool" "pool" {
name = var.vmrp
datacenter_id = data.vsphere_datacenter.dc.id
Expand Down

0 comments on commit 20216ec

Please sign in to comment.