IBM-Cloud / terraform-provider-ibm

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

[GCAT][Gen=2, VPC]: Error while destorying Block storage volume #771

Closed vidhi11 closed 4 years ago

vidhi11 commented 5 years ago

Hello Team,

Terraform Version

v0.11.8

IBM Terraform Version

V0.17.5

Affected Resource(s)

Please list the resources as a list, for example:

Issue: Errors out while destroying volume:

* ibm_is_volume.multizone_data_volume.1: {"errors":[{"code":"volume_id_not_found","message":"A volume with the specified ID is not found.","more_info":"http://www.bluemix.com/help#volume_id_not_found","target":{"name":"","type":""}}],"trace":"e2d84b8d7c4a78d3b0b45a0a924ab6b5"}

Code:

##############################################################################
# Create block storage (data) volumes that will be attached to VSIs
##############################################################################

resource "ibm_is_volume" "multizone_data_volume" {
  count          = "${var.vsi_count}"
  name           = "multizone-datavol-${var.unique_id}-${count.index + 1}"
  profile        = "10iops-tier"
  zone           = "${var.ibm_region}-${(count.index % 3) + 1}"
  capacity       = 50
  resource_group = "${var.resource_group_id}"
}

##############################################################################
# Deploy VSIs, attach volumes, install monitor and loggin agents, assign ssh key
##############################################################################

resource "ibm_is_instance" "multizone_is" {
  count   = "${var.vsi_count}"
  name    = "multizone-vsi-${var.unique_id}-${count.index + 1}"
  image   = "${var.image_template_id}"
  profile = "${var.machine_type}"

  primary_network_interface = {
    name            =  "multizone-interface-${count.index + 1}"
    subnet          = "${element(ibm_is_subnet.multizone_subnet.*.id, count.index % 3)}"
    security_groups = ["${ibm_is_security_group.multizone_security_group.id}"]
  }

  volumes    = ["${element(ibm_is_volume.multizone_data_volume.*.id, count.index)}"]
  vpc        = "${ibm_is_vpc.multizone_vpc.id}"
  zone       = "${var.ibm_region}-${(count.index % 3) + 1}"
  keys       = ["${ibm_is_ssh_key.multizone_ssh_key.id}"]
  user_data  = "${replace(replace(replace(file("vpc_infrastructure/config/config_logDNA.sh"), "$1", "${var.log_ingestion_key}"), "$2", "${var.sysdig_access_key}"), "$REGION", "${var.ibm_region}")}"

}

Expected Behavior

Actual Behavior

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
  2. terraform destroy
VaishnaviGopal commented 5 years ago

The issue is fixed and the updates will be available in the next IBM Cloud Provider release

hkantare commented 5 years ago

https://github.com/IBM-Cloud/terraform-provider-ibm/releases/tag/v0.18.0Fixed in v0.18.0