Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ibm_is_instance: Unable to upgrade to 1.39+ #3619

Closed
lra opened this issue Feb 28, 2022 · 3 comments
Closed

ibm_is_instance: Unable to upgrade to 1.39+ #3619

lra opened this issue Feb 28, 2022 · 3 comments
Labels
service/VPC Infrastructure Issues related to the VPC Infrastructure

Comments

@lra
Copy link

lra commented Feb 28, 2022

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

Terraform CLI and Terraform IBM Provider Version

Terraform v1.1.6
on linux_amd64
+ provider registry.terraform.io/ibm-cloud/ibm v1.39.0

Affected Resource(s)

  • ibm_is_instance

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "ibm_is_instance" "sdm_gateways" {
  name           = "something"
  vpc            = ibm_is_vpc.this.id
  zone           = var.availability_zone
  image          = data.ibm_is_image.this.id
  keys           = [ibm_is_ssh_key.sdm_gateways.id]
  profile        = "cx2-2x4"
  resource_group = var.resource_group_id

  primary_network_interface {
    subnet          = ibm_is_subnet.public.id
    security_groups = [ibm_is_security_group.sdm_gateways.id]
  }
}

Expected Behavior

Under ibm-cloud/ibm v1.38.2, we get a clean terraform plan.
When we upgrade to ibm-cloud/ibm v1.39.0, we should also have a clean terraform plan.

Actual Behavior

The IBM provider v1.39 wants to recreate our ibm_is_instance instances:

# module.strongdm_gateway_ibm_seismic_us_south.ibm_is_instance.sdm_gateways[0] must be replaced
-/+ resource "ibm_is_instance" "sdm_gateways" {
      ~ bandwidth                         = 4000 -> (known after apply)
      ~ crn                               = "crn:v1:bluemix:public:is:us-south-1:a/REDACTED::instance:REDACTED" -> (known after apply)
      + default_trusted_profile_auto_link = true # forces replacement
      ~ disks                             = [] -> (known after apply)
      ~ gpu                               = [] -> (known after apply)
      ~ id                                = "instance:REDACTED" -> (known after apply)
      ~ memory                            = 4 -> (known after apply)
      ~ metadata_service_enabled          = false -> (known after apply)
        name                              = "instance:REDACTED"
      ~ placement_target                  = [] -> (known after apply)
      ~ resource_controller_url           = "https://cloud.ibm.com/vpc-ext/compute/vs" -> (known after apply)
      ~ resource_crn                      = "crn:v1:bluemix:public:is:us-south-1:a/instance:REDACTED::instance:instance:REDACTED" -> (known after apply)
      ~ resource_group_name               = "instance:REDACTED" -> (known after apply)
      ~ resource_name                     = "instance:REDACTED" -> (known after apply)
      ~ resource_status                   = "running" -> (known after apply)
      ~ status                            = "running" -> (known after apply)
      ~ status_reasons                    = [] -> (known after apply)
      ~ tags                              = [] -> (known after apply)
      ~ total_network_bandwidth           = 3000 -> (known after apply)
      ~ total_volume_bandwidth            = 1000 -> (known after apply)
      ~ vcpu                              = [
          - {
              - architecture = "amd64"
              - count        = 2
            },
        ] -> (known after apply)
      ~ volume_attachments                = [
          - {
              - id          = "instance:REDACTED"
              - name        = "instance:REDACTED"
              - volume_crn  = "crn:v1:bluemix:public:is:us-south-1:a/instance:REDACTED::volume:instance:REDACTED"
              - volume_id   = "instance:REDACTED"
              - volume_name = "einstance:REDACTED"
            },
        ] -> (known after apply)
        # (8 unchanged attributes hidden)

The important part is: + default_trusted_profile_auto_link = true # forces replacement

  • If we explicitely set default_trusted_profile_auto_link to true, it wants to recreate the instance.
  • If we explicitely set default_trusted_profile_auto_link to false, it compaints the following error: "default_trusted_profile_auto_link": all of default_trusted_profile_auto_link,default_trusted_profile_target must be specified.

Steps to Reproduce

  1. Create a ibm_is_instance resource with ibm-cloud/ibm v1.38.2 without setting default_trusted_profile_auto_link.
  2. Upgrade to ibm-cloud/ibm v1.39.0
  3. Terraform wants to replace the instance
@github-actions github-actions bot added the service/VPC Infrastructure Issues related to the VPC Infrastructure label Feb 28, 2022
@deepaksibm
Copy link
Contributor

deepaksibm commented Mar 1, 2022

We have identified the issue and are working on it. as a workaround please use the below lifecycle argument

lifecycle {    ignore_changes = [  
    
        # Ignore changes to default_trusted_profile_auto_link, e.g.  to avoid force_new
          default_trusted_profile_auto_link,    ]  }
}

@muchafel
Copy link

muchafel commented Mar 1, 2022

same issue here... we were not careful enough which caused vsi recreation :(

@lra
Copy link
Author

lra commented Mar 2, 2022

@lra lra closed this as completed Mar 2, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/VPC Infrastructure Issues related to the VPC Infrastructure
Projects
None yet
Development

No branches or pull requests

3 participants