I am trying to clone a Windows Server 2019 VM Template in vSphere ESXi 7.0 using the “vsphere-clone” plugin. I am just cloning the existing VM and creating a new VM with different IP.
It just keeps waiting at the below forever.
“Waiting for WinRM to become available…”
Packer Build:
>> packer build -var-file packer-windows.pkrvars.hcl packer-windows2019.pkr.hcl
vsphere-clone.windows-server: output will be in this color.
==> vsphere-clone.windows-server: Cloning VM…
==> vsphere-clone.windows-server: Mounting ISO images…
==> vsphere-clone.windows-server: Adding configuration parameters…
==> vsphere-clone.windows-server: Customizing VM…
==> vsphere-clone.windows-server: Power on VM…
==> vsphere-clone.windows-server: Waiting for IP…
==> vsphere-clone.windows-server: IP address: X.Y.Z.A
==> vsphere-clone.windows-server: Using WinRM communicator to connect: X.Y.Z.A
==> vsphere-clone.windows-server: Waiting for WinRM to become available…
(it just hangs here forever)
I also checked the winrm status and that service is enabled and listening. But, this doesn’t succeed after the cloned VM reboots with a new IP Address.
nc -z -w1 X.Y.Z.A 5985;echo $?
Connection to X.Y.Z.A port 5985 [tcp/wsman] succeeded!
0
I am not able to figure out the issue with winrm. Please advise.
packer-windows.pkrvars.hcl.txt (721 Bytes)
packer-windows2019.pkr.hcl.txt (3.7 KB)