Skip to content

Commit eb2ee10

Browse files
committed
provide examples for fqdnvmname & vmstartcount
1 parent c21de86 commit eb2ee10

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

examples/example-vmname.tf

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,40 @@ module "example-server-multi" {
5454
#
5555
//Example of appending domain name to vm name
5656

57-
variable "domain" {
58-
default = "somedomain.com"
57+
module "example-server-fqdnvmname" {
58+
source = "Terraform-VMWare-Modules/vm/vsphere"
59+
version = "Latest X.X.X"
60+
vmtemp = "TemplateName"
61+
instances = 2
62+
vmname = "advancevm"
63+
vmnameformat = "%03d"
64+
domain = "somedomain.com"
65+
fqdnvmname = true
66+
vmrp = "esxi/Resources"
67+
network = {
68+
"Name of the Port Group in vSphere" = ["10.13.113.2", ""]
69+
}
70+
dc = "Datacenter"
71+
datastore = "Data Store name(use datastore_cluster for datastore cluster)"
5972
}
60-
module "example-server-multi" {
73+
# Vmname Output -> advancevm001.somedomain.com, advancevm002.somedomain.com
74+
#
75+
//Example of using a starting number other than "1" for the vmname with multiple instances
76+
77+
module "example-server-vmstartcount" {
6178
source = "Terraform-VMWare-Modules/vm/vsphere"
6279
version = "Latest X.X.X"
6380
vmtemp = "TemplateName"
6481
instances = 2
82+
vmstartcount = 5
6583
vmname = "advancevm"
66-
vmnameformat = "%03d.${var.domain}"
84+
vmnameformat = "%03d"
6785
vmrp = "esxi/Resources"
6886
network = {
6987
"Name of the Port Group in vSphere" = ["10.13.113.2", ""]
7088
}
7189
dc = "Datacenter"
7290
datastore = "Data Store name(use datastore_cluster for datastore cluster)"
7391
}
74-
# Vmname Output -> advancevm001.somedomain.com, advancevm002dev.somedomain.com
92+
# Vmname Output -> advancevm005, advancevm006
93+

0 commit comments

Comments
 (0)