Custom ISO install using Foreman PXE Boot

Problem: I am using a Custom ISO which already have Partitions installed. So I don’t need to use template to partition my disk. How to do it.

Expected outcome: I need to install Custom OS without any template . How can I do it using Foreman.

Foreman and Proxy versions: Foreman 1.23

Foreman and Proxy plugin versions:

Other relevant data:
[e.g. logs from Foreman and/or the Proxy, modified templates, commands issued, etc]
(for logs, surround with three back-ticks to get proper formatting, e.g.)

logs

Custom ISO? What ISO? What’s that? ISO with partition installed does not seem right to me. Elaborate.

An you know the ISO is the archive format for the data contents of an optical disc. My ISO already has kickstart configuration file which has the instructions for partitions and all other stuff.

I want to automate installation with Foreman of that ISO for network and other configuration. So i does not require to use Partition template from foreman in my case. How would i do it using foreman.

or as i am new to Foreman so please guide me what process i need to follow.

To further elaborate i just want to boot my Client machine with ISO and my ISO will do all the stuff .

except network configuration which i will get from my working Foreman Server.

I don’t know what on Earth are you trying to do, sorry. But in general:

Foreman is a tool that helps you manage PXE, DHCP, DNS and generation of kickstart. You’ve done the kickstart and since you have an ISO you don’t need PXE as well.

There’s some frustrating behaviours and broken features of Foreman’s provisioning department and it’s a pain just how many of these official community.theforeman.org threads come up as top results for tinkering, troubleshooting or tweaking behaviour only to be shot down by a Foreman developer and left unanswered for years.

It’s obvious they were trying to use the Create Host dialog and wanted to specify an ISO they had already made which will take the guest install process from start to finish if booted. Either to be uploaded on demand or selected from a Datastore. This method could avoid relying on Foreman’s Kickstart templates, an existing VM Template on the hypervisor stack that Foreman would have to use otherwise, iPXE for netbooting from Foreman (When possible in a network) or worst case using an ISO generated by foreman_bootdisk, which in my experience entirely flops with any of the many default iPXE UEFI templates :man_facepalming: - accompanied with zero documentation out there to handle this intelligently and plenty of dead community.theforeman.org discussions with rude “Why didn’t you read this first” responses from developers to dead links. I guess iPXE EFI boot technology just isn’t there yet? Except this has been possible forever.


I’m in this top-result thread today which ends with yet another dead end developer response because my situation involves an inherited Foreman server and Linux guests managed by it all on a network with a Windows Deployment Server for PXE boots which is required, so cannot be replaced with Foreman’s TFTP information in DHCP responses.

I’ve spent many hours trying many great ideas to workaround the existing IPv4 WDS PXE machine to make Foreman to provision new EFI Linux VMs via its Kickstart options either via foreman_bootdisk or generating a custom iPXE.iso myself. (Again, foreman_bootdisk has been helpless. VM won’t even boot the ISO it generates in EFI mode, countless tweaks have not produced a working EFI ISO image from it, Even under Administer>Settings>Boot Disk the options are extremely limited for customising)

My latest attempt in getting Foreman to provision an EFI Linux guest from start to finish comply with building guests automatically was the custom ISO approach. It involved making the perfect custom UEFI iPXE.iso for chainloading via Foreman’s TFTP daemon with a baked-in ipxe script like chain /var/lib/tftpboot/${net0/mac:hexhyp}.ipxe. All that only to learn that Foreman can’t even specify a custom boot ISO or one already in the datastore on the Create Host screen :frowning_with_open_mouth: - at least in 3.3.1 which I unfortunately have to use for some older servers.

Every attempt to make Foreman provision EFI Linux guests on our hypervisor stack has been a hair ripping nightmare. I’m doing everything I can to avoid resorting to a stale VM Template on the hypervisor cluster, always failing when it comes down to making Foreman do what’s required (Or use its own ISO generators which upload then don’t work in the booted VM).

