qemu: Waiting for SSH to become available...

1,488 views
Skip to first unread message

Srinivas Reddy

unread,
Feb 6, 2017, 2:42:00 PM2/6/17
to Packer
I am trying to build a packer image for openstack . I am struck at " qemu: Waiting for SSH to become available... "Can anyone please help.

 qemu: Downloading or copying ISO
    qemu: Downloading or copying: file:///devops/packer/images/rhel-server-6.6-x86_64-dvd.iso
==> qemu: Creating hard drive...
==> qemu: Starting HTTP server on port 10084
==> qemu: Found port for communicator (SSH, WinRM, etc): 2226.
==> qemu: Looking for available port between 5900 and 6000
==> qemu: Found available VNC port: 5921
==> 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: Overriding defaults Qemu arguments with QemuArgs...
==> 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...

Alvaro Miranda Aguilera

unread,
Feb 6, 2017, 2:51:49 PM2/6/17
to packe...@googlegroups.com
please share your files. packer template and explain how the iso is unattended

are you familiar with unattended install on redhat?

kickstart?


--
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/9cddacab-313f-48cf-b1ac-3663d9008cc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Srinivas Reddy

unread,
Feb 6, 2017, 3:18:54 PM2/6/17
to Packer
Here are my packer file :

{
  "builders":
  [
    {
      "type": "qemu",
      "iso_url": "file:///devops/packer/images/rhel-server-6.6-x86_64-dvd.iso",
      "iso_checksum": "ef031b0ae8458d6489eb277ba1dcb5de",
      "iso_checksum_type": "md5",
      "output_directory": "output_centos_qcow2",
      "ssh_wait_timeout": "30s",
      "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": "MySecretPassword",
      "ssh_port": 22,
      "ssh_wait_timeout": "900m",
      "vm_name": "testvm",
      "net_device": "virtio-net",
      "disk_interface": "virtio",
      "boot_wait": "5s",
      "qemuargs": [ "-serial", "file:serial.out" ],

      "boot_command":
      [
        "",
        " append console=ttyS0,115200n8 ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/centos6-ks.cfg",
        ""
      ]
    }
  ],
 "provisioners":
  [
    {
      "type": "shell",
      "inline": [
        "sleep 3",
        "yum -y update",
        "yum -y install cloud-init cloud-utils-growpart dracut-modules-growroot",
        "echo \"NOZEROCONF=yes\" >> /etc/sysconfig/network",
        "adduser build-user",
        "echo 'build-user:MySecretPassword' |chpasswd",
        "mkdir /home/build-user/.ssh",
        "chown build-user:build-user /home/build-user/.ssh",
        "chmod 700 /home/build-user/.ssh",
        "echo \"build-user ALL=(ALL) ALL\" >> /etc/sudoers",
        "yum clean cache",
        "yum clean all"
      ]
    },
    {
      "type": "file",
      "source": "centos.json",
      "destination": "/root/centos.json",
      "source": "httpdir/centos6-ks.cfg",
      "destination": "/root/centos6-ks.cfg"
    },
    {
      "type": "file",
      "source": "id_rsa_cloud-user.pub",
      "destination": "/home/build-user/.ssh/authorized_keys"
    },
    {
     "type": "shell",
      "inline": [
        "chmod 600 /home/build-user/.ssh/authorized_keys",
        "chown build-user:build-user /home/build-user/.ssh/authorized_keys",
        "sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config",
        "echo package_upgrade: true >>/etc/cloud/cloud.cfg"
      ]
    }
  ]

 }



--------------------------KS----File ----------------------------------------
cmdline
skipx
install
# url of CentOS Mirror
repo --name=cloud-init --baseurl=http://dl.fedoraproject.org/pub/epel/6/SRPMS

lang en_US.UTF-8
keyboard us
rootpw MySecretPassword
# enable firewall, allow ssh
firewall --enabled --ssh
authconfig --enableshadow --passalgo=sha512
# selinux can be disabled during installation, please reenable thereafter
selinux --disabled
timezone Etc/UTC
%include /tmp/kspre.cfg
services --enabled=network,sshd/sendmail
reboot
# because of dependency problems we can not use --nobase (some essencial are missing)
#%packages --nobase
%packages --nobase
selinux-policy-targeted
at
acpid
cronie-noanacron
crontabs
logrotate
mailx
mlocate
openssh-clients
openssh-server
rsync
sendmail
tmpwatch
vixie-cron
which
wget
epel-release
yum
-biosdevname
-postfix
-prelink
%end
%pre
bootdrive=vda
if [ -f "/dev/$bootdrive" ] ; then
  exec < /dev/tty3 > /dev/tty3
  chvt 3
  echo "ERROR: Drive device does not exist at /dev/$bootdrive!"
  sleep 5
  halt -f
fi
cat >/tmp/kspre.cfg <> /etc/ssh/sshd_config
# at last to clean the image -->
yum clean all
%end

Srinivas Reddy

unread,
Feb 7, 2017, 10:12:02 AM2/7/17
to Packer

correction: 

"boot_command":
      [
        "",
        " append console=ttyS0,115200n8 ks=http://10.44.0.126:80/centos6-ks.cfg",




On Monday, 6 February 2017 14:42:00 UTC-5, Srinivas Reddy wrote:

Srinivas Reddy

unread,
Feb 7, 2017, 1:59:02 PM2/7/17
to Packer
I can access the Kickstart config file over http:




On Monday, 6 February 2017 14:42:00 UTC-5, Srinivas Reddy wrote:

Alvaro Miranda Aguilera

unread,
Feb 7, 2017, 3:12:29 PM2/7/17
to packe...@googlegroups.com
hello

do a manual instalation, on the boot screen press the secuence of keys on your boot command and check the installation goes un-attended

once you get something that work, you will be sure packer will run them for you

but there is the requirement they need to work, so better test them without packer if possible


--
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.

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



--
Alvaro

Reply all
Reply to author
Forward
0 new messages