Skip to content

[BUG] ovh_cloud_project_volume does not imports the type, and forces a replacement #1175

@Videl

Description

@Videl

Describe the bug

I wanted to migrate from the OpenStack resource openstack_blockstorage_volume_v3 (because I couldn't create a block of type high-speed-gen2-luks) to a resource ovh_cloud_project_volume that can creates the block with the encrypted type.

The migration seems to correctly initialize the Terraform resource but the block type seems to be missing because Terraform wants to replace it the next run.

  # module.dev4.ovh_cloud_project_volume.disk must be replaced
-/+ resource "ovh_cloud_project_volume" "disk" {
      + action         = (known after apply)
      + completed_at   = (known after apply)
      + created_at     = (known after apply)
      + description    = "Dev4-x44Go"
      ~ id             = "3e925c7a-47d4-42b2-83f5-7a18d210883e" -> (known after apply)
      + image_id       = (known after apply)
      + instance_id    = (known after apply)
        name           = "Dev4-x44Go"
      + progress       = (known after apply)
      + regions        = (known after apply)
      + resource_id    = (known after apply)
      + snapshot_id    = (known after apply)
      + started_at     = (known after apply)
      ~ status         = "in-use" -> (known after apply)
      + sub_operations = (known after apply)
      + type           = "high-speed-gen2-luks" # forces replacement
      ~ volume_id      = "3e925c7a-47d4-42b2-83f5-7a18d210883e" -> (known after apply)
        # (3 unchanged attributes hidden)
    }

Terraform Version

Terraform v1.14.0
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v6.0.0
+ provider registry.terraform.io/ovh/ovh v2.10.0
+ provider registry.terraform.io/terraform-provider-openstack/openstack v3.4.0

Affected Resource(s)

ovh_cloud_project_volume

Terraform Configuration Files

resource "ovh_cloud_project_volume" "disk" {
  region_name  = var.server_region
  service_name = var.ovh_project_id
  description  = var.disk_name
  name         = var.disk_name
  size         = var.disk_size
  type         = var.disk_type
}

variable "disk_size" {
  type    = number
  default = 100
}

variable "disk_name" {
  type = string
}

variable "disk_type" {
  type    = string
  default = "high-speed-gen2-luks"
}

variable "server_region" {
  description = "Localisation of the server."
  type        = string
  default     = "SBG5"
}

Panic Output

No panic

Expected Behavior

I wanted it to import completely, especially the type.

Actual Behavior

The type is missing and forces replacement.

Steps to Reproduce

  1.  tf import module.dev4.ovh_cloud_project_volume.disk xxx/SBG5/3e925c7a-47d4-42b2-83f5-7a18d210883e
    
  2. terraform apply

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions