Packer with QEMU running on a VM and build the image in remote a bare metal KVM host

281 views
Skip to first unread message

Miguel Baquero

unread,
Aug 29, 2018, 5:32:18 PM8/29/18
to Packer
Hi,
Is there any way to run Packer inside a VM without using nested virtualization or mounting a KVM host socket directory to it?
I would like not to have to install anything on the bare wire host, just QEMU and the virtualization host packages. I'm using CentOS for the VM hosts and guests. CentOS doesn't support p9 FS and configuring nfs on the KVM is invasive to me.
Any help would be appreciated.
Thank you.

Rickard von Essen

unread,
Sep 1, 2018, 12:02:19 PM9/1/18
to packe...@googlegroups.com
I'm not sure how you would do that, it's likely easy to tunnel kvm with some extra qemu parameters but Packer also uses qemu-img which I think only works with local files.

On positive side is that packer is just a statically linked binary so you can easily create a script that you execute over ssh that uploads any source files, downloads packer, executes it, and export any artifact, and finally cleans up.

// Rickard

PS. If you in detail could describe how to execute qemu towards a remote kvm host it might be worth opening a feature request and someone might implement it.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/a8c080ee-88fb-408b-b133-690e0f695481%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Miguel Baquero

unread,
Sep 1, 2018, 5:12:25 PM9/1/18
to Packer
I tested Ansible to copy the files and execute the build remotely in the bare metal host and worked fine, but I think this may be a good feature so you can add Packer to some CI system with QEMU without the need of extra tools or execute it on a dedicated bare metal machine. I will describe more in detail this need and maybe it could be considered as a new feature.

Thanks for you kind response,

Miguel B.
Reply all
Reply to author
Forward
0 new messages