-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Changing count of instances destroys all of them #3885
Comments
Using
|
Ouch. This wouldn't be good and definitely not what should happen. What does your TF configuration look like? I created a basic instance with a |
I am using user_data with tempalte_file renderer. Is that related to this issue? https://groups.google.com/forum/#!topic/terraform-tool/kvaaUlT6cg4 |
Ah, that's quite possible. I've only had a chance to skim those two -- I'll look deeper later today. |
Do you mind providing the config you're using to cause this? Any change to |
It behaves exactly the same way as described in this comment #2627 (comment) |
It is indeed a bug with terraform. I am trying to figure what it is exactly, but basically the problem is that after increasing count hash of a string is calculated not from the result of rendered template but of a string like |
Most likely related to #3864 |
After debugging and trying to find the source of the issue for 5 hours I can confirm that destruction of all instances happens exactly same reasons as here #3662 and here #2627 (comment). Seems like there is a fatal bug in the implementation of It happens not only for I tried to fix it myself, but so far I just spent lots of time learning internals of terraform. Even though I feel like I know it much (much much) better now, it's still not enough to track down the source of the bug. I would highly appreciate any tips on how to fix it or at least to which part of the source code I should stare at and debug longer, because this bug basically destroys not only instances, but the whole range of use cases for Terraform (most important one being the generation of user data with template_file). My current suspects are |
@Fodoj Thanks so much for digging into this. It sounds like this is a bug with core, so I'm going to label it as such. |
@jtopjian so any tips on where to search for bug? I have some hours this weekend to work on this. |
Fastests way to reproduce the bug:
Increasing count by 1 leads to |
@Fodoj Off of the top of my head, I have no idea how to approach this one. If I have some time, I'll venture outside of the OpenStack provider in Terraform. At the moment, it's uncharted territory for me 😄 |
Seems to be the same issue #3449 |
Rolling #2788 back solves the issue, no more total destruction of previous resources. @mitchellh any idea for a better fix that won't lead to this bug? |
@jgross206 it is not a sustainable solution because rolling #2788 back re-introduces the other bug, that was fixed by this PR. For now I don't have time to go even deeper into TF internals to fix both of these bugs and still using own compiled version. I wish @mitchellh or someone else from core contributors would pay more attention to this bug, because, as I mentioned already, it leads to a lot of different bugs across many important use cases of terraform. |
Any update on this bug? |
+1. This severely limits us from using terraform to manage and mutate an existing stack in production. |
I think I've narrowed this down some more. It's not Also, we should remove the |
@phinze Thoughts? |
If it matters, i could reproduce it as well |
The same issue triggers recreation of Aggressive
Results in:
|
I am also encountering this issue, more specifically with |
Hey folks - sorry for the trouble here and many apologies for the delay on response. This is definitely an important core bug that I'd like to get fixed soon. There is a great summarizing write up in #4528 that walks through the shape of the problem and shows why a simple revert of #2788 won't work as a solution. This is indeed an expression of #3449, so I'm going to close this thread to consolidate the discussion over there. I'll follow up with a plan of action on that thread. |
I'm still seeing this problem with v0.11.1. |
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. |
Title says it all: I increased the count and all of previously created instances were destroyed. Doesn't seem like an expected behavior to me.
The text was updated successfully, but these errors were encountered: