multiple platforms

24 views
Skip to first unread message

Vamfoom

unread,
Sep 25, 2018, 5:24:54 PM9/25/18
to Packer
I'm new to packer.  According to the documentation, packer is capable of creating identical images for multiple platforms but all the examples I saw targets specific platform.  How would I go about using the same "recipe" for creating a qemu and esx image?  If someone has an example, it would be very useful.

lucas.adam.jackson

unread,
Sep 25, 2018, 5:36:21 PM9/25/18
to packe...@googlegroups.com
I've done this with esxi and hyper-v within the same packer build file. You just need to use separate builders, but your subsequent work is the same (provisioners etc).

In the provisioners sections it allows you to also specify that certain steps should only be applied to certain build names. For example we only want VMware tools installed on the esxi image, but the rest may remain the same.

I am not at my terminal right now but may be able to provide an example once I am if you still require it.



Luke


Sent from my Samsung Galaxy smartphone.
--
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/a338f679-a366-4643-a074-65ccc9430638%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alvaro Miranda Aguilera

unread,
Sep 25, 2018, 5:50:07 PM9/25/18
to packe...@googlegroups.com
hello

the idea is packer uses a json file and you can add remove components.

you can have a provisioning script, where packer will run the same script to a qemu and esx, and then the 2 created VMs were provision for the same script.

The identical part is not to be taken as one VM will be built and then copied to the other builders.

here a virtualbox and vmware example.


not what you are after, but should help to get an idea.

Message has been deleted

StatsfX

unread,
Sep 25, 2018, 5:52:34 PM9/25/18
to Packer
Here's a shell template for you, let me know if that's what you're looking for... hopefully :)

{
  "variables": {
    ...
  },
  "builders": [
  {
    "type": "hyperv-iso",
    "name": "tmpl-hyperv",
    ...
  },
  {
    "type": "vmware-iso",
    "name": "tmpl-vmware",
...
  }],
  "provisioners": [{
    "type": "powershell",
    "only": ["tmpl-vmware"],
    "elevated_user": "user",
    "elevated_password": "password",
    "scripts": [
      ....
    ]},
  {
    "type": "powershell",
    "elevated_user": "user",
    "elevated_password": "password",
    "scripts": [
      ...
    ]
  }]
}

On Tuesday, September 25, 2018 at 5:36:21 PM UTC-4, StatsfX wrote:
I've done this with esxi and hyper-v within the same packer build file. You just need to use separate builders, but your subsequent work is the same (provisioners etc).

In the provisioners sections it allows you to also specify that certain steps should only be applied to certain build names. For example we only want VMware tools installed on the esxi image, but the rest may remain the same.

I am not at my terminal right now but may be able to provide an example once I am if you still require it.



Luke


Sent from my Samsung Galaxy smartphone.

-------- Original message --------
From: Vamfoom <fong...@gmail.com>
Date: 2018-09-25 5:24 PM (GMT-05:00)
Subject: [packer] multiple platforms

I'm new to packer.  According to the documentation, packer is capable of creating identical images for multiple platforms but all the examples I saw targets specific platform.  How would I go about using the same "recipe" for creating a qemu and esx image?  If someone has an example, it would be very useful.

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

Ibrahim Buamod

unread,
Sep 25, 2018, 5:53:30 PM9/25/18
to packe...@googlegroups.com
There is different modules .. there is a VMware , VirtualBox and EC2 modules for example 


 So you need to specify the module you are targeting 

On Tue, Sep 25, 2018, 5:24 PM Vamfoom, <fong...@gmail.com> wrote:
I'm new to packer.  According to the documentation, packer is capable of creating identical images for multiple platforms but all the examples I saw targets specific platform.  How would I go about using the same "recipe" for creating a qemu and esx image?  If someone has an example, it would be very useful.

--
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.
Reply all
Reply to author
Forward
0 new messages