So many threads which could have good discussion and an answer or at least some hints or next steps that just die abruptly with a rude unhelpful remark instead. So frustrating I had to sign up and complain at this point as this has to be at least the 20th community.foreman.org thread I’ve run into that helps nobody.

Foreman is a Swiss knife, it is not easy to deploy or maintain. It is also a community project, we do our best to help. If you are having hard time figuring out things yourself, consider reaching out to professional support. There are several companies offering services for Foreman. They know the limitations of Foreman and you might be able to identify how to solve things in the very beginning.

You mention some “rude responses”, I would like to know what are these. I am not aware of any unfriendly behavior on this site. Please keep in mind that Foreman is now 14 years old or something like that. Dead links or incorrect information do exist, this is nothing special to Foreman as all bigger projects have problems like this. Also, provisioning was designed when there was no EFI, many EFI features were added on top of BIOS workflows and some features are clunky.

Now, to your problem. Foreman bootdisk can generate two types of bootdisks. One with SYSLINUX (BIOS) and Grub (EFI), these are known to work on EFI systems. This is called Full Host Bootdisk. The other types are iPXE based and we never got to implementing EFI support in there. This is unfortunately mentioned in the README table and I believe is not correct.

The VMWare integration is something I don’t have much experience with as this was contributed by the community. However, I know that some older versions of Foreman generate iPXE based images for VMWare and these will not work with EFI, while more recent versions do generate Full Host Disk which is supposed to work on EFI.

I guess iPXE EFI boot technology just isn’t there yet? Except this has been possible forever.

It is not that we did not try, but neither EFI nor iPXE does support passing command line options when booting from removable media. Therefore, there is no way to pass any user-generated iPXE script and the only way is to embed the data into iPXE EFI binary. Calling C compiler from Foreman at runtime was something that I did no like at the time (2019 perhaps). Maybe it is possible now, contributions are welcome!

Yeah I understand. A lot of my frustration working with Foreman (At least this time around, on an older now unsupported version being kept alive for legacy support purposes) has been hitting threads even older than this 2020s release with either no answer or a dismissive answer on top of being 2, 3 or 5 years old but… the only relevant result for any given complicated scenario.

In the end I solved my Foreman custom ISO issue by generating an ipxe argument file and baking it into an ipxe.iso as you’ve described for a solution here. Then using Terraform to upload to that to my hypervisor platform of choice and booting it there - allowing me to work around existing PXE-boot infrastructure at the time.

I dug quite far into this version of Foreman’s code and that of the foreman_bootdisk plugin (Which is a lot newer) at the time of writing and noticed its doing quite a lot on its own with tools such as mkisofs and other friendly iso tools of the cdrtools software pack. I don’t doubt it would be time consuming, but I think it would be feasible to add a per-host bootable option which could take the boot lines from /var/lib/tftpboot and shove them directly into an ipxe image to be uploaded for guest automated installation without needing to reply on the PXE section of the preparation process by baking what it would have read into the iso in the first place, pointing directly to Foreman.

I settled on that goal for a short while but ultimately moved on in favor of a wrapper script that could dynamically build an EFI ipxe.iso which pointed to a webserver with a distro’s installer ISO mounted all while specifying a kickstart file available over http with ks= right in the same ipxe.iso too. I guess I don’t have the time or resources to continue looking into that possibility for foreman_bootdisk, but I’m letting you know that it’s probably possible and in my own scripting, wasn’t as bad as I thought going into it.

It is not that we did not try, but neither EFI nor iPXE does support passing command line options when booting from removable media

This is more or less how I experienced this feature too. An excessive amount of legacy and UEFI boot options then bootloader choices on top when creating a new host in the UI, but none of them actually worked for provisioning a new host without PXE. Combined with an inability for the platform to upload its own custom ISO despite there being some form of ISO boot option in the list of new-host installation methods, as if the integration never made it. With my experiences through custom ipxe.iso building with terraform to push and boot from it all together - I’m confident this feature would be possible for Foreman to skip the PXE step and just bake the ipxe arguments directly into a temporary ISO and upload it - referencing the content in /var/lib/tftpboot all the same.