Open Sad-Soul-Eater opened 1 year ago
I'm having the same issue at the moment with a vm cloned from a template, after terraform apply
everything seems fine except the disk settings for SSD Emulation and Discard.
If I rerun the terraform apply
command again I always get this
~ disk {
+ discard = "on"
~ ssd = false -> true
# (5 unchanged attributes hidden)
}
The storage is a local nvme ssd so it's not something exotic like ceph, nfs, iscsi, etc.
Hi @Sad-Soul-Eater! 👋🏼 Thanks for the detailed report and logs! And thanks @GeorgeGedox for confirming 👍🏼
I'll take a look at the earliest opportunity.
Working with clones is a bit of a mess in the provider. In fact, no disk attributes can be updated other than the size of the disk or its storage. The other attribute values are ignored on apply, but kept in the TF state, so terraform then starts complaining about the mismatch on re-apply.
Another problem is the defaults that we have for disk attributes, like file type (which is qcow2
if not set) et. al. Currently all of this is simply ignored, but when we start applying attributes from a cloned VM those default may be incompatible like qcow2
for a block storage, or be simply wrong in the context of clone.
That's all legacy code, it will take some time to untangle and fix all of this...
Hello,
It evens happen if the template and the VM have discard set to "on" but when the VM node is not the same as the template's one. Subsequent terraform apply does not help either, it keeps updating but discard stays off. Tried both values true and "on", without any change.
Thanks
Actually keeping it on the same node also sets discard back to ignore. As far as I can tell, there's no way to turn it on when cloning from a template via this provider :(
Describe the bug
Discard
parameter doesn't enablediscard
for disk. Issue occurred on VM cloned from template with disableddiscard
disk parameter. After runningterraform apply
again, without making any changes in the files, it announces that it will enablediscard
on disk, but does nothing and even disables the cache for the target disk (the provider does not provide a cache control parameter, but can detect it, but only on the second run...)To Reproduce
discard = "on"
in disk blockterraform apply
discard = "on"
in announced actionsdiscard
parameter state in proxmox web-ui => it still disabled :cMinimal Terraform configuration that reproduces the issue.
Expected behavior Discard parameter works
Screenshots
Template disk parameters:
VM disk parameters after 1st apply:
VM disk parameters after 2nd apply:
Additional context PVE: 7.4-3 provider: 0.21.0 terraform: v1.4.6 OS: ArchLinux
1st debug apply logs 2nd debug apply log