I’ve got a very simple Packer build which fails with 404 when it tries to upload the ISO.
ESXi on the host and vCenter are both version 8. I’ve also testing with a host running ESXi 7.
The log output is pretty useless to my eyes, providing no indication of what isn’t found.
I’ve double and triple checked the name of the host, datacentre, folder, vCenter server, and datastore, along with trying alternatives for most of those, so I’m struggling to understand what could be causing the issue here.
Any ideas or insight would be much appreciated.
packer build
output:
$ PACKER_LOG=1 packer build .
2023/01/21 20:25:28 [INFO] Packer version: 1.8.5 [go1.18.9 darwin arm64]
2023/01/21 20:25:28 [TRACE] discovering plugins in /opt/homebrew/bin
2023/01/21 20:25:28 [TRACE] discovering plugins in /Users/user/.config/packer/plugins
2023/01/21 20:25:28 [DEBUG] Discovered plugin: vsphere = /Users/user/.config/packer/plugins/github.com/hashicorp/vsphere/packer-plugin-vsphere_v1.1.1_x5.0_darwin_arm64
2023/01/21 20:25:28 [INFO] found external [clone iso supervisor] builders from vsphere plugin
2023/01/21 20:25:28 [INFO] found external [-packer-default-plugin-name- template] post-processors from vsphere plugin
2023/01/21 20:25:28 [TRACE] discovering plugins in .
2023/01/21 20:25:28 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2023/01/21 20:25:28 [INFO] PACKER_CONFIG env var set; attempting to open config file: /Users/user/.packerconfig
2023/01/21 20:25:28 [WARN] Config file doesn't exist: /Users/user/.packerconfig
2023/01/21 20:25:28 [INFO] Setting cache directory: /Users/user/.cache/packer
2023/01/21 20:25:28 [TRACE] listing potential installations for "github.com/hashicorp/vsphere" that match ">= v1.1.1". plugingetter.ListInstallationsOptions{FromFolders:[]string{"/opt/homebrew/bin/packer", ".", "/Users/user/.config/packer/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"darwin", ARCH:"arm64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0x140005c8300)}}}}
2023/01/21 20:25:28 [TRACE] Found the following "github.com/hashicorp/vsphere" installations: [{/Users/user/.config/packer/plugins/github.com/hashicorp/vsphere/packer-plugin-vsphere_v1.1.1_x5.0_darwin_arm64 v1.1.1}]
2023/01/21 20:25:28 [INFO] found external [clone iso supervisor] builders from vsphere plugin
2023/01/21 20:25:28 [INFO] found external [-packer-default-plugin-name- template] post-processors from vsphere plugin
2023/01/21 20:25:28 [TRACE] Starting external plugin /Users/user/.config/packer/plugins/github.com/hashicorp/vsphere/packer-plugin-vsphere_v1.1.1_x5.0_darwin_arm64 start builder iso
2023/01/21 20:25:28 Starting plugin: /Users/user/.config/packer/plugins/github.com/hashicorp/vsphere/packer-plugin-vsphere_v1.1.1_x5.0_darwin_arm64 []string{"/Users/user/.config/packer/plugins/github.com/hashicorp/vsphere/packer-plugin-vsphere_v1.1.1_x5.0_darwin_arm64", "start", "builder", "iso"}
2023/01/21 20:25:28 Waiting for RPC address for: /Users/user/.config/packer/plugins/github.com/hashicorp/vsphere/packer-plugin-vsphere_v1.1.1_x5.0_darwin_arm64
2023/01/21 20:25:28 Received unix RPC address for /Users/user/.config/packer/plugins/github.com/hashicorp/vsphere/packer-plugin-vsphere_v1.1.1_x5.0_darwin_arm64: addr is /var/folders/vp/fy9xlglx2hl_b422g0_l4n3m0000gn/T/packer-plugin762866830
2023/01/21 20:25:28 packer-plugin-vsphere_v1.1.1_x5.0_darwin_arm64 plugin: 2023/01/21 20:25:28 Plugin address: unix /var/folders/vp/fy9xlglx2hl_b422g0_l4n3m0000gn/T/packer-plugin762866830
2023/01/21 20:25:28 packer-plugin-vsphere_v1.1.1_x5.0_darwin_arm64 plugin: 2023/01/21 20:25:28 Waiting for connection...
2023/01/21 20:25:28 packer-plugin-vsphere_v1.1.1_x5.0_darwin_arm64 plugin: 2023/01/21 20:25:28 Serving a plugin connection...
2023/01/21 20:25:28 packer-plugin-vsphere_v1.1.1_x5.0_darwin_arm64 plugin: 2023/01/21 20:25:28 [TRACE] starting builder iso
2023/01/21 20:25:28 Build debug mode: false
2023/01/21 20:25:28 Force build: false
2023/01/21 20:25:28 On error:
template.vsphere-iso.debian-11: output will be in this color.
2023/01/21 20:25:28 Waiting on builds to complete...
2023/01/21 20:25:28 Starting build run: template.vsphere-iso.debian-11
2023/01/21 20:25:28 Running builder:
2023/01/21 20:25:28 [INFO] (telemetry) Starting builder vsphere-iso.debian-11
==> template.vsphere-iso.debian-11: Retrieving ISO
==> template.vsphere-iso.debian-11: Trying https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.6.0-amd64-netinst.iso
==> template.vsphere-iso.debian-11: Trying https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.6.0-amd64-netinst.iso?checksum=sha256%3Ae482910626b30f9a7de9b0cc142c3d4a079fbfa96110083be1d0b473671ce08d
2023/01/21 20:25:29 packer-plugin-vsphere_v1.1.1_x5.0_darwin_arm64 plugin: 2023/01/21 20:25:29 Acquiring lock for: https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.6.0-amd64-netinst.iso?checksum=sha256%3Ae482910626b30f9a7de9b0cc142c3d4a079fbfa96110083be1d0b473671ce08d (/Users/user/.cache/packer/588a8fbcdb7814b92d00d21914ddb4c8ad48a406.iso.lock)
2023/01/21 20:25:29 packer-plugin-vsphere_v1.1.1_x5.0_darwin_arm64 plugin: 2023/01/21 20:25:29 Leaving retrieve loop for ISO
2023/01/21 20:25:29 packer-plugin-vsphere_v1.1.1_x5.0_darwin_arm64 plugin: 2023/01/21 20:25:29 No CD files specified. CD disk will not be made.
==> template.vsphere-iso.debian-11: https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.6.0-amd64-netinst.iso?checksum=sha256%3Ae482910626b30f9a7de9b0cc142c3d4a079fbfa96110083be1d0b473671ce08d => /Users/user/.cache/packer/588a8fbcdb7814b92d00d21914ddb4c8ad48a406.iso
==> template.vsphere-iso.debian-11: Uploading 588a8fbcdb7814b92d00d21914ddb4c8ad48a406.iso to packer_cache/588a8fbcdb7814b92d00d21914ddb4c8ad48a406.iso
Build 'template.vsphere-iso.debian-11' errored after 1 second 177 milliseconds: 404 Not Found
==> Wait completed after 1 second 177 milliseconds
==> Some builds didn't complete successfully and had errors:
2023/01/21 20:25:30 [INFO] (telemetry) ending vsphere-iso.debian-11
--> template.vsphere-iso.debian-11: 404 Not Found
==> Wait completed after 1 second 177 milliseconds
2023/01/21 20:25:30 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2023/01/21 20:25:30 machine readable: template.vsphere-iso.debian-11,error []string{"404 Not Found"}
==> Builds finished but no artifacts were created.
==> Builds finished but no artifacts were created.
2023/01/21 20:25:30 [INFO] (telemetry) Finalizing.
2023/01/21 20:25:30 waiting for all plugin processes to complete...
2023/01/21 20:25:30 /Users/user/.config/packer/plugins/github.com/hashicorp/vsphere/packer-plugin-vsphere_v1.1.1_x5.0_darwin_arm64: plugin process exited
Packer file (note I’m using older guest_os_type
and vm_version
because this template is also used on older hosts, but changing these values has no effect on the result):
packer {
required_version = ">= 1.8.4"
required_plugins {
vsphere = {
version = ">= v1.1.1"
source = "github.com/hashicorp/vsphere"
}
}
}
source "vsphere-iso" "debian-11" {
vm_name = "Deb11-Test"
guest_os_type = "debian10_64Guest"
vm_version = "15"
CPUs = "1"
RAM = "1024"
storage {
disk_size = "16384"
disk_thin_provisioned = true
}
vcenter_server = "vc.domain.com"
username = "administrator@vc.domain.com"
password = "obfuscated"
insecure_connection = true
datacenter = "obfuscated"
datastore = "obfuscated"
folder = "obfuscated"
host = "obfuscated"
iso_checksum = "sha256:e482910626b30f9a7de9b0cc142c3d4a079fbfa96110083be1d0b473671ce08d"
iso_url = "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.6.0-amd64-netinst.iso"
ssh_username = "obfuscated"
ssh_password = "obfuscated"
}
build {
name = "template"
sources = ["source.vsphere-iso.debian-11"]
}