hashicorp / terraform-provider-vsphere

Terraform Provider for VMware vSphere
https://registry.terraform.io/providers/hashicorp/vsphere/
Mozilla Public License 2.0
609 stars 448 forks source link

Linux customisation running into timeout #1932

Open tom-mes opened 1 year ago

tom-mes commented 1 year ago

Community Guidelines

Terraform

v1.5.0 v1.4.6

Terraform Provider

v2.4.0

VMware vSphere

v7.0.3

Description

The create of a vm is running into a timeout when using customize linux_options for the setup of IP /dns etc. The machine is already configured and in desired state - only the event pull is not working.

We have a high retention amount of events on our productive system. The terraform pulling of events does not use any filter so it is running into a timeout. Maybe it is a solution to use a filter and pull only the events of the last 10 minutes (depending on the defined timeout). Testing a similar manual query on the event queue with a filter works, without it also runs into timeout.

Testing our config on a small test vsphere cluster works when there is only a small event retention.

Affected Resources or Data Sources

resource/vsphere_virtual_machine

Terraform Configuration

  clone {
    template_uuid = data.vsphere_virtual_machine.template.uuid

    customize {
      linux_options {
        host_name = each.value.name
        domain    = "mytest.mygroup"
      }
      network_interface {
        ipv4_address = each.value.address
        ipv4_netmask = each.value.netmask
      }
      ipv4_gateway = each.value.asa_gateway
    }
  }

Debug Output

vsphere_virtual_machine.rocky_server["v-sax-e12-e-a"]: Still creating... [9m40s elapsed]
vsphere_virtual_machine.rocky_server["v-sax-e12-e-a"]: Still creating... [9m50s elapsed]
vsphere_virtual_machine.rocky_server["v-sax-e12-e-a"]: Still creating... [10m0s elapsed]
╷
│ Error: 
│ Virtual machine customization failed on "/Test/v-sax-e12-e-a":
│ 
│ timeout waiting for customization to complete
│ 
│ The virtual machine has not been deleted to assist with troubleshooting. If
│ corrective steps are taken without modifying the "customize" block of the
│ resource configuration, the resource will need to be tainted before trying
│ again. For more information on how to do this, see the following page:
│ https://www.terraform.io/docs/commands/taint.html
│ 
│ 
│   with vsphere_virtual_machine.rocky_server["v-sax-e12-e-a"],
│   on main.tf line 43, in resource "vsphere_virtual_machine" "rocky_server":
│   43: resource "vsphere_virtual_machine" "rocky_server" {
│ 

Panic Output

No response

Expected Behavior

Creating a vm without timeout

Actual Behavior

timeout

Steps to Reproduce

vsphere cluster with a high rentention / amount of log evnts

Environment Details

No response

Screenshots

No response

References

No response

github-actions[bot] commented 1 year ago

Hello, tom-mes! 🖐

Thank you for submitting an issue for this provider. The issue will now enter into the issue lifecycle.

If you want to contribute to this project, please review the contributing guidelines and information on submitting pull requests.

tenthirtyam commented 1 month ago

Hi @tom-mes 👋 - have you tried setting the API Timeout in the provider configuration to help resolve the issue due to the potential congestion?

Ryan