terraform-provider-ibm icon indicating copy to clipboard operation
terraform-provider-ibm copied to clipboard

ibm_is_volume continually plans to set catalog_offering but does not

Open davesteinberg opened this issue 1 year ago • 2 comments

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 -v
Terraform v1.5.7
on darwin_amd64
+ provider registry.terraform.io/ibm-cloud/ibm v1.67.1

Affected Resource(s)

  • ibm_is_volume

Terraform Configuration Files

The following simple Terraform creates a VPC block storage volume.

terraform {
  required_version = "~>1.5"

  required_providers {
    ibm = {
      source  = "IBM-Cloud/ibm"
      version = "~>1.67.1"
    }
  }
}

provider "ibm" {
  ibmcloud_api_key = var.ibmcloud_api_key
  region           = var.region
}

variable "ibmcloud_api_key" {
  description = "API key for use by this Terraform module."
  type        = string
  sensitive   = true
}

variable "region" {
  description = "Region where resources will be provisioned."
  type        = string
  default     = "ca-tor"
}

variable "prefix" {
  description = "Name prefix for common resources."
  type        = string
  default     = "bug"
}

# Resource group
resource "ibm_resource_group" "rg" {
  name = var.prefix
}

resource "ibm_is_volume" "volume" {
  name           = "${var.prefix}-volume"
  resource_group = ibm_resource_group.rg.id
  zone           = "${var.region}-1"
  capacity       = 100
  profile        = "general-purpose"
}

The problem is that the plan for this Terraform shows that it will set catalog_offering to a value known after apply, but after applying, it is null in the terraform.tfstate. Next time you plan, it wants to set catalog_offering again. You can apply indefinitely, but the planned state is never in sync with the actual state.

Steps to Reproduce

  1. Create a terraform.tfvars with an ibmcloud_api_key for your account.
  2. Run terraform init.
  3. Run terraform apply.
  4. Run terraform plan.

Expected Behavior

The apply correctly creates the resources. The subsequent plan shows no actions.

Actual Behavior

The subsequent plan shows an action:

Terraform will perform the following actions:

  # ibm_is_volume.volume will be updated in-place
  ~ resource "ibm_is_volume" "volume" {
      + catalog_offering        = (known after apply)
        id                      = "r038-f3bbc298-bbed-4e9c-8ca3-583edf28838b"
        name                    = "bug-volume"
        tags                    = []
        # (19 unchanged attributes hidden)
    }

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

Important Factoids

This problem appeared for me when trying to upgrade from version 1.63.0 of the provider to 1.67.1.

Also, while creating this bug report, I found it extremely slow to refresh state for the volume several times. However, at some point, the performance become more normal.

davesteinberg avatar Jul 16 '24 21:07 davesteinberg

@sreekarbvibm

deepaksibm avatar Jul 17 '24 02:07 deepaksibm

@sumitkumartiwari This can be closed

deepaksibm avatar Jul 19 '24 11:07 deepaksibm