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

Openstack volume does not detect detach #8040

Closed
GiovanniPaoloGibilisco opened this issue Aug 8, 2016 · 2 comments · Fixed by #8172
Closed

Openstack volume does not detect detach #8040

GiovanniPaoloGibilisco opened this issue Aug 8, 2016 · 2 comments · Fixed by #8172
Labels

Comments

@GiovanniPaoloGibilisco
Copy link
Contributor

Descirption

After creating an image with a root volume and an additional volume attached if the terraform configuration file is changed to remove the attachment (the volume object in the openstack_compute_instance_v2 resource) the terraform plan command does not detect the change

Terraform Version

$ terraform -v
Terraform v0.7.0

Affected Resource(s)

The issue affects these resources:

  • openstack_blockstorage_volume_v1
  • openstack_compute_instance_v2

Terraform Configuration Files

This issue occurs after modifying the configuration file. The initial file is the following

resource "openstack_blockstorage_volume_v1" "root_volume_1" {
  name = "root_volume_1"
  size = 10
  image_id = "90ee49d8-1c18-45ca-8a72-14ffd120521e"
}

resource "openstack_blockstorage_volume_v1" "additional_volume_1" {
  name = "additional_volume_1"
  size = 5
}

resource "openstack_compute_instance_v2" "test_name" {
  name = "test_name"
  flavor_id = "3"
  key_pair = "test-keypair"
  security_groups = ["default"]

  block_device {
    uuid = "${openstack_blockstorage_volume_v1.root_volume_1.id}"
    source_type = "volume"
    boot_index = 0
    destination_type = "volume"
    delete_on_termination = false
  }

  volume {
    volume_id = "${openstack_blockstorage_volume_v1.additional_volume_1.id}"
  }

  metadata {
    application = "app1"
  }

  network {
    name = "network"
  }
}

After applying this configuration remove the volume object in the vm and you get the following file

resource "openstack_blockstorage_volume_v1" "root_volume_1" {
  name = "root_volume_1"
  size = 10
  image_id = "90ee49d8-1c18-45ca-8a72-14ffd120521e"
}

resource "openstack_blockstorage_volume_v1" "additional_volume_1" {
  name = "additional_volume_1"
  size = 5
}

resource "openstack_compute_instance_v2" "test_name" {
  name = "test_name"
  flavor_id = "3"
  key_pair = "test-keypair"
  security_groups = ["default"]

  block_device {
    uuid = "${openstack_blockstorage_volume_v1.root_volume_1.id}"
    source_type = "volume"
    boot_index = 0
    destination_type = "volume"
    delete_on_termination = false
  }

  metadata {
    application = "app1"
  }

  network {
    name = "network"
  }
}

Debug Output

The debug output is in this gist

Expected Behavior

The terraform plan command should detech the need to detach the openstack_blockstorage_volume_v1.additional_volume_1

Actual Behavior

The terraform plan command did not detect any changes

Steps to Reproduce

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

  1. create a config.tf file as reported above
  2. terraform apply
  3. modify the config.tf file removing the volume element from the vm (see above)
  4. terraform plan

References

No known issues

@GiovanniPaoloGibilisco
Copy link
Contributor Author

Added pull request #8101 for including acceptance test to reproduce the issue

@ghost
Copy link

ghost commented Apr 23, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants