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

ibm_is_instance and ibm_is_volume are forcing to recreate the resources even if no changes in tf state #2273

Closed kapild-devops closed 1 year ago

kapild-devops commented 3 years ago

Hi,

I have created TF modules for vpc and vm instance and calling those modules using root module. the dependency between modules are done using depends_no meta argument. on first try resources creation done successfully but when we apply it for the second time, it is forcing it to recreate the resources ( ibm_is_instance and ibm_is_volume ) even there is no change in state

Terraform Version

Terraform v0.13.5

The resources are created in VPC Gen2 using above ibm provider and terraform version.

Affected Resource(s)

Please list the resources as a list, for example:

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

module "test-vm" {
  source                  = "./test-vm"
}

module "test-vpc" {
  source                  = "./test-vpc"
}

module test-vm:

resource "ibm_is_instance" "vm" {
  name           = "test-${count.index + 1}"
  vpc            = data.ibm_is_vpc.ds_vpc.id
  zone           = element(data.ibm_is_zones.ds_zones.zones, count.index)
  keys           = [data.ibm_is_ssh_key.existing_ssh_key.id]
  image          = data.ibm_is_image.ubuntu.id
  profile        = var.ibm_machine_type
  count          = var.no_of_vm

  user_data = element(data.template_file.user_data*.rendered, count.index)

  primary_network_interface {
    subnet          = data.ibm_is_subnet.backend_subnet[count.index].id
    security_groups = [data.ibm_is_vpc.ds_vpc.default_security_group]
  }
  volumes = [
    ibm_is_volume.volume[count.index].id,
  ]
}

resource "ibm_is_volume" "volume" {
  count          = var.no_of_vm
  name           = "storage-${count.index + 1}"
  profile        = "custom"
  zone           = element(data.ibm_is_zones.ds_zones.zones, count.index)
  iops           = var.disk_iops
  capacity       = var.disk_size
}

Logs:

` the recreation happen due to changes found in below resource even there is no change.

for volume : zone for instance: vpc, subnet and zone

module.test-vm.ibm_is_instance.vm[0] must be replaced -/+ resource "ibm_is_instance" "vm" { ~ gpu = [] -> (known after apply) ~ id = "631383-c167-4b68-bb77-12987651" -> (known after apply)

  ~ vpc                     = "r006-23232-221321321- 6f13243947" -> (known after apply) # forces replacement
  ~ zone                    = "us-south-1" -> (known after apply) # forces replacement

  ~ primary_network_interface {
        allow_ip_spoofing    = false
      ~ security_groups      = [
          - "r006-2f0a31e6-afde-4b0e-85c6-0a8f0e66fd0c",
        ] -> (known after apply)
      ~ subnet               = "0717-e914a44d-273f-457c-ab9f-121344" -> (known after apply) # forces replacement
    }
}

module.test-vm.ibm_is_volume.volume[0] must be replaced -/+ resource "ibm_is_volume" "volume" { capacity = 50 ~ zone = "us-south-1" -> (known after apply) # forces replacement } `

Expected Behavior

no changes in plan , then recreation should not happen.

Steps to Reproduce

1 . terraform plan -out

  1. terraform apply
  2. terraform plan -out - it will shows 2 resource to add and 2 to destroy
hkantare commented 3 years ago

Can you send us complete log we tried something similar template but we are not able to reproduce it

data "ibm_is_zones" "ds_zones" {
  region="us-south"
}

data "ibm_is_vpc" "ds_vpc" {
  name = "test"
}

