Using packer to build images for physical servers

3,493 views
Skip to first unread message

Terry E

unread,
Dec 12, 2014, 4:06:42 PM12/12/14
to packe...@googlegroups.com
Hi all,

I have Packer building Ubuntu vagrant boxes and Vsphere templates and am looking to use Packer to also build an image for physical servers. 

Currently, I use PXEboot and preseed to install to physical servers and would like to toss it out and find a way to lay down an image created with Packer.

I could write a builder script to take the vagrant box image and place it into a  Clonezilla Live custom ISO, but I'm wondering if there is already some work done in this direction.

Thanks much,
-Terry

Alvaro Miranda Aguilera

unread,
Dec 12, 2014, 7:57:33 PM12/12/14
to packe...@googlegroups.com
Hello, there is no such thing like wrong approach, and exists many ways to install a new server, so go crazy and share what you do.

If you use virtualbox, you should be able to not install vbox additions, and then generate a .img with a dump of the filesystem.. like dd or dumpfs

then on the physical server, you could dd back or importfs, it should work.

Other way is look into mondo/mindi that is a backup solution, one of the cool features is that can backup to a nfs folder, generate an ISO, then you boot from that ISO and you do the restore. this also should work.

other way would be: If you are happy with a build from packer, you may look into building a custom iso installer..

packer take a boot iso, preseed, a scripts (shell, puppet, etc)

you can just have the logic into a custom build installer cd without packer at all.

if you udpate the scripts, just rebuild the iso and that ist.

if your physical hardware doesn't have remote console/remote cd/dvd, you can have a dvd-rw

if you server is hp/dell/ibm and allow remote media, you can automate the whole process by scripts, and build the the server remotely

if your scripts are in a source control, point the iso to consume those scripts over the network, like raw in github, and your iso never would be updated.


apache webserver can serve content based on the source mac-address, you can use this to have an script and provide a generic script, or a custom script for a specific server, so you can have the same url, but different builds, this make the whole build way more cooler.

If you are open to use puppet or any other Configuration Manager, your initial build can be just small, and the take it from there bases on server name/ hw mac, etc.

Alvaro.

--
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.
For more options, visit https://groups.google.com/d/optout.

Ethan S.

unread,
Jan 7, 2015, 7:17:47 PM1/7/15
to packe...@googlegroups.com
Terry, it sounds like you would want to build an ISO with a preseed file embedded, and then you can use vmware-iso and virtualbox-iso to build your VMs from that ISO, and append a new preseed file (they can chain) that will handle the virtualization tools and any additional configs a non-physical machine will need. This is essentially what we are doing, with the addition that we will be using the output of the -iso job to feed into another Packer job that simply performs system updates periodically to avoid having developers wait for an hour and a couple reboots for new system updates if they haven't used Vagrant before.

LMRZ

unread,
Feb 29, 2016, 7:41:43 AM2/29/16
to Packer
Hi Ethan,

so what you're saying is that you actually lay a thin virtualization (hypervisor) before you run the ISO?
I think I'm missing what a preseed is.

Grateful for an expansion on the above

thank you

pixel fairy

unread,
Mar 7, 2016, 8:33:28 PM3/7/16
to Packer
cobbler makes custom iso images. but thats a lot of work is thats all your using it for. i wrote this to install servers at work that cant be pxe booted (our switches are not fancy enough to pxe boot of lacp) and this post finally nudged me to share it.

https://gitlab.com/pixelfairy/isolazy
Reply all
Reply to author
Forward
0 new messages