53 lines
1.6 KiB
HCL
53 lines
1.6 KiB
HCL
resource "vsphere_virtual_machine" "TF-DC01" {
|
|
name = "TF-DC01"
|
|
resource_pool_id = data.vsphere_resource_pool.pool.id
|
|
datastore_id = data.vsphere_datastore.vmdatastore.id
|
|
folder = var.vsphere_vmfolder
|
|
|
|
num_cpus = 2
|
|
memory = 4096
|
|
|
|
network_interface {
|
|
network_id = data.vsphere_network.network.id
|
|
}
|
|
|
|
disk {
|
|
label = "disk0"
|
|
unit_number = 0
|
|
size = 40
|
|
thin_provisioned = true
|
|
}
|
|
|
|
vapp {
|
|
properties = {
|
|
# "deployment.type" = "primary"
|
|
|
|
"guestinfo.hostname" = "TF-DC01"
|
|
"guestinfo.ipaddress" = "10.0.0.21"
|
|
"guestinfo.prefixlength" = "24"
|
|
# "guestinfo.dnsserver" = "0.0.0.0"
|
|
"guestinfo.gateway" = "10.0.0.1"
|
|
|
|
"addsconfig.domainname" = "srv.io"
|
|
"addsconfig.netbiosname" = "SRV"
|
|
"addsconfig.administratorpw" = var.adds_password
|
|
"addsconfig.safemodepw" = var.adds_password
|
|
"addsconfig.ntpserver" = "0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org"
|
|
|
|
# "dhcpconfig.startip" = "10.0.0.50"
|
|
# "dhcpconfig.endip" = "10.0.0.250"
|
|
# "dhcpconfig.subnetmask" = "255.255.255.0"
|
|
# "dhcpconfig.gateway" = "10.0.0.1"
|
|
# "dhcpconfig.leaseduration" = "01:00:00.00"
|
|
}
|
|
}
|
|
|
|
clone {
|
|
template_uuid = vsphere_content_library_item.ADDS.id
|
|
}
|
|
|
|
# # This does not actually achieve protection from destruction, see https://github.com/hashicorp/terraform/issues/17599
|
|
# lifecycle {
|
|
# prevent_destroy = true
|
|
# }
|
|
} |