2021/02/23 15:18:22 [DEBUG] ReferenceTransformer: "data.ibm_is_zones.ds_zones (expand)" references: [] 2021/02/23 15:18:22 [DEBUG] Starting graph walk: walkPlan 2021-02-23T15:18:22.190+0530 [INFO] plugin: configuring client automatic mTLS 2021-02-23T15:18:22.211+0530 [DEBUG] plugin: starting plugin: path=.terraform/plugins/registry.terraform.io/ibm-cloud/ibm/1.16.1/darwin_amd64/terraform-provider-ibm_v1.16.1 args=[.terraform/plugins/registry.terraform.io/ibm-cloud/ibm/1.16.1/darwin_amd64/terraform-provider-ibm_v1.16.1] 2021-02-23T15:18:22.219+0530 [DEBUG] plugin: plugin started: path=.terraform/plugins/registry.terraform.io/ibm-cloud/ibm/1.16.1/darwin_amd64/terraform-provider-ibm_v1.16.1 pid=55043 2021-02-23T15:18:22.219+0530 [DEBUG] plugin: waiting for RPC address: path=.terraform/plugins/registry.terraform.io/ibm-cloud/ibm/1.16.1/darwin_amd64/terraform-provider-ibm_v1.16.1 2021-02-23T15:18:22.278+0530 [DEBUG] plugin.terraform-provider-ibm_v1.16.1: 2021/02/23 15:18:22 IBM Cloud Provider version 1.16.1
2021-02-23T15:18:22.283+0530 [INFO] plugin.terraform-provider-ibm_v1.16.1: configuring server automatic mTLS: timestamp=2021-02-23T15:18:22.282+0530 2021-02-23T15:18:22.308+0530 [DEBUG] plugin.terraform-provider-ibm_v1.16.1: plugin address: address=/var/folders/mk/76ksfld97q72r64b7q4v28_r0000gn/T/plugin949964790 network=unix timestamp=2021-02-23T15:18:22.307+0530 2021-02-23T15:18:22.308+0530 [DEBUG] plugin: using plugin: version=5 2021-02-23T15:18:22.394+0530 [DEBUG] plugin.terraform-provider-ibm_v1.16.1: 2021/02/23 15:18:22 Configuring IBM Cloud Session with API key 2021-02-23T15:18:22.394+0530 [DEBUG] plugin.terraform-provider-ibm_v1.16.1: 2021/02/23 15:18:22 [INFO] Configured Region: us-south 2021-02-23T15:18:27.920+0530 [DEBUG] plugin.terraform-provider-ibm_v1.16.1: 2021/02/23 15:18:27 the apiendpoint url for power is us-south.power-iaas.cloud.ibm.com 2021/02/23 15:18:27 [DEBUG] ReferenceTransformer: "data.ibm_is_vpc.ds_vpc" references: [] 2021/02/23 15:18:27 [DEBUG] ReferenceTransformer: "data.ibm_is_zones.ds_zones" references: [] 2021/02/23 15:18:27 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/23 15:18:27 [DEBUG] ReferenceTransformer: "data.ibm_is_subnet.backend_subnet[0]" references: [] 2021/02/23 15:18:27 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/23 15:18:27 [DEBUG] ReferenceTransformer: "data.ibm_is_subnet.backend_subnet[1]" references: [] 2021/02/23 15:18:27 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/23 15:18:27 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/23 15:18:27 [DEBUG] ReferenceTransformer: "ibm_is_volume.volume[0]" references: [] 2021/02/23 15:18:27 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/23 15:18:27 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/23 15:18:27 [DEBUG] ReferenceTransformer: "ibm_is_volume.volume[1]" references: [] 2021/02/23 15:18:27 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/23 15:18:27 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/23 15:18:27 [WARN] ReferenceTransformer: reference not found: "ibm_is_volume.volume" 2021/02/23 15:18:27 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/23 15:18:27 [WARN] ReferenceTransformer: reference not found: "data.ibm_is_subnet.backend_subnet" 2021/02/23 15:18:27 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/23 15:18:27 [DEBUG] ReferenceTransformer: "ibm_is_instance.vm[0]" references: [] 2021/02/23 15:18:27 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/23 15:18:27 [WARN] ReferenceTransformer: reference not found: "ibm_is_volume.volume" 2021/02/23 15:18:27 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/23 15:18:27 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/23 15:18:27 [WARN] ReferenceTransformer: reference not found: "data.ibm_is_subnet.backend_subnet" 2021/02/23 15:18:27 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/23 15:18:27 [DEBUG] ReferenceTransformer: "ibm_is_instance.vm[1]" references: [] 2021/02/23 15:18:27 [WARN] Provider "registry.terraform.io/ibm-cloud/ibm" produced an invalid plan for ibm_is_instance.vm[0], but we are tolerating it because it is using the legacy plugin SDK. The following problems may be the cause of any confusing errors from downstream operations:

