Reply to Message

View discussion in a popup

Replying to:
amitmvyas
Contributor
Contributor

vSphere ESXi 8.0 System Host ID

Hi,

I am trying to deploy VM thru Terraform using code given in the post on Standalone ESXi server and I am getting error while running terraform -apply command.

Error: while extracting OVF parameters: could not find host with ID "host-10": ServerFaultCode: The object 'vim.HostSystem:host-10' has already been deleted or has not been completely created

I tried giving host_system_id parameter randomly but it didn't help. I also looked at the logs /var/log/fdm.log file but it was empty and couldn't be help.

I would like to know from where I can get the host_system_id which is required to deploy VM using OVF option to standalone ESXi host.

 terraform {

     required_providers {
     vsphere = {
     source = "hashicorp/vsphere"
     version = "2.4.3"
       }
     }
  }

provider "vsphere" {
     user = ${var.exsi_user}
     password = ${var.esxi_passwd}
     vsphere_server = ${var.esxi_server}
     allow_unverified_ssl = true
}

resource "vsphere_virtual_machine" "amitv-test-vm" {
     name = "AmitV-Test-Vm-01"
     datastore_id = "/vmfs/volumes/NFS_Storage" # data.vsphere_datastore.datastore.id
     host_system_id = "host-10"
     resource_pool_id = "ha-root-pool"

     wait_for_guest_net_timeout = 0
     wait_for_guest_ip_timeout = 0

     ovf_deploy {
     allow_unverified_ssl_cert = true
     local_ovf_path = "/Users/amitvyas/Downloads/AmitV-Test-VM.ovf"
     disk_provisioning = "thin"
     ip_protocol = "IPV4"
     ip_allocation_policy = "STATIC_MANUAL"
     ovf_network_map = {
          "Network 1" = "VM Network"
          "Network 2" = "PG_Storage_VM"
          }
     }
     vapp {
          properties = {
          "guestinfo.hostname" = "amitv-test-vm",
          "guestinfo.ipaddress" = "10.0.1.199",
          "guestinfo.netmask" = "255.255.255.0",
          "guestinfo.gateway" = "10.0.1.1",
          "guestinfo.dns" = "10.0.1.1",
          "guestinfo.domain" = "example.com",
          "guestinfo.ntp" = "ntp.example.com",
          "guestinfo.password" = "VMware1!",
          "guestinfo.ssh" = "True"
          }
     }
}
 
 
Regards,
Amit Vyas
Reply
0 Kudos