Error while building an image

We are trying to create an ISO image using the repository. For the testing purpose, we are using the centos mirror “CentOS Mirror” and added it to the repository for a build.

We have configured the smart proxy with DHCP, TFTP in the foreman with katello. while configuring the host with the same name, we are getting an error of “has already taken”.
We have created a new hostname and configured it with a smart proxy. When initiating the build process, we are getting the “Unable to set DHCP entry” and “Failed to perform a rollback on Remove DHCP Settings” error.

We figured out that the proxy is already running in another DHCP connection which is created along with the installation of foreman with katello in the server. We have also check all the host list details in the foreman and we couldn’t find any running proxy on the server.

How do we rectify this error to initiate the build process…?

DHCP conflict happens when there is already a record with different name sharing either the same IP or the MAC address. What you want to do is stop the ISC DHCP, open up dhcpd.leases file and fix things. Then start it up.

We have a script to do that:

foreman-rake orchestration:dhcp:remove_offending
foreman-rake orchestration:dhcp:add_missing

Take care when running these, if you have some records which are not managed by Foreman on this DHCP server you might delete them. For the reason by default it is a dry run, add perform=1 argument to actually do the changes.

If things go wrong and there is an error in Foreman, a record can end up in DHCP. Once you have a working instance without errors you should not need to fix those.

3 Likes

If you want to just create installation ISO, let me introduce you Image Builder, a new application available in RHEL 8 that can do just that. Upstream projects are: lorax, lorax-composer. It is integrated into Cockpit as well:

https://weldr.io/lorax/f28-branch/intro.html

Lorax can create you an ISO image with an image which is then deployed by Anaconda. Or you can PXE boot your host and use foreman liveimg host parameter to point to a tar image with installed system. This is what we will be likely integrating Foreman with pretty soon more deeply.

Alternatively, take a look on virt-builder, an awesome command available in RHEL 7+ which can build you images super quickly and reliably. This one only creates images for VMs which you can deploy on bare metal too.

3 Likes

A community member wrote up an end to end tutorial for that here too:

3 Likes