Updating the kernel in an image
A new kernel in an image is two changes, not one: the package inside the image, and Luna's
record of which kernel the image boots. The second is the one that gets missed. Luna packs the
kernel and initramfs it is told about, so an image whose kernelversion still names the old
kernel boots the old kernel, however many times the new one is installed.
1. Work on a copy
# luna osimage clone compute compute-new
The original stays a bootable rollback; the group is moved to the clone at the end.
2. Install the kernel
Enter the image and install the kernel the way the distribution does it:
# lchroot compute-new
chroot [root@compute-new /]$ dnf -y update kernel # EL
chroot [root@compute-new /]$ apt-get install linux-image-generic # Ubuntu
chroot [root@compute-new /]$ ls /lib/modules
5.14.0-503.14.1.el9_5.x86_64 5.14.0-570.12.1.el9_6.x86_64
chroot [root@compute-new /]$ exit
/lib/modules inside the image lists every kernel installed; the new one is the version
Luna has to be told about.
3. Tell Luna, and pack
# luna osimage kernel -ver 5.14.0-570.12.1.el9_6.x86_64 compute-new
sets the kernel version and packs the image in one go (-b sets it without packing). The
same in two steps:
# luna osimage change --kernelversion 5.14.0-570.12.1.el9_6.x86_64 compute-new
# luna osimage pack compute-new
The pack builds the initramfs for that kernel with the image's kernelmodules — the
drivers dracut (or initramfs-tools on Ubuntu) includes beyond what it detects. A new kernel
needs the same drivers as the old one, so leave the list as it is unless the hardware changed.
4. Check what Luna will boot
# luna osimage show compute-new
kernelversion, kernelfile and initrdfile must all name the new kernel. A pack that could
not find the kernel it was told about fails with a message naming the version; a typo in
--kernelversion is the usual cause.
5. Move the nodes
# luna group change --osimage compute-new compute
then reboot the nodes. A node with its own --osimage set keeps it until that is changed
too — see changing the image for a group or node.