-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
Some Virtual Machine template properties are marked to be updated in-place always #1494
Comments
Hi @n0ct1s-k8sh From your output:
I see only
|
I was also getting architecture creating a diff to be updated in-place but then after using an image with qemu agent pre-installed the diff went away. Edit: Actually getting a diff now after adding a few more VMs on the architecture. Not sure why I thought this was resolved before since I remember specifically testing if I got a diff after another apply.
So this definitely seems like a bug. |
@bpg While I can appreciate your comment about the values being "potentially" updated by the VM, this does have a bit of a "false positive" bug kinda feel to it. After all, After confirming each of these are just empty lists in the state, I guess I'm wondering why they'd need to exist in the state to begin with? Granted, my question relates specifically to a template which has not been created with a |
I also always seem to get the architecture to be updated on new machines even when the cpu architecture is specifically set in the config
|
Yes, this is the actual problem I mentioned regarding the
The fact that other attributes like There is nothing wrong with the computed attributes; we use quite a lot of them. The problem lies with the "regular" attributes that change value when the provider reads them back from PVE after resource creation (mostly) or update (rarely). These cases are bugs, for sure, and they are present across many resources implemented using the old and deprecated Terraform Plugin SDK. These issues are not always straightforward to fix, as the old SDK does not provide the necessary methods to handle default values for attributes, which is a root cause of these discrepancies. The long-term plan is to fix all such bugs in the VM resource, as outlined in #1231.
Agreed, that's not ideal. However, this is a hobby project, and there are only so many hours left in a day after a day job and other commitments. I hope people understand. |
@GeorgeGedox this should be fixed in #1524 |
@bpg This is still an issue. Versions: I was on earlier Terraform and BPG versions with the same issues. |
@bpg I'm also experiencing this issue on the latest 0.66.3.
UPDATE
And here is the same error on 0.64.0 (with some weird value):
As we can see it looks that since 0.64.0 an empty ("") value for arch became valid.
UPDATE 2
It looks as if provider is somehow not even considering what's in the state about 'cpu.architecture', maybe doing some hardcoded changes. Though i reiterate that i didn't try 'aarch64', mostly because of this:
SOME ADDITIONAL INFO
UPDATE 3 THE FINAL ONE I'm not sure how to deal with it considering we'd prefer not to use root at all. For now i think it would be best on 0.64.0+ to just not set 'cpu.architecture' if you're using non-root account. In that case it'll be 'null' in the state and will not be present in manifest and vm conf file at all which in turn won't trigger any updates from provider. ===
I suspect it may've been not long ago removed 'vga.enabled' which is set to false on all my current VMs (i.e. its probably default because i do not set this attribute at all in my variables). I'm not sure if I'll be able to inspect state file on prod after upgrade now, will try to test on some small env. |
@ratiborusx yeah, it will take some time to unload 😅, but I'll get to that, after fixing the ID problem 🤞🏼 |
Okay, that was all good stuff 👍🏼 Thanks for details on the The "unsupported attribute" error is really interesting, and unexpected. I'll take a look what's going on there. |
When you create a virtual machine template (although I don't know if it happens in standalone VMs), the following properties are marked to be updated in-place always, even after every apply:
This is my shell log when I apply and plan for the first time:
Steps to reproduce the behavior:
proxmox_virtual_environment_download_file
resource to download a qcow2 disk image (file extension renamed to.img
as the documentation says in thefile_name
option).proxmox_virtual_environment_vm
resource to create a VM template with the previously downloaded file as the disk.tofu apply
to create all resources for the first time.tofu plan
and apply those new changes.tofu plan
and the same changes are required to apply again and again.Please also provide a minimal Terraform configuration that reproduces the issue.
Expected behavior
It is expected to not have any pending changes in the VM resource.
Screenshots
TF_LOG=DEBUG terraform apply
): Attached in the post.apply.log
The text was updated successfully, but these errors were encountered: