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

not refreshing state for opentelekomcloud_vbs_backup_policy_v2 #561

Closed
otc-fabo opened this issue Aug 6, 2020 · 1 comment
Closed

not refreshing state for opentelekomcloud_vbs_backup_policy_v2 #561

otc-fabo opened this issue Aug 6, 2020 · 1 comment
Milestone

Comments

@otc-fabo
Copy link

otc-fabo commented Aug 6, 2020

When creating a EVS disk using opentelekomcloud_blockstorage_volume_v2 with metadata (for KMS encryption) and attaching this disk to an VBS Backup policy using opentelekomcloud_vbs_backup_policy_v2 after the second terraform apply, the disk is removed from the VBS policy. This is due to the fact, the OTC sets a metadata parameter "policy" with the ID of the VBS-Policy, the disk is attached to. Terraform does not have this parameter in his resource, and therefore removes it with the second apply.
opentelekomcloud_vbs_backup_policy_v2 is not recognizing this because it seems it does not refresh its state.
The problem does not occur when using: opentelekomcloud_evs_volume_v3 because it does not use metadata

Terraform Version

terraform version
Terraform v0.12.28

  • provider.openstack v1.29.0
  • provider.opentelekomcloud v1.18.1

Affected Resource(s)

opentelekomcloud_vbs_backup_policy_v2
opentelekomcloud_blockstorage_volume_v2

Terraform Configuration Files

resource "opentelekomcloud_blockstorage_volume_v2" "volume" {
  count             = var.disk_size_gb > 0 ? var.computecount : 0
  availability_zone = data.openstack_compute_availability_zones_v2.available.names[count.index]
  name              = "${var.name}0${count.index + 1}-datadisk"
  size              = var.disk_size_gb
  tags              = merge(
    local.common_tags,
    {
      environment = var.environment
      generator   = "terraform"
      role        = var.role
    },
  )
  metadata = {
    __system__encrypted = "1"
    __system__cmkid     = var.kms_id
    attached_mode       = "rw"
    readonly            = "False"
  }
}

Debug Output

as visible on the screenshot, on the second apply, the 'metadata: policy' is removed. Therefore the Disk is not attached to the vbs policy anymore
image

Expected Behavior

disk should be still attached to the vbs policy

Actual Behavior

disk is removed from vbs policy

Steps to Reproduce

  1. create a evs disk with metadata
  2. attach disk to a vbs policy
  3. rerun terraform apply
@outcatcher outcatcher self-assigned this Aug 18, 2020
@outcatcher outcatcher added this to the v1.20.0 milestone Aug 31, 2020
@outcatcher outcatcher removed their assignment Sep 2, 2020
@outcatcher
Copy link
Contributor

Done in release v1.19.5
@otc-fabo Please comment if it still reproduces in latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants