-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
File size always considered changed when downloading compressed image #1740
Comments
Thanks for the report, @Afnarel! You can set That said, we could technically store the original remote file size in the Terraform state and use it for comparison during state refresh. However, this might have other implications, so we'll need to think it through 🤔 |
From what i remember, this feature (recreate file resource when file size has changed) is pretty simple and assumes that size from content-length header from url is the same as file size after download. ^ Obviously this is not always the case as per this issue
|
I had tried adding the Actually, after seeing your comments, I tried running About documentation, I was not 100% sure what Using |
Describe the bug
When trying to download a compressed ISO image (using proxmox_virtual_environment_download_file), it seems the size from the downloaded compressed image is compared against the size of the already present local uncompressed image (if there is one).
So Terraform always considers the image size has changed and wants to download the image again and recreate the VM using this ISO every time.
To Reproduce
Steps to reproduce the behavior:
terraform apply
terraform apply
(or even justterraform plan
) a second time without changing anythingExpected behavior
On a second run, if the image is already present in the local storage, it should not be downloaded again.
Additional information
This issue was raised a few months ago but in this other case the image was not compressed: #1440
When an image is uncompressed and its size changes I understand that the image should be considered different, leading to recreate the VM with the newly downloaded image.
However in this case the problem seems to be a different one. Not sure how to solve it.
Also, using a lifecycle block to ignore disk changes doesn't feel like a viable solution: I still want to be able to change disk size and other disk parameters.
Screenshots
TF_LOG=DEBUG terraform apply
):The text was updated successfully, but these errors were encountered: