Hello everyone,
I am having some problems to create a VM (CentOS 7) in a remote ESXi server (6.5.0). The installation goes fine, the VM gets an IP address (I can access it via SSH after the installation is done) and the host can detect the VM IP address as well (it shows the IP address in the VMWare panel, because during the installation I already install the VMware tools). However, Packer cannot advance to the provisioning stage and it keeps showing the following messages:
2019/02/05 08:11:20 packer: 2019/02/05 08:11:20 [DEBUG] Opening new ssh session
2019/02/05 08:11:20 packer: 2019/02/05 08:11:20 [DEBUG] starting remote command: esxcli --formatter csv network vm list
2019/02/05 08:11:21 packer: 2019/02/05 08:11:21 [DEBUG] Opening new ssh session
2019/02/05 08:11:21 packer: 2019/02/05 08:11:21 [DEBUG] starting remote command: esxcli --formatter csv network vm port list -w 3238875
2019/02/05 08:11:22 packer: 2019/02/05 08:11:22 [DEBUG] Error getting SSH address: No interface on the VM has an IP address ready
I already activated the /Net/GuestIPHack setting in the ESXi server (esxcli system settings advanced set -o /Net/GuestIPHack -i 1), as well as enabled the SSH service and opened the VNC ports (working fine too).
If I enter in the host machine and run "esxcli --formatter csv network vm list", it shows the list of VMs:
Name,Networks,NumPorts,WorldID,
centos-base,"VM Network,",1,3238875,
dr-spring,"VM Network,",1,400331,
Next, when I run the "esxcli --formatter csv network vm port list -w 3238875", everything appears to be good:
ActiveFilters,DVPortID,IPAddress,MACAddress,PortID,Portgroup,TeamUplink,UplinkPortID,vSwitch,
,,192.168.2.111,00:0c:29:ec:f2:f3,33554449,VM Network,vmnic0,33554434,vSwitch0,
For my understanding, at this point, for some reason Packer cannot detect this IP address above.
Does anyone have any idea why this is happening?
Below are my template.json file and the kickstart file I am using:
Thanks in advance for any help.