Hey All.
Seen a few other posts like this but i haven't been able to come to a resolution..
Running Packer 0.7.5 on CentOS (6.6) server (no UI)
Here is the basic log
packer build packer.centos65.json
qemu output will be in this color.
==> qemu: Downloading or copying ISO
qemu: Downloading or copying:
http://mirror.beyondhosting.net/CentOS/6/isos/x86_64/CentOS-6.6-x86_64-netinstall.iso==> qemu: Creating hard drive...
==> qemu: Starting HTTP server on port 10088
==> qemu: Found port for SSH: 2224.
==> qemu: Looking for available port between 5900 and 6000
==> qemu: Found available VNC port: 5947
==> qemu: Starting VM, booting from CD-ROM
qemu: WARNING: The VM will be started in headless mode, as configured.
qemu: In headless mode, errors during the boot sequence or OS setup
qemu: won't be easily visible. Use at your own discretion.
==> qemu: Waiting 5s for boot...
==> qemu: Connecting to VM via VNC
==> qemu: Typing the boot command over VNC...
==> qemu: Waiting for SSH to become available...
here it times out eventually.
Detailed Log looks something like this, i've stripped a bunch of stuff out obviously...
14:04:17 Reading template: packer.centos65.json
14:04:17 Creating build: qemu
14:04:17 Loading builder: qemu
14:04:17 Creating plugin client for path: /usr/local/packer/packer-builder-qemu
14:04:17 Starting plugin: /usr/local/packer/packer-builder-qemu []string{"/usr/local/packer/packer-builder-qemu"}
14:04:17 Waiting for RPC address for: /usr/local/packer/packer-builder-qemu
14:04:17 packer-builder-qemu: 14:04:17 Plugin minimum port: 10000
14:04:17 packer-builder-qemu: 14:04:17 Plugin maximum port: 25000
14:04:17 packer-builder-qemu: 14:04:17 Waiting for connection...
14:04:17 packer-builder-qemu: 14:04:17 Serving a plugin connection...
14:04:17 Starting build run: qemu
14:04:17 Running builder: qemu
14:04:17 packer-builder-qemu: 14:04:17 Qemu path: /usr/libexec/qemu-kvm, Qemu Image page: /usr/bin/qemu-img
14:04:18 packer-builder-qemu: 14:04:18 No floppy files specified. Floppy disk will not be made.
14:04:18 ui: ^[[1;32m==> qemu: Creating hard drive...
14:04:18 packer-builder-qemu: 14:04:18 Executing qemu-img: []string{"create", "-f", "qcow2", "output_centos_tdhtest/centost65test.qcow2", "5000M"}
14:04:18 packer-builder-qemu: 14:04:18 stdout: Formatting 'output_centos_tdhtest/centost65test.qcow2', fmt=qcow2 size=
5242880000 encryption=off cluster_size=65536
14:04:18 ui: ^[[1;32m==> qemu: Starting HTTP server on port 10088
14:04:18 ui: ^[[1;32m==> qemu: Found port for SSH: 2224.
14:04:18 ui: ^[[1;32m==> qemu: Found available VNC port: 5947
14:04:18 ui: ^[[1;32m==> qemu: Starting VM, booting from CD-ROM
14:04:18 ui: ^[[0;32m qemu: WARNING: The VM will be started in headless mode, as configured.
qemu: In headless mode, errors during the boot sequence or OS setup
qemu: won't be easily visible. Use at your own discretion.
14:04:18 packer-builder-qemu: 14:04:18 Executing /usr/libexec/qemu-kvm: []string{"-device", "virtio-net-pci,netdev=user.0", "-cdrom", "/usr/local/packer/packer_cache/85d0fa70ad41185d3af8db1d3fdf32ed585fda7b9c258c2f792a040c4b2dccc3.iso", "-netdev", "user,id=user.0,hostfwd=tcp::2224-:22", "-vnc", "
0.0.0.0:47", "-machine", "type=pc,accel=kvm", "-drive", "file=output_centos_tdhtest/centost65test.qcow2,if=virtio,cache=writeback", "-boot", "once=d", "-m", "512M", "-name", "centost65test"}
14:04:18 packer-builder-qemu: 14:04:18 Started Qemu. Pid: 6391
14:04:20 ui: ^[[1;32m==> qemu: Waiting 5s for boot...
14:04:25 ui: ^[[1;32m==> qemu: Connecting to VM via VNC
14:04:25 packer-builder-qemu: 14:04:25 Connected to VNC desktop: QEMU (centost65test)
14:04:25 ui: ^[[1;32m==> qemu: Typing the boot command over VNC...
14:04:33 packer-builder-qemu: 14:04:33 Waiting for SSH, up to timeout: 1h30m0s
14:04:33 ui: ^[[1;32m==> qemu: Waiting for SSH to become available...^[[0m
14:04:33 packer-builder-qemu: 14:04:33 Attempting SSH connection...
14:04:33 packer-builder-qemu: 14:04:33 reconnecting to TCP connection for SSH
14:04:33 packer-builder-qemu: 14:04:33 handshaking with SSH
14:05:04 packer-builder-qemu: 14:05:04 handshake error: ssh: handshake failed: read tcp
127.0.0.1:2224: connection reset by peer
14:05:04 packer-builder-qemu: 14:05:04 SSH handshake err: ssh: handshake failed: read tcp
127.0.0.1:2224: connection reset by peer
over and over again...
My packer.centos65.json looks like this.
{
"builders":
[
{
"type": "qemu",
"iso_url": "
http://mirror.beyondhosting.net/CentOS/6/isos/x86_64/CentOS-6.6-x86_64-netinstall.iso",
"iso_checksum": "2342bc5ea72fc028972aa0f21cee28b4",
"iso_checksum_type": "md5",
"output_directory": "output_centos_tdhtest",
"ssh_wait_timeout": "30s",
"qemu_binary": "qemu-kvm",
"shutdown_command": "shutdown -P now",
"disk_size": 5000,
"format": "qcow2",
"headless": true,
"accelerator": "kvm",
"http_directory": "httpdir",
"http_port_min": 10082,
"http_port_max": 10089,
"ssh_host_port_min": 2222,
"ssh_host_port_max": 2229,
"ssh_username": "root",
"ssh_password": "password",
"ssh_port": 22,
"ssh_wait_timeout": "90m",
"vm_name": "centost65test",
"net_device": "virtio-net-pci",
"disk_interface": "virtio",
"boot_wait": "5s",
"boot_command":
[
"<tab><wait>",
" ks=http://<a local url i can view in a browser>packer.ks<enter>"
]
}
]
}
my kickstart looks something like this..
#version=DEVEL
install
text
url --url
http://local.repo/yum/centos/6/os/x86_64lang en_US.UTF-8
keyboard us
network --onboot yes --device eth0 --bootproto dhcp
rootpw --iscrypted <root password>
reboot
firewall --disabled --service=ssh
authconfig --useshadow --enablemd5
selinux --disabled
skipx
timezone --utc America/Los_Angeles
services --disabled atd,autofs,avahi-daemon,bluetooth,cups,fcoe,haldaemon,ip6tables,iptables,iscsi,iscsid,jexec,livesys-late,lldapd,messagebus,netfs,nfslock,openct,pcscd,rpcbind,rpcidmapd
bootloader --location=mbr --driveorder=sda --append="panic=10"
zerombr
clearpart --drives=sda --all --initlabel
part /boot --fstype=ext4 --size=500 --asprimary --ondisk=sda
part / --fstype=ext4 --grow --size=3000 --asprimary --ondisk=sda
part swap --grow --maxsize=2016 --size=2016 --asprimary --ondisk=sda
%pre
$SNIPPET('pre_anamon')
$SNIPPET('kickstart_start')
%end
%packages --nobase
@Core
binutils
bind-utils
gcc
git
jwhois
kernel-devel
lsof
make
man
nc
nmap
ntp
patch
python
rsync
screen
sudo
sysstat
strace
system-config-network-tui
system-config-firewall
unzip
vconfig
vim-minimal
vim-enhanced
wget
which
zip
-indexhtml
%end
%post
### Install packer SSH key
cd /root
mkdir --mode=700 .ssh
cat >> .ssh/authorized_keys << "PUBLIC_KEY"
ssh-rsa myKey...
PUBLIC_KEY
chmod 600 .ssh/authorized_keys
$SNIPPET('kickstart_done')
%end
Any help debugging would be truly appreciated...
Cheers
Eric