hashicorp / hashicorp/packer

Packer stuck at: "Gracefully halting virtual machine" and build gets failed stating time out.

Open
#12,472 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
15.8k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

Packer stuck at: "Gracefully halting virtual machine" and (shutdown_command = "%windir%\\system32\\sysprep\\sysprep.exe /unattend:A:\\Autounattend.xml /quiet /generalize /oobe /shutdown /mode:VM") never gets executed then finally packer build gets failed without creating build arctifacts stating timed out issue post "shutdown_timeout"+"winrm_timeout".

I am using latest version of Packer and Hyper-V as my hypervisor and I am successfully above to manully execute "%windir%\system32\sysprep\sysprep.exe /quiet /generalize /oobe /shutdown /mode:VM" but having issue with (shutdown_command = "%windir%\\system32\\sysprep\\sysprep.exe /unattend:A:\\Autounattend.xml /quiet /generalize /oobe /shutdown /mode:VM"). Any suggestions.

packer {
required_plugins {
hyperv = {
version = ">= 1.1.0"
source = "github.com/hashicorp/hyperv"
}
}
}

source "hyperv-iso" "autogenerated_1" {
iso_checksum = "sha256:6DAE072E7F78F4CCAB74A45341DE0D6E2D45C39BE25F1F5920A2AB4F51D7BCBB"
iso_url = "C:/AshImages/2019/17763.3650.221105-1748.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso"
output_directory = "C:/CSG/2k19PackerBuild"
skip_export = true
use_fixed_vhd_format = true
vm_name = "windows2019-vhd-packer"
communicator = "none"
skip_compaction = true
winrm_timeout = "5m"
shutdown_timeout = "25m"
shutdown_command = "%windir%\\system32\\sysprep\\sysprep.exe /unattend:A:\\Autounattend.xml /quiet /generalize /oobe /shutdown /mode:VM"


floppy_files = [
"C:/CSG-DC/Autounattend.xml"
]

boot_command = [
"",
"",
"D:\\setup.exe /unattend:A:\\Autounattend.xml",
"",
]
}

build {
sources = ["hyperv-iso.autogenerated_1"]
}

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.