hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
http://www.packer.io
Other
15.05k stars 3.32k forks source link

iso_checksum_url does not work with relative checksum path to ISO on Windows 7 #7217

Open 80c535 opened 5 years ago

80c535 commented 5 years ago

Packer 1.3.3 fails to check the ISO checksum with iso_checksum_url (at least for virtualbox-iso) on Windows 7, Linux is working fine. This issue might be related to the relative path from the checksum file URL to the ISO URL.

Debug logs from Windows and Linux will follow as a comment.

Relevant line in http://archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/current/images/SHA256SUMS

bed8a55ae2a657f8349fe3271097cff3a5b8c3d1048cf258568f1601976fa30d  ./netboot/mini.iso

Template JSON file:

{
  "variables": {
    "ubuntu_mirror": "http://archive.ubuntu.com/ubuntu/dists/",
    "ubuntu_codename": "bionic",
    "username": "test",
    "password": "test"
  },
  "builders": [
    {
      "type": "virtualbox-iso",
      "vm_name": "test_vm",
      "iso_checksum_type": "sha256",
      "iso_checksum_url": "{{ user `ubuntu_mirror` }}{{ user `ubuntu_codename` }}/main/installer-amd64/current/images/SHA256SUMS",
      "iso_url": "{{ user `ubuntu_mirror` }}{{ user `ubuntu_codename` }}/main/installer-amd64/current/images/netboot/mini.iso",
      "boot_wait": "5s",
      "ssh_username": "{{ user `username` }}",
      "ssh_password": "{{ user `password` }}",
      "ssh_wait_timeout": "5s",
      "shutdown_command": "echo {{ user `password` }} | sudo -S shutdown -P now"
    }
  ]
}
80c535 commented 5 years ago

Windows log: https://gist.github.com/80c535/f78002079cae1970899adc46c1512b33 Linux log: https://gist.github.com/80c535/9d27bccd0569bd5e34a206ec8fc410c2