Hello,
I’m trying to apply this configuration on my development environment
terraform {
backend "local" {
path = "state/terraform.tfstate"
}
}
provider "vsphere" {
user = "root"
password = "XXXXXXX"
vsphere_server = "192.168.1.101"
allow_unverified_ssl = true
}
data "vsphere_datacenter" "dc" {
name = "ha-datacenter"
}
data "vsphere_datastore" "datastore" {
name = "datastore1"
datacenter_id = data.vsphere_datacenter.dc.id
}
data "vsphere_resource_pool" "pool" {
name = "Resources"
datacenter_id = data.vsphere_datacenter.dc.id
}
data "vsphere_host" "host" {
name = "192.168.1.101"
datacenter_id = data.vsphere_datacenter.dc.id
}
data "vsphere_network" "network" {
name = "VM Network"
datacenter_id = data.vsphere_datacenter.dc.id
}
resource "vsphere_virtual_machine" "vmFromLocalOvf" {
name = "W2K19Reim"
datacenter_id = data.vsphere_datacenter.dc.id
resource_pool_id = data.vsphere_resource_pool.pool.id
datastore_id = data.vsphere_datastore.datastore.id
host_system_id = data.vsphere_host.host.id
wait_for_guest_net_timeout = 0
wait_for_guest_ip_timeout = 0
ovf_deploy {
local_ovf_path = "C:\\terraform\\template\\W2K19.ovf"
}
}
When i run terraform apply i get an error like:
vsphere_virtual_machine.vmFromLocalOvf: Creating…
╷
│ Error: error while importing ovf/ova template, error while uploading the disk W2K19-0.vmdk error while uploading the file C:\terraform\template\W2K19-0.vmdk Post “https://*/ha-nfc/525679fb-6def-195b-bfa4-e23a4127fa0f/W2K19Reim-0.vmdk”: dial tcp: lookup *: no such host
│
│ with vsphere_virtual_machine.vmFromLocalOvf,
│ on terraform.tf line 39, in resource “vsphere_virtual_machine” “vmFromLocalOvf”:
│ 39: resource “vsphere_virtual_machine” “vmFromLocalOvf” {
│
╵
i don’t know why, everything point to the ESXI IP
any hints?