7.8. Building a Discovery Image
The Discovery image is a minimal operating system that is PXE-booted on hosts to acquire initial hardware information and to check in with Satellite. Discovered hosts keep running the Discovery image until they are rebooted into Anaconda, which then initiates the provisioning process.
The operating system image is based on Red Hat Enterprise Linux 7.
The foreman-discovery-image package contains this image. You must install the package on the Capsule that provides TFTP services.
Use this procedure to build a Satellite discovery image or rebuild an image if you change configuration files.
Do not use this procedure on your production Satellite or Capsule. Use either a dedicated environment or copy the synchronized repositories and a kickstart file to a separate server.
Prerequisites
Install the
livecd-toolspackage:satellite-maintain packages install livecd-tools
# satellite-maintain packages install livecd-toolsCopy to Clipboard Copied! Toggle word wrap Toggle overflow For the following Red Hat Enterprise Linux 7 repositories required to build the Discovery image, change the download policy to Immediate. This is required because Satellite downloads all packages only during synchronization of repositories with the immediate download policy.
- The latest Red Hat Enterprise Linux 7 Server (Kickstart) repository. For example, Red Hat Enterprise Linux 7 Server Kickstart x86_64 7.7.
- Red Hat Satellite Capsule 6.8 for RHEL 7 Server RPMs x86_64.
For more information about changing download policies, see Changing the Download Policy for a Repository in the Content Management Guide.
Synchronize the following Red Hat Enterprise Linux 7 repositories required to build the Discovery image:
- The latest Red Hat Enterprise Linux 7 Server (Kickstart) repository. For example, Red Hat Enterprise Linux 7 Server Kickstart x86_64 7.7.
- Red Hat Satellite Capsule 6.8 for RHEL 7 Server RPMs x86_64.
For more information about synchronizing repositories, see Synchronizing Red Hat Repositories in the Content Management Guide.
Procedure
To build the Satellite discovery image, complete the following steps:
Open the
/usr/share/foreman-discovery-image/foreman-discovery-image.ksfile for editing:vim /usr/share/foreman-discovery-image/foreman-discovery-image.ks
# vim /usr/share/foreman-discovery-image/foreman-discovery-image.ksCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the
repolines in the kickstart file with the repository URLs:repo --name=rhel --baseurl=file:///var/lib/pulp/published/yum/https/repos/Default_Organization/Library/content/dist/rhel/server/7/7.7/x86_64 repo --name=sat --baseurl=file:///var/lib/pulp/published/yum/https/repos/Default_Organization/Library/content/dist/rhel/server/7/7Server/x86_64/sat-capsule/6.8/os
repo --name=rhel --baseurl=file:///var/lib/pulp/published/yum/https/repos/Default_Organization/Library/content/dist/rhel/server/7/7.7/x86_64 repo --name=sat --baseurl=file:///var/lib/pulp/published/yum/https/repos/Default_Organization/Library/content/dist/rhel/server/7/7Server/x86_64/sat-capsule/6.8/osCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
livecd-creatortool:Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you change
fdiin the--fslabeloption, you must also change the root label on the kernel command line when loading the image.fdior the alternative name is appended to the.isofile that is created as part of this procedure. The PXE Discovery tool uses this name when converting from.isoto PXE.Use
/var/tmpbecause this process requires close to 3GB of space and/tmpmight have problems if the system is low on swap space.Verify that your
fdi.isofile is created:ls *.iso -h
# ls *.iso -hCopy to Clipboard Copied! Toggle word wrap Toggle overflow
When you create the .iso file, you can boot the .iso file over a network or locally. Complete one of the following procedures.
To boot the iso file over a network:
To extract the initial ramdisk and kernel files from the
.isofile over a network, enter the following command:discovery-iso-to-pxe fdi.iso
# discovery-iso-to-pxe fdi.isoCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a directory to store your boot files:
mkdir /var/lib/tftpboot/boot/myimage
# mkdir /var/lib/tftpboot/boot/myimageCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Copy the
initrd0.imgandvmlinuz0files to your new directory. -
Edit the
KERNELandAPPENDentries in the/var/lib/tftpboot/pxelinux.cfgfile to add the information about your own initial ramdisk and kernel files.
To boot the iso file locally:
If you want to create a hybrid .iso file for booting locally, complete the following steps:
To convert the
.isofile to an.isohybrid file for PXE provisioning, enter the following command:isohybrid --partok fdi.iso
# isohybrid --partok fdi.isoCopy to Clipboard Copied! Toggle word wrap Toggle overflow If you have
grub2packages installed, you can also use the following command to install agrub2bootloader:isohybrid --partok --uefi fdi.iso
# isohybrid --partok --uefi fdi.isoCopy to Clipboard Copied! Toggle word wrap Toggle overflow To add
md5checksum to the.isofile so it can pass installation media validation tests in Satellite, enter the following command:implantisomd5 fdi.iso
# implantisomd5 fdi.isoCopy to Clipboard Copied! Toggle word wrap Toggle overflow