You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
I was creating and deploying images using PackerBuild@1. I was also stuck once a couple of months back with the same issue, however, I was following standard packer build procedure i.e. creating a JSON file for packer having builder and provisioners.
Initially what I was doing is after my provisioner typed "PowerShell" execution i was executing the Sysprep command as you have written. When I included the "windows restart" type in packer JSON before executing the Sysprep cmd, it worked. I checked it by logging into the VM created to modify the Sysprep server needs restarts. That's where I included this block.
Hi @AshTechieDevOps, pretty sure the issue is a non-successful sysprep process. Please double check the file C:\Windows\System32\Sysprep\Panther\*.log and look for Errors. Alternatively you can use the error-cleanup-provisioner which will allow you to grab the logfiles before the machine is being killed by packer.
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"]
}
The text was updated successfully, but these errors were encountered: