Skip to content
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

iso_download_pve doesn't check if the ISO already exists when checksum is set to "none" #179

Open
theblop opened this issue Mar 23, 2023 · 3 comments
Labels

Comments

@theblop
Copy link

theblop commented Mar 23, 2023

Overview of the Issue

iso_download_pve can't be used with checksum="none" if the ISO already exists on the proxmox server:

==> proxmox-iso.xxxxx: Beginning download of https://download.rockylinux.org/pub/rocky/8/isos/x86_64/Rocky-8.7-x86_64-dvd1.iso to node proxmox
==> proxmox-iso.xxxxx: refusing to override existing file '/storage/directory/template/iso/Rocky-8.7-x86_64-dvd1.iso'
==> proxmox-iso.xxxxx: Step "stepDownloadISOOnPVE" failed, aborting...

Use Case(s)

Checksumming ISO images can take a long time (the rocky linux ISO is > 10GB!) and it would be nice if we could disable it during development/testing of packer build pipelines.

In the past (before iso_download_pve), I handled the ISO outside packer during build development, and used "iso_file" instead of "iso_url" in the source definition before changing it back to "iso_url" with checksumming (controlled by a variable) before production use.

With "iso_download_pve" I can finally just set it to "iso_url" and avoid the long transfer times between the packer client and proxmox, but if checksum is set to "none" the builder correctly skips the checksum but doesn't check if the ISO already exists on the proxmox server before attempting to download it. So this works the first time an ISO is downloaded, but fails on subsequent builds.

Reproduction Steps

set iso_download_pve = true and checksum = "none" in a proxmox-iso source and build the image twice

Plugin and Packer version

Packer v1.8.6
proxmox plugin 1.1.2

@theblop theblop added the bug label Mar 23, 2023
@sebastian-de
Copy link
Contributor

That's a limitation of the Proxmox API.
I already submitted a patch upstream that fixes that, but I didn't receive a response from the Proxmox developer team yet: https://lists.proxmox.com/pipermail/pve-devel/2023-March/056034.html

@theblop
Copy link
Author

theblop commented Mar 23, 2023

So my use case is more about skipping the ISO download rather than overwriting it if checksum="none" and the file already exists on the proxmox server, but maybe it's the same API limitation?

@sebastian-de
Copy link
Contributor

Ah sorry, I should have read more carefully.
AFAIK there is no way to reuse an already present ISO without providing a checksum.

iso_download_pve uses this API-endpoint: https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/storage/{storage}/download-url

And the error

==> proxmox-iso.xxxxx: refusing to override existing file ...

stems from the Proxmox API, not from Packer. So I guess an option to skip downloading an already present file, even without providing a checksum, would have to be implemented for the Proxmox API first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants