Updating the Kernel in an Image#
Compute nodes that boot over the network download their kernel and initramfs at boot time from their parent head node (the first head node to respond to their DHCP request). The required kernel, initramfs, command line, and a reference to an image are combined within a ICE ClusterWare™ boot configuration that can be assigned to the nodes.
To update kernels or other packages within an image, named Prod202404
in
this example, run either:
scyld-modimg -i Prod202404 --chroot --overwrite --upload
Or
scyld-modimg -i Prod202404 --update --overwrite --upload
The first is interactive and requires running the dnf
or yum
update
commands inside the chroot, whereas the second attempts the updates, but may
suppress some of the errors. If the kernel inside the image is updated,
then the boot configuration also needs to be updated. Assuming the newly
installed kernel’s version is 5.14.0-362.24.1.el9_3.x86_64
and the boot configuration is called ProdBoot202404
, use the
scyld-mkramfs
command to update the boot configuration:
scyld-mkramfs --kver 5.14.0-362.24.1.el9_3.x86_64 --update ProdBoot202404
Note
This new ClusterWare initramfs file is not the same as a
similarly named "initramfs" file in the head node /boot/
directory, which
is associated with a kernel in the /boot/
directory.
This ClusterWare initramfs file is associated with a specific image and
boot config and it contains custom ClusterWare scripts that execute at
boot time.
Without the --kver <KVER>
options, the tool attempts to select the most
recent kernel based on version directories found in /lib/modules
within the image, so explicitly selecting the version is not required. This
command examines the boot configuration, extracts the kernel from the image,
uses dracut within the image to build a new initramfs, extracts that as well,
and then uploads both into the boot configuration.
Alternatively, you may want to add a new boot configuration. For example, you
may want to boot different kernels within the image, or you chose to upgrade a
cloned copy of the original image. In this case, the scyld-add-boot-config
ommand can be used:
scyld-add-boot-config --image Prod202404Cloned –boot-config ProdBoot202404New
This command uses scyld-mkramfs
internally to extract the kernel and
generate the initramfs, then uses those files to construct the new
boot configuration with a default command line and a reference to the named
image, Prod202404Cloned
in this example.
Check the release field of the boot configuration after it is created to
see the kernel version. Any nodes assigned to use this boot configuration will
boot using that kernel. If a node is then booted and does
not use the correct kernel, confirm that the node’s _boot_config
attribute
references the correct boot configuration.