No changes. Infrastructure is up-to-date.

data "ibm_is_subnet" "backend_subnet" {
  name = "test${count.index}"
  count          = 2
}

resource "ibm_is_instance" "vm" {
  name           = "test-${count.index + 1}"
  vpc            = data.ibm_is_vpc.ds_vpc.id
  zone           = element(data.ibm_is_zones.ds_zones.zones, count.index)
  keys           = ["YYYYYYYY"]
  image          = "XXXXXXXXX"
  profile        = "bx2-2x8"
  count          = 2

  primary_network_interface {
    subnet          = data.ibm_is_subnet.backend_subnet[count.index].id
    security_groups = [data.ibm_is_vpc.ds_vpc.default_security_group]
  }
  volumes = [
    ibm_is_volume.volume[count.index].id,
  ]
}

resource "ibm_is_volume" "volume" {
  count          = 2
  name           = "storage-${count.index + 1}"
  profile        = "custom"
  zone           = element(data.ibm_is_zones.ds_zones.zones, count.index)
  iops           = 100
  capacity       = 100
}
kapild-devops commented 3 years ago

PFA Complete logs:

2021/02/24 22:45:32 [INFO] backend/local: starting Plan operation 2021-02-24T22:45:32.143+0530 [INFO] plugin: configuring client automatic mTLS 2021-02-24T22:45:32.178+0530 [INFO] plugin.terraform-provider-random_v3.1.0_x5: configuring server automatic mTLS: timestamp=2021-02-24T22:45:32.177+0530 2021-02-24T22:45:32.268+0530 [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing" 2021-02-24T22:45:32.269+0530 [INFO] plugin: configuring client automatic mTLS 2021-02-24T22:45:32.302+0530 [INFO] plugin.terraform-provider-template_v2.2.0_x4: configuring server automatic mTLS: timestamp=2021-02-24T22:45:32.302+0530 2021-02-24T22:45:32.385+0530 [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unimplemented desc = unknown service plugin.GRPCStdio" 2021-02-24T22:45:32.386+0530 [INFO] plugin: configuring client automatic mTLS 2021-02-24T22:45:32.457+0530 [INFO] plugin.terraform-provider-ibm_v1.16.1: configuring server automatic mTLS: timestamp=2021-02-24T22:45:32.457+0530 2021-02-24T22:45:32.564+0530 [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing" 2021/02/24 22:45:32 [INFO] terraform: building graph: GraphTypeValidate 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "path.module" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:32 [WARN] ReferenceTransformer: reference not found: "count.index" 2021-02-24T22:45:32.582+0530 [INFO] plugin: configuring client automatic mTLS 2021-02-24T22:45:32.617+0530 [INFO] plugin.terraform-provider-random_v3.1.0_x5: configuring server automatic mTLS: timestamp=2021-02-24T22:45:32.616+0530 2021-02-24T22:45:32.700+0530 [INFO] plugin: configuring client automatic mTLS 2021-02-24T22:45:32.732+0530 [INFO] plugin.terraform-provider-template_v2.2.0_x4: configuring server automatic mTLS: timestamp=2021-02-24T22:45:32.732+0530 2021-02-24T22:45:32.814+0530 [INFO] plugin: configuring client automatic mTLS 2021-02-24T22:45:32.814+0530 [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unimplemented desc = unknown service plugin.GRPCStdio" 2021-02-24T22:45:32.890+0530 [INFO] plugin.terraform-provider-ibm_v1.16.1: configuring server automatic mTLS: timestamp=2021-02-24T22:45:32.890+0530 2021-02-24T22:45:33.027+0530 [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing" 2021-02-24T22:45:33.034+0530 [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing" 2021/02/24 22:45:33 [INFO] backend/local: plan calling Refresh 2021/02/24 22:45:33 [INFO] terraform: building graph: GraphTypeRefresh Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be persisted to local or remote state storage.

2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:45:33 [WARN] ReferenceTransformer: reference not found: "path.module" 2021-02-24T22:45:33.058+0530 [INFO] plugin: configuring client automatic mTLS 2021-02-24T22:45:33.091+0530 [INFO] plugin.terraform-provider-template_v2.2.0_x4: configuring server automatic mTLS: timestamp=2021-02-24T22:45:33.090+0530 2021-02-24T22:45:33.170+0530 [INFO] plugin: configuring client automatic mTLS 2021-02-24T22:45:33.171+0530 [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unimplemented desc = unknown service plugin.GRPCStdio" 2021-02-24T22:45:33.204+0530 [INFO] plugin.terraform-provider-random_v3.1.0_x5: configuring server automatic mTLS: timestamp=2021-02-24T22:45:33.203+0530 2021-02-24T22:45:33.288+0530 [INFO] plugin: configuring client automatic mTLS 2021-02-24T22:45:33.357+0530 [INFO] plugin.terraform-provider-ibm_v1.16.1: configuring server automatic mTLS: timestamp=2021-02-24T22:45:33.356+0530 2021/02/24 22:45:39 [WARN] ReferenceTransformer: reference not found: "var.ibm_region" module.bx-vpc.data.ibm_is_zones.ds_zones: Refreshing state... [id=2021-02-24 17:04:08.061457 +0000 UTC] module.bx-vpc.ibm_resource_group.rg: Refreshing state... [id=6738b23ab80c48bb9dec551aa2b6a550] module.bx-vpc.ibm_is_vpc.vpc: Refreshing state... [id=r006-ec7d34c8-b11e-4ec0-8037-78a49a70fb97] module.bx-vpc.ibm_is_public_gateway.pub_gw[2]: Refreshing state... [id=r006-938e07a4-8f42-436a-b205-48e7df022149] module.bx-vpc.ibm_is_public_gateway.pub_gw[0]: Refreshing state... [id=r006-6ad263f3-4f44-4fb2-bd22-a53f8e255c77] module.bx-vpc.ibm_is_security_group_rule.sg_rule_80_out: Refreshing state... [id=r006-28f9c9fc-f60f-4989-8ad4-7b2ae73e2d75.r006-99be2318-e0d4-4dc6-80f6-74dda4d2b3b6] module.bx-vpc.ibm_is_vpc_address_prefix.address_prefix[2]: Refreshing state... [id=r006-ec7d34c8-b11e-4ec0-8037-78a49a70fb97/r006-597aeca1-5a41-4cec-9293-8775ab0b5351] module.bx-vpc.ibm_is_security_group_rule.sg_rule_ssh: Refreshing state... [id=r006-28f9c9fc-f60f-4989-8ad4-7b2ae73e2d75.r006-0246fdfc-83a7-4b15-8de2-eb24a78bfdc4] module.bx-vpc.ibm_is_vpc_address_prefix.address_prefix[0]: Refreshing state... [id=r006-ec7d34c8-b11e-4ec0-8037-78a49a70fb97/r006-334443dd-e12d-4534-925d-cceb0c2d2b0d] module.bx-vpc.ibm_is_vpc_address_prefix.address_prefix[1]: Refreshing state... [id=r006-ec7d34c8-b11e-4ec0-8037-78a49a70fb97/r006-e3bb1e1e-50cd-43c3-96b9-7250d66a9ddb] module.bx-vpc.ibm_is_public_gateway.pub_gw[1]: Refreshing state... [id=r006-138f31ca-cba7-4794-bf35-ed0e86cdfd89] module.bx-vpc.ibm_is_subnet.test_subnet[0]: Refreshing state... [id=0717-4a0342b3-2eb5-43c8-a5c2-b0bd619b1c73] module.bx-vpc.ibm_is_subnet.test_subnet[2]: Refreshing state... [id=0737-bb30414f-fe7a-4589-9f5f-a1e51cb3935a] module.bx-vpc.ibm_is_subnet.test_subnet[1]: Refreshing state... [id=0727-95ba021a-d0d6-4426-bd70-da4b0a274abc] module.bx-vpc.ibm_is_network_acl.vpnacl_frontend: Refreshing state... [id=r006-8a7d17d9-8fd6-4cdc-8676-cd5090b04b1a] module.bx-vpc.ibm_is_subnet_network_acl_attachment.attach_frontend[1]: Refreshing state... [id=0727-95ba021a-d0d6-4426-bd70-da4b0a274abc] module.bx-vpc.ibm_is_subnet_network_acl_attachment.attach_frontend[0]: Refreshing state... [id=0717-4a0342b3-2eb5-43c8-a5c2-b0bd619b1c73] module.bx-vpc.ibm_is_subnet_network_acl_attachment.attach_frontend[2]: Refreshing state... [id=0737-bb30414f-fe7a-4589-9f5f-a1e51cb3935a] 2021/02/24 22:45:53 [WARN] ReferenceTransformer: reference not found: "var.ibm_region" module.vm-on-vpc.random_string.randomId[0]: Refreshing state... [id=7b6epm5q8geri95mawgj] module.vm-on-vpc.data.ibm_is_zones.ds_zones: Refreshing state... [id=2021-02-24 17:06:13.5667618 +0000 UTC] module.vm-on-vpc.data.ibm_resource_group.rg: Refreshing state... [id=6738b23ab80c48bb9dec551aa2b6a550] 2021/02/24 22:45:53 [WARN] ReferenceTransformer: reference not found: "path.module" 2021/02/24 22:45:53 [WARN] ReferenceTransformer: reference not found: "var.vpc_name" module.vm-on-vpc.data.template_file.user_data_with_blockstorage[0]: Refreshing state... [id=c72b642b8c271fdab9dc5c13aa7dfdd2db44a38c023b304293a39c51c1bb8620] module.vm-on-vpc.data.ibm_is_image.ubuntu: Refreshing state... [id=r006-ed3f775f-ad7e-4e37-ae62-7199b4988b00] 2021-02-24T22:45:53.713+0530 [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing" module.vm-on-vpc.data.ibm_is_vpc.ds_vpc: Refreshing state... [id=r006-ec7d34c8-b11e-4ec0-8037-78a49a70fb97] module.vm-on-vpc.data.ibm_is_ssh_key.existing_ssh_key: Refreshing state... [id=r006-64a91f52-7d9e-49f1-8b5e-cbe822b59aa0] 2021/02/24 22:45:54 [WARN] ReferenceTransformer: reference not found: "local.no_of_zones" 2021/02/24 22:45:54 [WARN] ReferenceTransformer: reference not found: "count.index" module.vm-on-vpc.data.ibm_is_subnet.test_subnet[0]: Refreshing state... [id=0717-4a0342b3-2eb5-43c8-a5c2-b0bd619b1c73] module.vm-on-vpc.ibm_is_volume.volume[0]: Refreshing state... [id=r006-a456e4e9-cf83-4e0e-bfdd-1780c4fafc52] module.vm-on-vpc.ibm_is_instance.vm[0]: Refreshing state... [id=0717_bf3f5950-c862-479c-aba5-f6b9b36a6b9c] 2021-02-24T22:46:00.097+0530 [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing" 2021/02/24 22:46:00 [INFO] backend/local: plan calling Plan 2021/02/24 22:46:00 [INFO] terraform: building graph: GraphTypePlan


2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "path.module" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021/02/24 22:46:00 [WARN] ReferenceTransformer: reference not found: "count.index" 2021-02-24T22:46:00.123+0530 [INFO] plugin: configuring client automatic mTLS 2021-02-24T22:46:00.156+0530 [INFO] plugin.terraform-provider-template_v2.2.0_x4: configuring server automatic mTLS: timestamp=2021-02-24T22:46:00.156+0530 2021-02-24T22:46:00.240+0530 [INFO] plugin: configuring client automatic mTLS 2021-02-24T22:46:00.241+0530 [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unimplemented desc = unknown service plugin.GRPCStdio" 2021-02-24T22:46:00.308+0530 [INFO] plugin.terraform-provider-ibm_v1.16.1: configuring server automatic mTLS: timestamp=2021-02-24T22:46:00.308+0530 2021-02-24T22:46:00.383+0530 [INFO] plugin: configuring client automatic mTLS 2021-02-24T22:46:00.415+0530 [INFO] plugin.terraform-provider-random_v3.1.0_x5: configuring server automatic mTLS: timestamp=2021-02-24T22:46:00.415+0530 2021/02/24 22:46:03 [WARN] ReferenceTransformer: reference not found: "var.ibm_region" 2021/02/24 22:46:03 [WARN] ReferenceTransformer: reference not found: "local.ibm_tags" 2021/02/24 22:46:03 [WARN] ReferenceTransformer: reference not found: "local.regionname" 2021/02/24 22:46:03 [WARN] ReferenceTransformer: reference not found: "var.ibm_env" 2021/02/24 22:46:03 [WARN] Provider "registry.terraform.io/ibm-cloud/ibm" produced an invalid plan for module.bx-vpc.ibm_is_vpc.vpc, but we are tolerating it because it is using the legacy plugin SDK. The following problems may be the cause of any confusing errors from downstream operations:

-/+ resource "ibm_is_volume" "volume" { capacity = 50 ~ crn = "crn:v1:bluemix:public:is:us-south-1:a/931c0567c7d349a987f8b1bd5deb7178::volume:r006-a456e4e9-cf83-4e0e-bfdd-1780c4fafc52" -> (known after apply)

Plan: 2 to add, 2 to change, 2 to destroy.

hkantare commented 3 years ago

From the snippet we can see its doing a force new on VPCid, subnetid, zones....How does the ids of those resource getting changed..If possible can you share the url or configuration of modules...

kapild-devops commented 3 years ago

@hkantare there isn't any change in VPCid, subnetid, zones , but still plan find the change.

the provisioned vpc , subnet and zones are same. test@root:~$ terraform state show module.vm-on-vpc.ibm_is_instance.vm[0]

module.vm-on-vpc.ibm_is_instance.vm[0]:

resource "ibm_is_instance" "vm" { volumes = [ "r006-0af2aa2c-7c26-48c0-aba6-6491a9bc63b0", ] vpc = "r006-185276f5-da47-4629-9bb0-b3dfd0249d70" /// terraform show showing same id zone = "us-south-1" // terraform show showing same zone

primary_network_interface {
    allow_ip_spoofing    = false
    id                   = "0717-47868167-388b-4e0b-9311-47b3713002c5"
    name                 = "goatskin-survival-overstuff-cocoa"
    port_speed           = 0
    primary_ipv4_address = "10.20.0.20"
    security_groups      = [
        "r006-e23bfc85-4827-4ae2-85fd-c2c22b07f4fc",
    ]
    subnet               = "0717-e6ef115f-6471-4cfe-a3be-9ccc0c5b8ac5"    /// terraform show showing subnet id 
}

the provisioned VPC ,Subnet id and zone name are the same which provision on first try , but somehow on second try it find it different and try to destroy and recreate it.

i am sharing you the modules links soon.

ujjwal-ibm commented 1 year ago

This issue is not reproducible.

sumitkumartiwari commented 1 year ago

Closing the issue as there is no response from user.