Repos and Distros#

One of the steps in the scyld-install script is to run the scyld-clusterctl tool to define a distro prior to creating the first image. The scyld-modimg tool only creates images based on defined distros. A distro associates one or more repos together with their package manager and an optional release string. If no release string is provided, then any supplied URL should not include the string "$releasever", as that variable is not be defined during image creation. On a Rocky or RHEL system, the default repo and distro are created by:

scyld-clusterctl repos create name=Rocky_base \
        urls=http://dl.rockylinux.org/pub/rocky/$releasever/BaseOS/$basearch/os/
scyld-clusterctl repos create name=Rocky_appstream \
        urls=http://dl.rockylinux.org/pub/rocky/$releasever/AppStream/$basearch/os/
scyld-clusterctl distros create name=Rocky packaging=rpm release=8 \
        repos=Rocky_appstream,Rocky_base

Together with the local /etc/yum.repos.d/clusterware.repo file, this information is used at image creation time to generate a /etc/yum.repos.d/clusterware-node.repo file for the image containing sections referring to both the head node's ICE ClusterWare™ repository and to the distro's repos.

You can create additional repos and distros to make node images based on different upstream sources. To do this, provide multiple comma-separated URLs to the scyld-clusterctl repos create command or multiple repos to the scyld-clusterctl distros create command. Distros can also be imported from an existing yum repo files. For example:

scyld-clusterctl distros import --name Rocky \
  /etc/yum.repos.d/Rocky-BaseOS.repo /etc/yum.repos.d/Rocky-AppStream.repo

The import action creates repos based on the contents of the provided yum repo file(s) and then associates all of them with a newly created Rocky9 distro. Any string passed to --release is saved into the distro release field and is used by yum to replace any occurrences of "$releasever" in the repo file.

See the the scyld-clusterctl repos and distros actions and the scyld-modimg command that is used to actually create and modify images.

Using ISO Releases#

Many distributions are distributed in ISO form. Use the scyld-clusterctl tool to create an image from an ISO. For example, for an ISO named Rocky-9.5-x86_64-dvd.iso, first create a repo:

scyld-clusterctl repos create name=rocky_9.5_iso \
                              iso=@/path/to/Rocky-9.5-x86_64-dvd.iso

Next, create a distro that references the new repo:

scyld-clusterctl distros create name=rocky_9.5_distro repos=rocky_9.5_iso

Finally, create an image using that repo and distro:

scyld-modimg --create rocky_9.5_distro --set-name rocky_9.5_image

When this image is booted, the ISO-based repo may not be accessible, and the /etc/yum.repos.d/clusterware-node.repo file needs to be modified to use a more permanent repo location.

Using Archived Releases#

Many distributions archive individual releases after they are superseded by a newer release, but for this discussion we will examine CentOS. The CentOS project provides packages and updates on their various mirror sites for the most recent release, but deprecates all previous point releases. This means that at the URL where a mirror would nominally keep the previous release, a readme file is provided explaining that the release has been deprecated and pointing users to the CentOS vault for packages. The packages located in the vault are unchanged from when they were "current". The CentOS project also deprecates the release that is two major releases back. For example, as of the release of version 7, version 5 was deprecated. In this way there are always two currently supported versions of CentOS, the latest and the most recent of the previous major release.

What this means for ClusterWare administrators is twofold:

  1. To create an image of an archived version of CentOS, create the correct repo and distro objects in the ClusterWare database.

  2. After creating an image from the vault, manually modify the yum repo files present in the image.

To create an image based on an archived version of CentOS (7.3 in this example), the steps are:

scyld-clusterctl repos create name=CentOS-vault \
                 urls=http://vault.centos.org/\$releasever/os/\$basearch/
scyld-clusterctl distros create name=CentOS_7.3 repos=CentOS-vault release=7.3.1611
scyld-modimg --create CentOS_7.3 --set-name CentOS_7.3_img

The first command creates a repo called CentOS-value pointing at the generic vault URL. The second command creates a distro that references the CentOS-vault repo and defining the release string. Once the distro exists, it can be referenced by name in the third command to actually create a new image.

Unfortunately, because the CentOS vault packages are identical to when they were the current release, the yum repo files located in the /etc/yum.repos.d/ directory contain references to mirror.centos.org instead of vault.centos.org. Manually modify these files after image creation and before running yum commands directly or through the scyld-modimg --install, --uninstall, --update, or --query. The above scyld-modimg --create command displays an error referring back to this documentation:

[admin@virthead]$ scyld-modimg --create CentOS_7.3 --set-name CentOS_7.3_img

Executing step: Create
 Preparing the chroot...
    ...done.
 Initializing the chroot...
  elapsed: 0:01:11.4
    ...initialized.
 Installing core packages...
  elapsed: 0:00:01.0
ERROR: One or more repositories in the newly created image are invalid. This
can happen when installing older versions of Linux distributions such as CentOS.
Please consult the Administrator's Guide for more information.
WARNING: The command will be retried with unknown repositories disabled.
  elapsed: 0:02:39.9
   fixing SELinux file labels...
  ...done.
step completed in 0:04:13.6

To manually modify the yum repo files, use the scyld-modimg --chroot command on an already created image as follows:

[admin@virthead]$ scyld-modimg -i CentOS_7.3_img --chroot
Checksumming image 6a8947156e08402ba2ad6e23a7642f4f
  elapsed: 0:00:01.0
Unpacking image 6a8947156e08402ba2ad6e23a7642f4f
  100.0% complete, elapsed: 0:00:29.6 (62.2% compression)
Checksumming...
  elapsed: 0:00:01.0
Executing step: Chroot
Dropping into a /bin/bash shell.  Exit when done.
[root@virthead /]# exit
exit
   fixing SELinux file labels...
(K)eep changes or (d)iscard? [kd]

When you exit the shell, the tool confirms that you want to keep the changes made and offers to upload the modified image to head node storage.

Installing Software With Subscriptions#

For distributions requiring subscriptions for access to updated packages, note that subscription information in an image is used by all nodes unless removed before upload:

hostname nodeTemplate
subscription-manager register --username=$RHUSER --password=$RHPASS
subscription-manager attach --pool=$POOL_ID
yum upgrade -y
yum install $REQUIRED_PACKAGE
subscription-manager remove --all
subscription-manager unregister
subscription-manager clean