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 move to another instance #8042

Closed
GiovanniPaoloGibilisco opened this issue Aug 8, 2016 · 1 comment · Fixed by #8172
Closed

Openstack volume does not move to another instance #8042

GiovanniPaoloGibilisco opened this issue Aug 8, 2016 · 1 comment · Fixed by #8172
Labels

Comments

@GiovanniPaoloGibilisco
Copy link
Contributor

Description

When trying to detatch a volume from one instance and attaching it to another instance the terraform plan command does not detect the detach and the terraform apply command fails trying to attach the volume without detatching it first.

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 configuration file is a bit long so here it goes the gist

After applying this configuration move the volume object from the test_name instance to the test_name2 instance.
Still the configuration file is a bit long so here gors the gist

Debug Output

The issue is related to two commands. The terraform plan which does not detect the detachment of the volume from the first instance and the terraform apply which fails in attaching the volume to the new isntance
The debug output of the terraform plan command is in this gist

The debug output of the terraform apply command is in this gist

Expected Behavior

The volume should be detached from the first instance and attached to the second one.

Actual Behavior

The terraform plan command detects only a new attachment on the second instance
The terraform apply command fails with

Error applying plan:

1 error(s) occurred:

* openstack_compute_instance_v2.test_name_2: Expected HTTP response code [200] when accessing [POST http://xxx.xxx.xxx.xxx:8774/v2/c660af04fabe41f29787fa27ad3400e9/servers/1b823818-d2b6-4e58-ad6f-d2476507205a/os-volume_attachments], but got 400 instead
{"badRequest": {"message": "Invalid volume: volume 'f8871928-3712-4c7a-bd0b-5bb1e5488358' status must be 'available'. Currently in 'in-use'", "code": 400}}

Steps to Reproduce

  1. create a config.tf file as in the first gist
  2. terraform apply
  3. modify the config.tf file moving the volume element from one vm top the other (see second gist)
  4. terraform plan
  5. terraform apply

References

@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