Install disk image onto bare metal

Hi,

I got VMware image deployment working as described VMware userdata cloud-init no network for RHEL 8

I’d like to do a similar thing on bare metal. I saw some discussion of developing the Foreman Discovery Image to allow discovered machines to be able to pull an ISO and write it to disk.

Is anyone doing this at the moment and if so what is the workflow.

Cheers

Trent

There is somebody doing that, I can’t remember the name tho. However Anaconda from version 7.5+ can write images instead of RPM installation too. Advantage is that the process is the same, hardware supported or certificated too, this is going to be image based provisioning we want to support going forward.

Foreman ships with support for this for several versions, look for kickstart_liveimg parameter in templates. URL must point to a tarball with root filesystem or image that can be loopmounted. Anaconda then copies all files over to the target partition and creates /dev, /sys etc.

Thanks for the point in the right direction. That should do the trick.

Cheers.

Get back to us with experience, maybe templates need some tuning. This was primarily written and tested for RHV (oVirt Node Hypervisor) provisioning, but RHEL (CentOS) should work too. Ask RH for supportability of these installs, I think as long as RPM database verifies whole system it should be fine.

1 Like

So if I want to work with an ISO I’d still need an accessible kernel and ram disk available to the foreman so I can get to the stage where anaconda copies the image specifed in the kickstart_liveimg parameter?

Answered my own question. Yes.

Even though I’m building RHEL machines I can just point Install Media at a CentOS mirror and then once it reaches anaconda it pulls the ISO.

One to my next error now :slight_smile:

Although Anaconda should be able to mountloop an ISO file, I suggest to create tarball images or img files instead.

To easily create CentOS/RHEL images, use lorax (Red Hat Image Builder).

Thanks for the tip.

So I made the tar with Lorax. Install works. Kickstart runs, registers red hat installs puppet sends success to foreman. When the machine reboots it fails to boot saying it can’t find a known EFI file.

I’ve had successful installs both to bare metal and VM with both bios and EFI before so this is a new one for me.

Does it matter if the machine that I build the image on is BIOS of UEFI? Any tips here would be greatly appreciated.

What’s the error exactly? Can you screenshot or shoot it?

When you configure to boot from HDD does it work?

Anaconda should have configured partitioning according to BIOS or EFI depending on the environment. Its just our EFI -> network -> chainload from HDD is clunky and we have experienced some issues with this already.

I built an EFI machine and rebuilt the tar image and had the same problem.

I am testing this procedure on a EFI VMware VM. I don’t think that should be an issue but thought I should give all the info.

No

Here are some more screen shots that are hopefully helpful.



And one last one showing things in GRUB

Have you created the image for EFI?

https://weldr.io/lorax/livemedia-creator.html#creating-uefi-disk-images-with-virt

Thanks. This helped. I got a tip further :slight_smile:

Now grub show the normal kernel options but once it starts to boot into that it drops into a dracut emergency console.

The bit I’m fuzzy on is the partitioning. So with the live image install via anaconda it copies the live image before it gets to the partitioning section of the kickstart.

My feeling is that I don’t have the following section write which is using The Foreman Kickstart defaults

bootloader --location=mbr --append=“nofb quiet splash=quiet”

zerombr
clearpart --all --initlabel
autopart

Thanks again for your help.

Also haven’t found mush documentation online about using the liveimg install option in kickstart.

Yeah I was confused as well. The image is mounted if that’s a mountable image, or this step is skipped if you provide a (compressed) tarball. Then it copy/extract all files onto the destination volume using standard tools like cp, tar, cpio etc.

We are not talking about bit-to-bit “virtualization” image, we are talking about OS installation “copy”. If this were enterprise boxed software, this would be called something like “Smart Imaging ™”