Appendix: Creating Arbitrary RHEL ImagesΒΆ

The Appendix: Creating Arbitrary CentOS Images describes how to create and update PXEboot images using arbitrary CentOS repos. This appendix describes how to create arbitrary PXEboot RHEL images and register (or re-register) them to Red Hat. The repo is most commonly built from an ISO file that represents a specific RHEL major.minor version.

For this example we build a RHEL 7.8 image and boot config using the rhel-computenode-7.8-x86_64-dvd.iso ISO file.

You can use scyld-clusterctl repos and scyld-clusterctl distros to create a repo and distro for this RHEL version 7.8, then use scyld-modimg to create an image and a boot config.

Or more simply you can use scyld-add-boot-config to perform the same result in fewer steps. Execute the following and accept all the defaults:

scyld-add-boot-config --iso /mnt/isos/rhel-computenode-7.8-x86_64-dvd.iso

This creates a distro and repo both named rhel-server-7.8-x86_64, and an image and boot config both named rhel-server-7.8-x86_64.

Alternatively, you can avoid the manual acceptance of the defaults by specifying desired names and running the command in batch mode:

scyld-add-boot-config --iso=/mnt/isos/rhel-server-7.8-x86_64-dvd.iso \
                      --image RHEL-7.8-Image --boot-config RHEL-7.8-Boot --batch

View the result, which shows the default repo and the new repo, and the default boot config and the new boot config:

[admin@head]$ scyld-clusterctl distros ls -l
Distros
  CentOS
    name: CentOS
    packaging: rpm
    release: 7
    repos
      CentOS_base

  rhel-server-7.8-x86_64
    name: rhel-server-7.8-x86_64
    packaging: rpm
    release: none
    repos
      rhel-server-7.8-x86_64

[admin@head]$ scyld-bootctl ls -l
Boot Configurations
  DefaultBoot
    cmdline: enforcing=0
    image: DefaultImage
    initramfs
      chksum: a623be752272166f47896d648689789359239ebf
      filename: b51e6d31a84a4f069c6a4a484b5b5264
      mtime: 2022-03-18 19:20:19 UTC (0:37:22 ago)
      size: 33.4 MiB (35046202 bytes)
    kernel
      chksum: 2b0b0737e80596021ef71da44dbac6b335fcf0e3
      filename: db392537a1f6445d8c821d9a89ea5d8c
      mtime: 2022-03-18 19:20:19 UTC (0:37:22 ago)
      size: 6.5 MiB (6777448 bytes)
    last_modified: 2022-03-18 19:20:19 UTC (0:37:22 ago)
    name: DefaultBoot
    release: 3.10.0-1160.59.1.el7.x86_64

  RHEL-7.8-Boot
    cmdline: enforcing=0
    image: RHEL-7.8-Image
    initramfs
      chksum: 0d824541ab9bc9452dbec07e8486f443472327f9
      filename: 905309b474f54c629ac8befd76150f8b
      mtime: 2022-03-18 19:43:39 UTC (0:14:02 ago)
      size: 33.4 MiB (35046065 bytes)
    kernel
      chksum: b5d0b67026d6ae5829d929dcd7b6ba52619de7fb
      filename: 222a7267c85849979a8908bdc72277b1
      mtime: 2022-03-18 19:43:39 UTC (0:14:02 ago)
      size: 6.4 MiB (6762800 bytes)
    last_modified: 2022-03-18 19:43:39 UTC (0:14:02 ago)
    name: RHEL-7.8-Boot
    release: 3.10.0-1127.el7.x86_64

Important

If the cluster administrator wants to enable FIPS, then follow the directions provided by the base distribution provider. The Red Hat RHEL or CentOS repo must include @core, and any subsequently created compute node image must contain several additional packages, including dracut-fips. Verify the presence of @core by successfully executing yum groupinfo core.

To boot the new image, assign RHEL-7.8-Boot to node n0, and reboot n0:

[admin@head]$ scyld-nodectl -i n0 set _boot_config=RHEL-7.8-Boot
Results
  n0
    success: True

[admin@head]$ scyld-nodectl -i n0 reboot
Nodes
  n0: Soft reboot succeeded

A RHEL compute node can automatically register (or re-register) with Red Hat at boot time by adding the file /etc/clusterware/rhel-vars.sh to the image. That file must contain two lines that define values for the variables "RHEL_USER" and "RHEL_PASS". The booting RHEL node executes /opt/scyld/clusterware-node/scripts-available/up/register_rhel.sh (distributed in the clusterware-node package) which opens /etc/clusterware/rhel-vars.sh (if that exists) and parses the "RHEL_USER=" username and "RHEL_PASS=" password, then executes:

subscription-manager register --username <username> --password <password>

On a successful first-time registration, the node transmits the resulting consumerid to its parent head node, which in turn stores that value into the node's _rhel_consumerid attribute in the ClusterWare database.

If a specific Pool ID is required, then add the attribute _rhel_poolid.

Important

If the RHEL image thus built is subsequently updated using yum update, then by default that updates packages to the latest minor release level, not to newer versions at the image's current minor release level. Also, yum install of additional packages may update dependency packages from their current minor release version level to the latest minor level. Such actions may result in a mixture of packages from different minor releases, which may have unintended consequences.