IBM-Cloud / terraform-provider-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
341 stars 670 forks source link

Timeouts not being respected #1442

Closed js-max closed 4 years ago

js-max commented 4 years ago

I'm facing serveral timeouts with IBM Cloud platform, even UI/Web interface sometimes fail... It's not due to my laptop or/and connection because I'm testing terraform apply from multiple locations...

So timeouts were my next step but it's not working...

Terraform Version

Terraform v0.12.24
+ provider.ibm v1.5.2

Affected Resource(s)

Please list the resources as a list, for example:

Terraform Configuration Files

resource "ibm_is_instance" "be-confluent" {
  ...

  timeouts {
    create = "5m"
    delete = "5m"
  }
}

Debug Output

...
ibm_is_instance.be-confluent: Still creating... [6m50s elapsed]
ibm_is_instance.be-confluent: Still creating... [7m0s elapsed]
ibm_is_instance.be-confluent: Still creating... [7m10s elapsed]
ibm_is_instance.be-confluent: Still creating... [7m20s elapsed]
ibm_is_instance.be-confluent: Still creating... [7m30s elapsed]
...

Expected Behavior

Expected to see timeout/finished attempt to create resource

Actual Behavior

Going until reach 60 min

Steps to Reproduce

  1. terraform apply
VaishnaviGopal commented 4 years ago

Hi @js-max . Can you try including update timeout too in your timeouts block and check if you are still getting any error. Because internally, while creating instance, it goes to update method to check if there is any volume attachment or network interfaces that needs to be attached.

stevestrutt commented 4 years ago

@VaishnaviGopal If this is the case about Update, the documentation needs to be clearer. Additionally the default timeout of 60m is far too long Gen2 VSIs. This needs to be reduced. It was reasonable for Classic and Gen1 Softlayer based VSIs, but is inappropriate for Gen2. The design point is a couple of minutes to create ten's of VSIs. 15 minutes to create hundreds.

Typically anything beyond a few minutes indicates that there is a provisioning issue and sadly I am starting to see more of these with Gen2. The default of 60m is very painful.

js-max commented 4 years ago

@VaishnaviGopal your suggestion will be to have:

  timeouts {
    create  = "10m"
    delete  = "10m"
    update  = "10m"
  }

??

Also, will that be available for all resources? For example ibm_is_volume?

VaishnaviGopal commented 4 years ago

Hi @js-max , yes the timeout block needs to be written that way. And regarding the availabilty of timeout options for create, update and delete, you can refer to the documentation. We have updated the documentation. These doc changes will go into tomorrow's terraform-provider-ibm relsease.

@stevestrutt , We have modified the default timeout to 10m for all the vpc resources. This change will also be seen in the tomorrow's release.

hkantare commented 4 years ago

Update the IBM cloud docs..