I’m using VMWare-ISO builder for creating machines in the ESXi server. Whenever I start build each time packer is trying to upload the ISO image to packer-cache in the ESXi server. How to avoid copying those file if it already exists there? And also uploading takes more time to copy those image in ESXi server.
Packer checks for existing ISOs in the packer_cache every time it tries to upload one. The default behavior for Packer is not to upload an ISO that was uploaded before.
Are you sure Packer is uploading twice the same ISO? The ISO, if the same, will always have the same name, if Packer is uploading is because the ISO is not there anymore.
Make sure cleanup_remote_cache is not set in your template.
Thanks for the response. I didn’t mention cleanup_remote_cache in my template. Whenever I start build each time it uploads the file to packer_cache with the same file. Suppose if ISO size 6 GB it takes same time to start build in the next time, even though the file is already present.
This is odd
Which Packer version are you using? Could you provide me a simplified version of your template, please. I will try to reproduce, even though my vmware-iso ESXi builds doesn’t upload the same ISO twice.
I suppose /windows/en_windows_7_enterprise_x64_dvd.iso is in your datastore, right? If yes, could you try setting the iso_checksum to “none” and see if the upload is faster?
If that’s the case I think is taking time to check the checksum. Setting it to none wouldn’t be a good solution but this way we will know why is taking too long.
Thanks for your quick response. Actually, the path “iso_url”: “/windows/en_windows_7_enterprise_x64_dvd.iso” refers to my local machine where the packer is installed. Is there is any way to mention the datastore location for “type”: “vmware-iso”