Can someone help me what i’m doing wrong, If I deploy without the customize it works fine and put the network correctly but it does not get the ip automatically, just if I restore the network on ui
terraform {
required_providers {
vsphere = {
source = “hashicorp/vsphere”
version = “2.8.1”
}
}
}
provider “vsphere” {
user = “"
password = "**”
vsphere_server = “*******”
allow_unverified_ssl = true
}
data “vsphere_datacenter” “datacenter” {
name = “WDC-Lab”
}
data “vsphere_datastore” “datastore” {
name = “vsanDatastore-******”
datacenter_id = data.vsphere_datacenter.datacenter.id
}
data “vsphere_vapp_container” “pool” {
name = “v-app_yamashitar_9633”
datacenter_id = data.vsphere_datacenter.datacenter.id
}
data “vsphere_network” “network” {
name = “network-yamashitar-cce8”
datacenter_id = data.vsphere_datacenter.datacenter.id
}
data “vsphere_virtual_machine” “template” {
name = “dev-labesxi8u2-tplt”
datacenter_id = data.vsphere_datacenter.datacenter.id
}
resource “vsphere_virtual_machine” “cloned_virtual_machine” {
count = “2”
name = “test-computer-${format(”%02d", count.index + 1)}"
resource_pool_id = data.vsphere_vapp_container.pool.id
datastore_id = data.vsphere_datastore.datastore.id
num_cpus = 2
memory = 8192
guest_id = data.vsphere_virtual_machine.template.guest_id
scsi_type = “pvscsi”
firmware = “efi”
efi_secure_boot_enabled = true
nested_hv_enabled = true
wait_for_guest_ip_timeout = -1
wait_for_guest_net_timeout = -1
network_interface {
network_id = data.vsphere_network.network.id
adapter_type = “vmxnet3”
}
disk {
label = “disk0”
size = 45
}
clone {
template_uuid = data.vsphere_virtual_machine.template.id
timeout = 40
customize {
network_interface {}
linux_options {
host_name = "test-computer-${format("%02d", count.index + 1)}"
domain = "domain.internal"
}
}
}
}
error: vertex “vsphere_virtual_machine.cloned_virtual_machine[0]” error: error sending customization spec: A specified parameter was not correct: spec.identity