orange-cloudavenue / terraform-provider-cloudavenue

Terraform Cloud Avenue provider
https://registry.terraform.io/providers/orange-cloudavenue/cloudavenue
Mozilla Public License 2.0
14 stars 3 forks source link

[Bug]: VDC - adding second Storage Profile ends with a timeout #764

Open matmb-cld opened 1 month ago

matmb-cld commented 1 month ago

Terraform Core Version

1.8.5

Cloud Avenue Provider Version

0.18.4

Affected Resource(s)

Expected Behavior

When changing cloudavenue_vdc.storage_profiles, the terraform apply should end properly.

Actual Behavior

When changing cloudavenue_vdc.storage_profiles, the terraform apply ends with a timeout.

Relevant Error/Panic Output Snippet

│ Error: Error updating VDC
│ 
│   with cloudavenue_vdc.test_poc,
│   on vdc.tf line 1, in resource "cloudavenue_vdc" "test_poc":
│    1: resource "cloudavenue_vdc" "test_poc" {
│ 
│ timeout after 90 seconds

Terraform Configuration Files

Providers.tf

terraform {

  backend "s3" {
    bucket = "hz-lld-tfstate-prod"
    key    = "management_admin_zone_vdc/management_admin_zone_vdc.tfstate"
    endpoints = {
      s3 = "https://s3-region01.cloudavenue.orange-business.com"
    }
    region                      = "region01"
    skip_region_validation      = true
    skip_metadata_api_check     = true
    skip_credentials_validation = true
    skip_requesting_account_id  = true
    use_path_style              = true
    skip_s3_checksum            = true
  }

  required_providers {
    cloudavenue = {
      source  = "orange-cloudavenue/cloudavenue"
      version = "0.18.4"
    }
  }
}

provider "cloudavenue" {}

vdc.tf for creation

resource "cloudavenue_vdc" "test_poc" {
  name                  = "test-poc"
  description           = "Test POC"
  cpu_allocated         = 48000
  cpu_speed_in_mhz      = 1200
  memory_allocated      = 40
  billing_model         = "RESERVED"
  disponibility_class   = "DUAL-ROOM"
  service_class         = "ECO"
  storage_billing_model = "RESERVED"
  storage_profiles = [
    { class = "silver_r1", default = true, limit = 500 },
  ]
}

vdc.tf for modification

resource "cloudavenue_vdc" "test_poc" {
  name                  = "test-poc"
  description           = "Test POC"
  cpu_allocated         = 48000
  cpu_speed_in_mhz      = 1200
  memory_allocated      = 40
  billing_model         = "RESERVED"
  disponibility_class   = "DUAL-ROOM"
  service_class         = "ECO"
  storage_billing_model = "RESERVED"
  storage_profiles = [
    { class = "silver_r1", default = true, limit = 500 },
    { class = "silver_r2", default = false, limit = 500 },
  ]
}

Steps to Reproduce

  1. Create the VDC with création configuration file with command terraform apply
  2. Modify the VDC with modification configuration file with command terraform apply

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

matmb-cld commented 1 month ago

Same timeout issue occurs when a VDC has been created with two storage_profiles and then we try to modify these profiles (increase limit for example):

  1. Creation Storage Profile
    storage_profiles = [
    { class = "silver_r1", default = true, limit = 500 },
    { class = "silver_r2", default = false, limit = 500 },
    ]
  2. Modified Storage Profile
    storage_profiles = [
    { class = "silver_r1", default = true, limit = 600 },
    { class = "silver_r2", default = false, limit = 600 },
    ]
azrod commented 1 month ago

Hi @matmb-cld,

The problem does not come from the terraform provider but from a problem on CloudAvenue. I have forwarded your problem and will let you know when it is resolved.

Regards

azrod commented 1 month ago

@matmb-cld Please retry.

matmb-cld commented 4 weeks ago

Hi @azrod Yes It works now. Sometimes there is still a timeout error but after a retry the terraform apply command completes. I think we can close this issue. Thanks for your help.