-
Notifications
You must be signed in to change notification settings - Fork 32
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
[BUG] Initialization always recrete the VM #30
Comments
Finally I did a workaround: For the User key, I saw in your documentation the usage of the function "trimspace", and this solve this issue. For the username, I forced the username to a fixed one. Other issues related to related to recreate: From my side, we can close the issue, but I will let you do it, maybe you want to check or improve these details ;) |
@itek09 I'll let it remain open so I can check up on the issues you experienced. We can probably refine it a bit more :) |
I have similar problem with The workaround in my case is to use lifecycle management and ignore changes in Side note, it would be useful to mark the reason for replacement in such case, it took me some time to discover that initialization is a culprit and not a mac-address or any other usual small changes. There were no meaningfull changes in state files after recreating such template.
Thank you for that! I've had the same issue with multiline |
@itek09 do you still experience this issue using the latest version? |
Describe the bug
If you create a vm resource with initialization block, every
terraform apply
will recreate the virtual machineTo Reproduce
Steps to reproduce the behavior:
terraform apply
terraform apply
Expected behavior
If something in the recreation block changes, we should create the VM.
Initialization info first apply
initialization.#: "" => "1" \ initialization.0.datastore_id: "" => "shared" \ initialization.0.user_account.#: "" => "1" \ initialization.0.user_account.0.keys.#: "" => "1" \ initialization.0.user_account.0.keys.0: "" => "my-key\n"
Initialization info second apply
initialization.#: "1" => "1" \ initialization.0.datastore_id: "shared" => "shared" \ initialization.0.user_account.#: "1" => "1" \ initialization.0.user_account.0.keys.#: "1" => "1" \ initialization.0.user_account.0.keys.0: "my-key" => "my-key\n" (forces new resource) \ initialization.0.user_account.0.username: " " => "" (forces new resource)
As you can see, you are adding a '\n' to the key and proxmox give you " " as username (instead of "" that you apply).
Thank you so much
The text was updated successfully, but these errors were encountered: