building for multiple platforms

20 views
Skip to first unread message

Vamfoom

unread,
Feb 22, 2019, 4:56:19 PM2/22/19
to Packer
According to Packer's documentation, it's capable of "creating identical machine images for multiple platforms from a single source configuration."  Does it have the capability to use the same source image (such as qcow2) to create images for different platforms (AWS, vmware, kvm, etc)?  I haven't been able to find an example of this can be accomplished.  Or does that statement simply means that same template file can be used to create for various platforms but the source image has to be already available for that platform?  

Rickard von Essen

unread,
Feb 23, 2019, 11:47:35 AM2/23/19
to packe...@googlegroups.com
I has the capability to build on one builder and import to other with post-processors (or shell-local), but you need to check that the ones you are interested are supported. But this is an advanced use case, and it's usually better to use one builder per target environment. See my answer here:

On Fri, Feb 22, 2019 at 10:56 PM Vamfoom <fong...@gmail.com> wrote:
According to Packer's documentation, it's capable of "creating identical machine images for multiple platforms from a single source configuration."  Does it have the capability to use the same source image (such as qcow2) to create images for different platforms (AWS, vmware, kvm, etc)?  I haven't been able to find an example of this can be accomplished.  Or does that statement simply means that same template file can be used to create for various platforms but the source image has to be already available for that platform?  

--
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/e33d9106-448e-4638-8ef9-f3f48ec0fb37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Justin DynamicD

unread,
Feb 25, 2019, 6:26:42 PM2/25/19
to Packer
Not strictly.

Think of packer like more of a task sequence.  It uses "builders" to handle all target specific work (spinup an AWS EC2 or Azure VM) then runs through the "provisioners" universally across them.  They aren't identical in the traditional sense where you expect a byte for byte copy, instead it runs identical tasks across the unique instances to end up wit ha common configuration.

Most people work from marketplace images, which pretty much always include agents specific to the cloud provider, so the resulting images are typically _not_ identical.  You could use a Vmware builder and a QEMU builder, point both at an ISO file and run the same steps and end up with something "pretty much identical" ... but it's _not_ doing some mystical "build one server then convert and copy it to multiple targets" trick ... partially because AWS has made that ridiculously difficult.
Reply all
Reply to author
Forward
0 new messages