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

vsphere-iso: meaningless dowload of ISO when it is already uploaded #9951

Closed
kshpytsya opened this issue Sep 16, 2020 · 3 comments · Fixed by #10143
Closed

vsphere-iso: meaningless dowload of ISO when it is already uploaded #9951

kshpytsya opened this issue Sep 16, 2020 · 3 comments · Fixed by #10143

Comments

@kshpytsya
Copy link

kshpytsya commented Sep 16, 2020

Overview of the Issue

We are running packer in a cloud-based CI environment to build vSphere VM templates. The packer_cache directory is absent. packer meaninglessly downloads an ISO and then correctly notices "File already uploaded; continuing". I believe that the ISO download step should only be performed if ISO is not already uploaded to vCenter. If you insist on always wanting to download an ISO to verify the checksum, then let there be a way to optionally skip this, as it is a waste of build time (90s in our case) and traffic.

Possibly related issues:
#5157 #8378 #9456 #1974

Reproduction Steps

rm -rf packer_cache && packer build packer.json

Packer version

Packer v1.6.2

Simplified Packer Buildfile

https://gist.github.com/kshpytsya/de12303e70fea73659f4ae7a040ca60b#file-packer-json

Operating system and Environment details

Linux (Gentoo, Ubuntu), x86_64

Log Fragments and crash.log files

2020-09-16T23:15:10+03:00: ==> vsphere-iso: Retrieving ISO
2020-09-16T23:15:10+03:00: ==> vsphere-iso: Trying http://cdimage.ubuntu.com/releases/18.04.5/release/ubuntu-18.04.5-server-amd64.iso
2020-09-16T23:15:10+03:00: ==> vsphere-iso: Trying http://cdimage.ubuntu.com/releases/18.04.5/release/ubuntu-18.04.5-server-amd64.iso?checksum=sha256%3A8c5fc24894394035402f66f3824beb7234b757dd2b5531379cb310cedfdf0996
ver-amd64.iso 951.00 MiB / 951.00 MiB [=========================================================] 100.00% 1m30s
2020-09-16T23:16:44+03:00: ==> vsphere-iso: http://cdimage.ubuntu.com/releases/18.04.5/release/ubuntu-18.04.5-server-amd64.iso?checksum=sha256%3A8c5fc24894394035402f66f3824beb7234b757dd2b5531379cb310cedfdf0996 => /tmp/base-vm-image--vsphere--test-dc--ubuntu18--8ps8yyjg/packer_cache/a37af95ab12e665ba168128cde2f3662740b21a2.iso
2020-09-16T23:16:45+03:00: ==> vsphere-iso: Uploading a37af95ab12e665ba168128cde2f3662740b21a2.iso to packer_cache/a37af95ab12e665ba168128cde2f3662740b21a2.iso
2020-09-16T23:16:46+03:00: ==> vsphere-iso: File already uploaded; continuing

Full log: https://gist.github.com/kshpytsya/de12303e70fea73659f4ae7a040ca60b#file-gistfile1-txt

@sylviamoss
Copy link
Member

Hey there, thanks for reaching out. This is good and I think it would be nice to have a workaround for that. We’ll take a look when we get a chance.

@SwampDragons
Copy link
Contributor

We can probably add a step before stepDownload to see if the url exists on the remote host, and if it does then set some kind of "skip" flag on stepDownload

@ghost
Copy link

ghost commented Nov 22, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Nov 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants