Packer Qemu image has trouble running vm's

534 views
Skip to first unread message

Muhammad Tameem Iftikhar

unread,
Nov 17, 2016, 3:34:47 PM11/17/16
to Packer

Hey Guys, currently trying to get packer to build a Qemu image for use with KVM. I can successfully build a qcow2 image using packer and its only the basic ubuntu 12.04 image. But when i use the image in virt-manager to create a VM, the vm gets stuck on the boot steps after the configure network device. I can use official cloud ubuntu qcow2 image to create vm’s in virt-manager so its not related to DHCP issues on my host. But with the packer image it always seems to be stuck in the boot steps. Any insight?

Rickard von Essen

unread,
Nov 17, 2016, 3:36:45 PM11/17/16
to packe...@googlegroups.com
Can you share any logs, and debug info?

On 17 November 2016 at 21:34, Muhammad Tameem Iftikhar <mift...@surfeasy.com> wrote:

Hey Guys, currently trying to get packer to build a Qemu image for use with KVM. I can successfully build a qcow2 image using packer and its only the basic ubuntu 12.04 image. But when i use the image in virt-manager to create a VM, the vm gets stuck on the boot steps after the configure network device. I can use official cloud ubuntu qcow2 image to create vm’s in virt-manager so its not related to DHCP issues on my host. But with the packer image it always seems to be stuck in the boot steps. Any insight?

--
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/4625be8b-dbda-426a-9672-b8b75ac80453%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Muhammad Tameem Iftikhar

unread,
Nov 17, 2016, 4:35:23 PM11/17/16
to Packer
Hi, 

As far as the packer build is concerned there are no errors in the logs and the image creation process completes successfully. On boot the system gets stuck after the following logs in the screen shot

Screen Shot 2016-11-17 at 4.34.10 PM


In the syslogs i can see the dhcp request successfully passing and an ip being assigned to the vm:

Nov 17 16:33:49 tameem-virtual-machine kernel: [17096.000859] virbr0: port 1(vnet0) entered listening state
Nov 17 16:33:49 tameem-virtual-machine kernel: [17096.000869] virbr0: port 1(vnet0) entered listening state
Nov 17 16:33:50 tameem-virtual-machine kernel: [17096.745048] kvm: zapping shadow pages for mmio generation wraparound
Nov 17 16:33:51 tameem-virtual-machine avahi-daemon[592]: Joining mDNS multicast group on interface vnet0.IPv6 with address fe80::fc54:ff:fea3:8425.
Nov 17 16:33:51 tameem-virtual-machine avahi-daemon[592]: New relevant interface vnet0.IPv6 for mDNS.
Nov 17 16:33:51 tameem-virtual-machine avahi-daemon[592]: Registering new address record for fe80::fc54:ff:fea3:8425 on vnet0.*.
Nov 17 16:33:51 tameem-virtual-machine kernel: [17098.002451] virbr0: port 1(vnet0) entered learning state
Nov 17 16:33:53 tameem-virtual-machine kernel: [17100.007850] virbr0: topology change detected, propagating
Nov 17 16:33:53 tameem-virtual-machine kernel: [17100.007860] virbr0: port 1(vnet0) entered forwarding state
Nov 17 16:33:54 tameem-virtual-machine kernel: [17100.198430] kvm [27132]: vcpu0 disabled perfctr wrmsr: 0xc1 data 0xffff
Nov 17 16:33:56 tameem-virtual-machine dnsmasq-dhcp[2354]: DHCPREQUEST(virbr0) 192.168.122.169 52:54:00:a3:84:25 
Nov 17 16:33:56 tameem-virtual-machine dnsmasq-dhcp[2354]: DHCPACK(virbr0) 192.168.122.169 52:54:00:a3:84:25 packertest


Other than that there are no logs e.t.c. Any recommendations for where i can check logs for a vm boot load failure? 

Regards,
Tameem


On Thursday, November 17, 2016 at 3:36:45 PM UTC-5, Rickard von Essen wrote:
Can you share any logs, and debug info?
On 17 November 2016 at 21:34, Muhammad Tameem Iftikhar <mift...@surfeasy.com> wrote:

Hey Guys, currently trying to get packer to build a Qemu image for use with KVM. I can successfully build a qcow2 image using packer and its only the basic ubuntu 12.04 image. But when i use the image in virt-manager to create a VM, the vm gets stuck on the boot steps after the configure network device. I can use official cloud ubuntu qcow2 image to create vm’s in virt-manager so its not related to DHCP issues on my host. But with the packer image it always seems to be stuck in the boot steps. Any insight?

--
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...@googlegroups.com.
Screen Shot 2016-11-17 at 4.34.10 PM.png

Alvaro Miranda Aguilera

unread,
Nov 17, 2016, 4:37:07 PM11/17/16
to packe...@googlegroups.com
so something is causing issues on /boot

what command are you using to bring the VM down when you create it ?

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/7a74165b-2f7d-43cf-a312-7b10ed254099%40googlegroups.com.

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



--
Alvaro

Muhammad Tameem Iftikhar

unread,
Nov 17, 2016, 4:53:46 PM11/17/16
to Packer
In my packer file i am using the following shutdown command to bring the vm down: 

 "shutdown_command": "echo '{{user `ssh_pass`}}' | sudo -S shutdown -P now"

I have also attached the packer json template that i am using for you to take a look at. 



--
Alvaro

packer.json

Muhammad Tameem Iftikhar

unread,
Nov 17, 2016, 5:46:26 PM11/17/16
to Packer
I also, used this repo to build an image and use that. Still the same issue, stuck on boot. https://gitlab.com/groenator/packer-build


On Thursday, November 17, 2016 at 4:37:07 PM UTC-5, Alvaro Miranda Aguilera wrote:



--
Alvaro

Muhammad Tameem Iftikhar

unread,
Nov 17, 2016, 9:48:27 PM11/17/16
to Packer
Hey Guys,

Seems like there is a bug with 12.04.5 ubuntu and cloud init which seemed to be the cause of the system not booting. i was able to bring up a 14.04 box, will post back later if i have any luck with ubuntu 12.04.4

Andrew Pennebaker

unread,
Jun 26, 2019, 3:09:33 PM6/26/19
to Packer
Am seeing a similar issue with Debian guests. In my case, I am using an Ubuntu 19.04 Disco Dingo host and a Debian 9.8 Stretch PPC64el guest. Packer is able to produce a qemu image for the guest, and I can even boot and manipulate guests with minor Vagrant tweaks on VM instances. I'm getting close to having a handy gcc ppc64el box for cross-compiling apps!

Unfortunately, when I try to export a PPC64el qemu guest as an enriched Vagrant base box, then that one refuses to boot. It appears that the vagrant-libvirt plugin somehow corrupts things on `vagrant export`, compared to how Packer exports boxes. Any tips for resolving this glitch?
Reply all
Reply to author
Forward
0 new messages