Running a Packer build using both an existing image and an ISO

1,615 views
Skip to first unread message

Julio Lajara

unread,
Apr 19, 2018, 4:56:02 PM4/19/18
to Packer
Hi all, is it possible to run a Packer build with both an existing base image disk (qcow2) and an ISO? It seems from reading the builder documentation, most of them only support one or the other but not both.

My use case is that I want to do a two phase Packer build. On the first phase, build out my disk image and generate a qcow2 disk image. On the second phase, use the disk from the first phase, a Clonezilla ISO to boot from, and the qemu args to mount a folder into the guest and get Clonezilla to generate backup.

Basically I need to get from qcow2 to Clonezilla format to distribute elsewhere. I had thought about using a post-process on the first phase (if I used raw instead of qcow2) to then mount loop backs to the individual partitions and dump them using the same tools that Clonezilla does but its not clear which files Clonezilla creates that it actually needs during a restore and which are just informational metadata.

Any thoughts or alternatives would be appreciated.

Thanks,

Rickard von Essen

unread,
Apr 20, 2018, 2:30:19 AM4/20/18
to packe...@googlegroups.com
It might be possible to attach the ISO as a device with qemuargs 1) similar things whould be possible with most other local builders. Another option is to just use the file provisioner and upload the iso to the VM and loopback mount 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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/e13f79fa-dfe8-4de0-97c2-ed11ce6eb301%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Julio Lajara

unread,
Apr 20, 2018, 10:32:54 AM4/20/18
to Packer
Hi Rickard, yes that was my initial thought, I just havent tried it to see if it works so wanted to see if anyone had actually tried it before. The loopback method would work in other cases but not for mine, as I was hoping the ISO would take boot precedence over the disk as I need it to boot to the Clonezilla ISO so I can image the disk.

Ill give the qemuargs a go and see how it comes out.

Thanks,


On Friday, April 20, 2018 at 2:30:19 AM UTC-4, Rickard von Essen wrote:
It might be possible to attach the ISO as a device with qemuargs 1) similar things whould be possible with most other local builders. Another option is to just use the file provisioner and upload the iso to the VM and loopback mount it.

On 19 April 2018 at 22:56, Julio Lajara <ju...@tvisioninsights.com> wrote:
Hi all, is it possible to run a Packer build with both an existing base image disk (qcow2) and an ISO? It seems from reading the builder documentation, most of them only support one or the other but not both.

My use case is that I want to do a two phase Packer build. On the first phase, build out my disk image and generate a qcow2 disk image. On the second phase, use the disk from the first phase, a Clonezilla ISO to boot from, and the qemu args to mount a folder into the guest and get Clonezilla to generate backup.

Basically I need to get from qcow2 to Clonezilla format to distribute elsewhere. I had thought about using a post-process on the first phase (if I used raw instead of qcow2) to then mount loop backs to the individual partitions and dump them using the same tools that Clonezilla does but its not clear which files Clonezilla creates that it actually needs during a restore and which are just informational metadata.

Any thoughts or alternatives would be appreciated.

Thanks,

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

Gabo Kete

unread,
Apr 20, 2018, 4:59:34 PM4/20/18
to Packer
HI Julio

The way I see what you are after, is you might want to end up having a wrap up script to pass as an argument what sort of method you want to use, and create your JSON file dynamically based on the arguments passed to the script

I've done something similar for some of my projects, although I haven't used QEMU, however the Hashicorp documentation is pretty good.. 

Let us know how it goes..

Cheers
Reply all
Reply to author
Forward
0 new messages