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_volume continually plans to set catalog_offering but does not #5512

Closed
davesteinberg opened this issue Jul 16, 2024 · 2 comments
Closed
Labels
service/Resource Management Issues related to Resource Manager or Resource controller Issues service/VPC Infrastructure Issues related to the VPC Infrastructure

Comments

@davesteinberg
Copy link
Contributor

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.

@github-actions github-actions bot added service/Resource Management Issues related to Resource Manager or Resource controller Issues service/VPC Infrastructure Issues related to the VPC Infrastructure labels Jul 16, 2024
@deepaksibm
Copy link
Contributor

@sreekarbvibm

@deepaksibm
Copy link
Contributor

@sumitkumartiwari This can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/Resource Management Issues related to Resource Manager or Resource controller Issues service/VPC Infrastructure Issues related to the VPC Infrastructure
Projects
None yet
Development

No branches or pull requests

3 participants