-
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
openstack_compute_instance_v2.master: diffs didn't match during apply. This is a bug with Terraform and should be reported. #4090
Comments
Hi there, I'm able to reproduce this. I'll look into it as soon as I can. Thanks for reporting this. 😄 |
@phinze I've figure out the fix for this, but I don't understand why 😄 This issue only happens when the
I'm able to fix this by creating a "proper" set function like this: func resourceComputeBlockDeviceHash(v interface{}) int {
var buf bytes.Buffer
m := v.(map[string]interface{})
buf.WriteString(fmt.Sprintf("%s", m["uuid"].(string)))
return hashcode.String(buf.String())
} Rather than the one I stole from Set: func(v interface{}) int {
// there can only be one bootable block device; no need to hash anything
return 0
}, Why doesn't the above work in this situation? I read it as saying "no matter what values, just return 0 as a hashcode", so regardless of any changing values, it'd all be grouped under the same hashed set. I need to make this change to |
Just had a thought: I think
I quickly rewrite Thoughts? |
FYI, I'm pretty sure this was working fine not too long ago. Most likely some changes made in the recent versions caused this behaviour. |
Do you build off of master frequently? The reason I ask is because until #3232 was merged, I'm pretty sure "boot from volume" was completely broke. If you do build off of master, then a patch between #3232 and recently could have affected this. I'm definitely curious as to the cause (if recently) and why the fix I found fixes the problem. But regardless of those answers, I'm pretty sure I need to change |
@jtopjian Hm this is almost definitely some sort of Note when considering a conversion from Will follow up when I learn more about this computed set attribute mischief! 👍 |
@phinze Cool - thank you! I totally agree about the wonkiness. I'll be looking into the API to ensure that the order is always consistent -- I think that's the only sane explanation for identical elements. 😄 |
Just hit the same bug. The only difference is that the cinder volume is created from the image_id, not the source_vol_id.
|
@jfchevrette @shockinghobby I've just committed a fix that should resolve this issue. If you're able to compile and test from source, please let me know if you're still encountering issues. |
Looks like it is fixed. No issues so far. Awesome. Thank you. |
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. |
Reporting as indicated by the error.
I am trying to provision a new instance from a volume instantiated from a source volume id.
First run of
terraform apply
results in the error mentioned in the issue title. If I run it a second time, the instance is created successfully.terraform apply
output: https://gist.github.com/jfchevrette/1e2ee15762efbd4df1a7diff reason from TF_LOG=debug: https://gist.github.com/jfchevrette/f81d39464cc43c98f87e
The text was updated successfully, but these errors were encountered: