packer ssh handshake err: timeout during ssh handshake

935 views
Skip to first unread message

nafidyo...@gmail.com

unread,
Apr 29, 2018, 9:41:30 PM4/29/18
to Packer
im building a vm in esxi6 
with template

{
"builders": [
{
"name": "vmware",
"type": "vmware-iso",
"iso_url": "/home/yucef/wspace/devOps/packer/iso/CentOS-6.9-x86_64-minimal.iso",
"iso_checksum": "422af57b493b8af49d485885a730c5a1d955f803fac85aa51311c393168b9080",
"iso_checksum_type": "sha256",
"ssh_host":"10.0.0.140",
"ssh_username": "root",
"ssh_password": "vagrant",
"ssh_wait_timeout": "12000s",
"vnc_disable_password": true,
"disk_size": "16000",
"tools_upload_flavor": "linux",
"guest_os_type": "centos-64",
"http_directory": "http",
"vmdk_name": "centos7",
"boot_command": [
"<tab> ip=10.0.0.140 netmask=255.255.255.0 gateway=10.0.0.1 text ks=hd:fd0:/centos6.cfg<enter><wait> "
],
"floppy_files": [
"./http/centos6.cfg"
],
"shutdown_command": "echo 'shutdown -P now' > /tmp/shutdown.sh; echo 'vagrant'|sudo -S sh '/tmp/shutdown.sh'",

"remote_type": "esx5",
"remote_host": "{{user `esxi_host`}}",
"remote_datastore": "{{user `esxi_datastore`}}",
"remote_username": "{{user `esxi_username`}}",
"remote_password": "{{user `esxi_password`}}",
"keep_registered": true,
"vmx_data": {
"memsize": "512",
"numvcpus": "1",
"vhv.enable": "TRUE",
"ethernet0.virtualDev": "vmxnet3",
"ethernet0.present":"true",
"ethernet0.startConnected": "true",
"ethernet0.addressType": "generated",
"ethernet0.networkName": "VM Network"
}
}
],
"provisioners": [
{
"type": "shell",
"scripts": [
"scripts/vmware-tools.sh",
"scripts/cleanup.sh"
],
"execute_command": "echo 'vagrant'|sudo -S bash '{{.Path}}'"
}
]
}
and kickstart
install
text
cdrom
lang en_US.UTF-8
keyboard us
network --onboot=yes --bootproto=static --ip=10.0.0.140 --netmask=255.255.255.0 --gateway=10.0.0.1 --nameserver=8.8.8.8 --noipv6
rootpw vagrant
firewall --disabled
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone --utc America/Chicago
zerombr
clearpart --all
part /boot --fstype=ext4 --size=512
part pv.01 --grow --size=1
volgroup vg_vagrantcentos --pesize=4096 pv.01
logvol swap --name=lv_swap --vgname=vg_vagrantcentos --size=1024
logvol / --fstype=ext4 --name=lv_root --vgname=vg_vagrantcentos --grow --size=1
bootloader --location=mbr --append="crashkernel=auto rhgb quiet"
user --name=vagrant --plaintext --password=vagrant
reboot

%packages --nobase --ignoremissing --excludedocs
# vagrant needs this to copy initial files via scp
openssh-clients
sudo
kernel-headers
kernel-devel
gcc
make
perl
wget
nfs-utils
virt-what
-fprintd-pam
-intltool

# unnecessary firmware
-aic94xx-firmware
-atmel-firmware
-b43-openfwwf
-bfa-firmware
-ipw2100-firmware
-ipw2200-firmware
-ivtv-firmware
-iwl100-firmware
-iwl1000-firmware
-iwl3945-firmware
-iwl4965-firmware
-iwl5000-firmware
-iwl5150-firmware
-iwl6000-firmware
-iwl6000g2a-firmware
-iwl6050-firmware
-libertas-usb8388-firmware
-ql2100-firmware
-ql2200-firmware
-ql23xx-firmware
-ql2400-firmware
-ql2500-firmware
-rt61pci-firmware
-rt73usb-firmware
-xorg-x11-drv-ati-firmware
-zd1211-firmware
-kernel-firmware

%end

%post --nochroot
cp /etc/resolv.conf /mnt/sysimage/etc/resolv.conf
%end
%post
# Force to set SELinux to a permissive mode
sed -i -e 's/\(^SELINUX=\).*$/\1permissive/' /etc/selinux/config
# sudo
echo "%vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant
%end



and packer hangs with error
handshake failed: read tcp 10.0.0.1:41616->10.0.0.140:22: read: connection reset by peer
any one can help me pleaze

nafidyo...@gmail.com

unread,
Apr 29, 2018, 9:43:48 PM4/29/18
to Packer
is that a packer issue or esxi issue

Alvaro Miranda Aguilera

unread,
Apr 30, 2018, 3:38:42 AM4/30/18
to packe...@googlegroups.com
hello

that won't do what you want to do.

I suggest please have a working install using dhcp

then move to use floppy to pass the kickstart otherwise you wont be able to download the kickstart file,

and the ip= netmask= gateway= on the boot command will do nothing, those are not valid boot commands for anaconda,

so is not packer issue is a rh configuration misinformation.

Alvaro.


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/a0420d7d-4dce-4bc7-a11b-6a8c4e66c18e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

nafidyo...@gmail.com

unread,
Apr 30, 2018, 3:42:10 PM4/30/18
to Packer
thank you Mr Alvaro for repley I'll follow your advice and i ll share the result to you ..
 have a good day.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.



--
Alvaro

Gabo Kete

unread,
Apr 30, 2018, 6:06:19 PM4/30/18
to Packer
On top of what Alvaro mentioned.. I will recommend to check the firewall rules you have in the ESXi.. usually the firewall is enabled by default so either you disable this or put in place a rule to allow traffic from wherever you are deploying your VM to the ESXi 

nafidyo...@gmail.com

unread,
May 3, 2018, 9:26:09 AM5/3/18
to Packer
helo every one i hope you re doing very good 

i have set a dhcp server in my network and the error change to that in log.

2018/05/03 14:17:29 packer: 2018/05/03 14:17:29 Timeout connecting to 192.168.100.35
2018/05/03 14:17:29 packer: 2018/05/03 14:17:29 [DEBUG] Error getting SSH address: No interface on the VM has an IP address ready
2018/05/03 14:17:34 packer: 2018/05/03 14:17:34 [DEBUG] Opening new ssh session
2018/05/03 14:17:34 packer: 2018/05/03 14:17:34 [DEBUG] starting remote command: esxcli --formatter csv network vm list
2018/05/03 14:17:34 packer: 2018/05/03 14:17:34 [DEBUG] Opening new ssh session
2018/05/03 14:17:34 packer: 2018/05/03 14:17:34 [DEBUG] starting remote command: esxcli --formatter csv network vm port list -w 2103153

On Monday, April 30, 2018 at 2:41:30 AM UTC+1, nafidyo...@gmail.com wrote:

Alvaro Miranda Aguilera

unread,
May 5, 2018, 6:02:48 AM5/5/18
to packe...@googlegroups.com
hello

i think the best is you find and copy a project that work and then you update to what your need.

the log doesn't say much, and not sure what is the status of your project today.

if you want help, provide as much as you can

create a github repo, put your template, a diagram of the network that include your pc esxi host where the dhcp is etc

and a description of what you want to do.

if I read your last message i don't know how to help

alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/22f3f0bd-c1c8-4289-899e-fe572c16e872%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages