vmware / terraform-provider-vra

Terraform Provider for VMware Aria Automation
https://registry.terraform.io/providers/vmware/vra/
Mozilla Public License 2.0
104 stars 93 forks source link

Error: context deadline exceeded when creating cloud account in vra8.1 #246

Closed javansickle closed 4 years ago

javansickle commented 4 years ago

vRA version

vRA 8.1

Terraform version

Terraform v0.12.6
+ provider.vra v0.3.2

Problem
When using the terraform providor for vRA 8, I receive the following error when attempting to create a new Cloud Account (vSphere):

vra_cloud_account_vsphere.vc1: Still creating... [10s elapsed]
vra_cloud_account_vsphere.vc1: Still creating... [20s elapsed]
vra_cloud_account_vsphere.vc1: Still creating... [30s elapsed]

Error: Post "https://<vc1.company.com>/iaas/api/cloud-accounts-vsphere": context deadline exceeded

NOTE: This only occurs for two remote vCenters; local vCenters do NOT have this issue (using the same plan - only the hostname is different).

Seems like early timeout?

tf Plan

data "vra_region_enumeration_vsphere" "vc1" {
  username                = var.vc_username
  password                = var.vc_password
  hostname                = "<vc1.company.com>"
  accept_self_signed_cert = true
}

resource "vra_cloud_account_vsphere" "vc1" {
  name        = "vcenter1"
  description = "Hosting vCenter"
  username    = var.vc_username
  password    = var.vc_password
  hostname    = "<vc1.company.com>"

  regions                      = data.vra_region_enumeration_vsphere.vc1.regions
  accept_self_signed_cert      = true

  tags {
    key   = "platform"
    value = "vSphere"
  }
}
javansickle commented 3 years ago

I am still receiving the same error using vRA 8.2, terraform v0.13.4 and vra provider version 0.3.3. Oddly, the Cloud Account is actually created, but terraform still fails with the error: "context deadline exceeded"

dmettem commented 3 years ago

The timeout is already increased to 60 seconds and it appears that the request is taking longer than a minute.

javansickle commented 3 years ago

As I mentioned, it is a high-latency connection to the Cloud Account vCenter; Is it possible to make the timeout configurable from the terraform plan, vs. hard coding the value in the provider?

VickyWinner commented 3 years ago

@dmettem , do you have an option to be a configurable instead? I am having the same issue. I am not seeing an option to re-open this issue. Should I instead open a new issue?

dmettem commented 3 years ago

@VickyWinner Please open a new issue to make the timeout configurable across vSphere, VMC, NSX-V/T cloud account resources and region enumeration data sources for vSphere and VMC. Thank You!