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_pi_instance: pi_network attribute :: Provider incorrectly seems to detect a change, applies it - next apply incorrectly detects the same change #5224

Closed
surajsbharadwaj opened this issue Mar 21, 2024 · 4 comments · Fixed by #5253
Labels
service/Power Systems Issues related to Power Systems

Comments

@surajsbharadwaj
Copy link

surajsbharadwaj commented Mar 21, 2024

Sample code

resource "ibm_pi_instance" "instance" {
  pi_cloud_instance_id     = var.pi_workspace_guid
  pi_instance_name         = var.pi_instance_name
  pi_image_id              = var.pi_image_id
  pi_sap_profile_id        = var.pi_sap_profile_id == null ? null : var.pi_sap_profile_id
  pi_processors            = var.pi_sap_profile_id != null ? null : var.pi_number_of_processors
  pi_memory                = var.pi_sap_profile_id != null ? null : var.pi_memory_size
  pi_sys_type              = var.pi_sap_profile_id != null ? null : var.pi_server_type
  pi_proc_type             = var.pi_sap_profile_id != null ? null : var.pi_cpu_proc_type
  pi_key_pair_name         = var.pi_ssh_public_key_name
  pi_health_status         = "OK"
  pi_storage_pool_affinity = false
  pi_storage_type          = local.pi_boot_image_storage_tier

  dynamic "pi_network" {
    for_each = var.pi_networks
    content {
      network_id = pi_network.value.id
    }
  }

  timeouts {
    create = "50m"
  }

  lifecycle {
    ignore_changes = [pi_cloud_instance_id, pi_image_id]
  }
}

ibm_pi_instance. instance will be updated in-place

# ibm_pi_instance.instance will be updated in-place
  ~ resource "ibm_pi_instance" "instance" {
        id                             = "9c06d320-022d-477b-9908-aaf8efb2f2f6/72fd3d05-e8f6-4369-a98c-406df479f9bd"
        # (31 unchanged attributes hidden)

      ~ pi_network {
          ~ network_id   = "7134bc0f-0386-4a0a-b725-900e57a2b2c1" -> "d3debdc7-af73-4aab-ad8a-c8919e20098b"
            # (4 unchanged attributes hidden)
        }
      ~ pi_network {
          ~ network_id   = "d3debdc7-af73-4aab-ad8a-c8919e20098b" -> "7134bc0f-0386-4a0a-b725-900e57a2b2c1"
            # (4 unchanged attributes hidden)
        }

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.

ibm_pi_instance.instance: Modifying... [id=9c06d320-022d-477b-9908-aaf8efb2f2f6/72fd3d05-e8f6-4369-a98c-406df479f9bd]
ibm_pi_instance.instance: Modifications complete after 5s [id=9c06d320-022d-477b-9908-aaf8efb2f2f6/72fd3d05-e8f6-4369-a98c-406df479f9bd]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

@github-actions github-actions bot added the service/Power Systems Issues related to Power Systems label Mar 21, 2024
@surajsbharadwaj
Copy link
Author

@michaelkad
Copy link
Collaborator

@surajsbharadwaj Hmmm! The network ids are being swapped of some unknown reasons.
Could you share the Debug logs ?

@surajsbharadwaj
Copy link
Author

surajsbharadwaj commented Mar 25, 2024

Logs.zip

@michaelkad @hkantare @ismirlia the issue is in ibm provider version 1.63.0. And not in 1.62.0 as I tested with both versions

@surajsbharadwaj
Copy link
Author

@hkantare will this be released In version 1.64.0 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/Power Systems Issues related to Power Systems
Projects
None yet
2 participants