terraform-provider-vsphere: Timeout waiting for customization to complete

Terraform Version

v1.0.10 on darwin_arm64

vSphere Provider Version

latest

Affected Resource(s)

  • Virtual Machine
  • Guest os?
  • Network adapter not connecting

Terraform main:

provider "vsphere" {
  user           = "${var.vsphere_username}"
  password       = "${var.vsphere_password}"
  vsphere_server = "${var.vsphere_server}"

  allow_unverified_ssl = true
}

resource "vsphere_virtual_machine" "vm" {
  name             = "terraformtest"
  wait_for_guest_net_routable = false
  wait_for_guest_net_timeout = 0
  resource_pool_id = "${data.vsphere_compute_cluster.cluster.resource_pool_id}"
  datastore_id     = "${data.vsphere_datastore.datastore.id}"

  enable_logging = true

  network_interface {
  network_id    = "${data.vsphere_network.network.id}"
}
  num_cpus = 2
  memory   = 6144
  guest_id = data.vsphere_virtual_machine.template.guest_id
  scsi_type = "${data.vsphere_virtual_machine.template.scsi_type}"

  disk {
    label = "disk0"
    size  = 25
  }

  clone {
    template_uuid = "${data.vsphere_virtual_machine.template.id}"

    customize {
      linux_options {
        host_name = "ubuntutest"
        domain    = "ubuntutest.local"
      }

      network_interface {
        ipv4_address = "192.168.1.100"
        ipv4_netmask = 24
      }

      ipv4_gateway = "192.168.1.1"
    }
  }
}

Debug Output

Error: │ Virtual machine customization failed on “/dir/vm/ubunutest”: │ │ timeout waiting for customization to complete

│ with vsphere_virtual_machine.vm, │ on main.tf line 9, in resource “vsphere_virtual_machine” “vm”: │ 9: resource “vsphere_virtual_machine” “vm” {

Expected Behavior

Deploy the VM and connect the network adapter when its done.

Actual Behavior

Fails, but the VM is somewhat correct.

Steps to Reproduce

Terraform apply

Important Factoids

The template (ubuntu 20.04 iso) is built with packer. I have tested:

References

My packer template (before all changes and tests): https://github.com/it-pappa/Packer-vsphere/tree/main/Ubuntu.20.04

Cloud fix from vmware. https://kb.vmware.com/s/article/59557

I have really pulled my hair on this issue while im learning Terraform and packer, but this have had me standing still for allmost 2 weeks. I really hope someone can help me on this.

Environment: 2 ESXI 6.7 1 vCenter 6.7 Network i open from my mac to the cluster (does it need an opening the other way also? All is patched (vCenter is on earlier hardware version, but should not matter?)

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave “+1” or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15

Most upvoted comments

@tenthirtyam thanks man. I really appreciate you support on this. Thank you so much and you modules have been helping me alot. I will close on this note 😃 Great job on everything and have a great weekend.