Deploy a disk image on bare-metal

disk-imageforeman

I try to understand Foreman and other deployment/provisioning systems, and how to use them best. Granted, installing the OS with some kind of prepared answers and scripts – Kickstart, AutoYAST etc. – is the best way for the majority of cases.

But when you want to deploy the same system to bare metal and to the cloud, you're back to images for the cloud part (optimally, constructed through a script, so you have the advantages of treating image construction as code). Now consider that your bare metal is all of the same type; would it not make sense to deploy the cloud image to bare metal, too?

Having some kind of PXE system that pulls the disk image from some place, runs some scripts similar to cloud-init, and reboots? Such a system could even be useful for other provisioning systems. Yet I do not find any of the sort, not even discussions about it, which indicates to me that I am on the wrong path. The FOG project or DRBL might be candidates, but no one seems to write about using them with Foreman?

Best Answer

You should make a distinction between provisioning software like FOG which works deploying a previously captured HDD image, or Foreman which deploys regular install images adding some already made generic automation scripts. Both systems are not meant to work together; they pursue different objectives.

Depending on your needs it could be not possible to have a single setup able to provision cloud an bare metal simultaneously then you must have 2 "assets" even when them are surely made out of the same install distro ISO but configured differently.

FOG is good when you want to replicate an already deployed HDD image to exactly the same hardware. Foreman adds to the classic PXE provisioning equation the pre-made scripts but at the end you are just writing/customizing a kickstart/preseed script. Way more complicated if you try to install automated Windows instead of Linux.

You can also use Serva (Automated PXE Server Solution Accelerator) it allows you to offer for network deployment as many assets as you want which are based on distribution ISOs. you can write as you wish your automated scripts for Windows and Linux assets. Serva includes all the required server components (DHCP/proxyDHCP/TFTP/HTTP/RIS/WDS) in a single exe. (I'm related to Serva development)