Overview of the Issue
Packer build for a given Windows server build no longer works, with the OS install ISO and VMWare tools ISOs getting swapped.
Version 1.2.4 and older:
D: = Windows Install media ISO
E: = VMware Tools ISO
Version 1.2.5:
D: = VMware Tools ISO
E: = Windows Install media ISO
Reproduction Steps
Works as per previous version: KO Packer build where
packer {
required_plugins {
ansible = {
version = ">= 1.1.1"
source = "github.com/hashicorp/ansible"
}
vsphere = { # added due to https://www.hashicorp.com/blog/announcing-the-removal-of-bundled-plugins-in-hashicorp-packer
version = "= 1.2.4"
source = "github.com/hashicorp/vsphere"
}
}
}
Change to 1.2.5 - Build will timeout waiting for VMTools to install
packer {
required_plugins {
ansible = {
version = ">= 1.1.1"
source = "github.com/hashicorp/ansible"
}
vsphere = { # added due to https://www.hashicorp.com/blog/announcing-the-removal-of-bundled-plugins-in-hashicorp-packer
version >= "= 1.2.5"
source = "github.com/hashicorp/vsphere"
}
}
}
Packer Version
1.8.3
Plugin Version and Builders
Please provide the plugin version.
1.2.5
Please select the builder.
VMware vSphere Version
Please provide the VMware vSphere version.
vCenter Server 7.0 Update 3o
VMware ESXi 7.0 Update 3g
Guest Operating System
Windows 2022 & 2019
Simplified Packer Buildfile
source "vsphere-iso" "windows2022" {
// https://github.com/vmware-samples/packer-examples-for-vsphere/blob/main/builds/windows/server/2016/windows-server.pkr.hcl
....
storage {
disk_size = var.windows2022_vm_disk_sizeMB
disk_controller_index = 0
disk_thin_provisioned = true
}
network_adapters {
network = var.vcenter_network
network_card = "vmxnet3"
}
cdrom_type = var.windows2022_vm_cdrom_type
remove_cdrom = true
reattach_cdroms = 1
// vSphere template settings
convert_to_template = true
export {
force = true
output_directory = var.ovfFile_location
}
create_snapshot = false
// OS Configuration
guest_os_type = "${var.windows2022_vm_guest_os_type}"
notes = "Default User: ${var.winrm_username}\nBuilt by Packer @ {{isotime \"2006-01-02 03:04\"}}."
// Removable Media Settings
iso_url = "${var.windows_artifcatory}${var.windows2022_iso}"
iso_target_path = "${var.PACKER_CACHE_DIR}/${var.windows2022_iso}"
iso_checksum = var.windows2022_checksum
iso_paths = ["[] /vmimages/tools-isoimages/${var.windows2022_os_family}.iso"]
floppy_files = [
"${var.os_config_root}/${var.windows2022_os_family}/${var.windows2022_scripts_folder}/"
]
floppy_content = {
"autounattend.xml" = templatefile("${var.os_config_root}/${var.windows2022_os_family}/${var.windows2022_scripts_folder}/${var.windows2022_vm_firmware}_autounattend.pkrtpl.hcl", {
vm_guest_os_language = var.windows2022_vm_guest_os_language
vm_guest_os_keyboard = var.windows2022_vm_guest_os_keyboard
vm_guest_os_timezone = var.windows2022_vm_guest_os_timezone
})
}
// Boot and Provisioning Settings
// http_port_min = var.common_http_port_min
// http_port_max = var.common_http_port_max
boot_order = var.windows2022_vm_boot_order
boot_wait = var.windows2022_vm_boot_wait
boot_command = var.windows2022_vm_boot_command
Set the env var PACKER_LOG=1 for maximum log detail.
Overview of the Issue
Packer build for a given Windows server build no longer works, with the OS install ISO and VMWare tools ISOs getting swapped.
Version 1.2.4 and older:
D: = Windows Install media ISO
E: = VMware Tools ISO
Version 1.2.5:
D: = VMware Tools ISO
E: = Windows Install media ISO
Reproduction Steps
Works as per previous version: KO Packer build where
Change to 1.2.5 - Build will timeout waiting for VMTools to install
Packer Version
1.8.3
Plugin Version and Builders
Please provide the plugin version.
1.2.5
Please select the builder.
vsphere-isoVMware vSphere Version
Please provide the VMware vSphere version.
vCenter Server 7.0 Update 3o
VMware ESXi 7.0 Update 3g
Guest Operating System
Windows 2022 & 2019
Simplified Packer Buildfile
Set the env var
PACKER_LOG=1for maximum log detail.