Comment 1 for bug 1915573

Revision history for this message
Sean Feole (sfeole) wrote :

Thanks Lee, the description is correct. This issue can be easily reproduced by installing the MAAS Centos8 image provided in the latest streams to any piece of hardware that has a fancy disk , such as nvme or perhaps even a raid. You will find that the OS will hang shortly after mounting and booting from /sysroot.

There will be no errors/warnings etc.

The workaround was to install centos8 on the same hardware using the centos installer, copy the kernel modules to the mass installed disk image and regenerate the initram fs.

To reproduce this:
-- Deploy the maas centos8 image to a disk.
-- Upon boot the operating system will hang after mounting /sysroot with no apparent warnings or errors.

-- Upon restarting boot into single user mode ( append , `rd.break` kernel param upon booting.)
-- Remount sysroot rw, $mount -o remount,rw /sysroot
-- observe there are no logs or warnings anyhere on the disk. Most of the kernel modules installed are a minimal set, usually found in qemu. You will not have a wide variety of /lib/modules/kernel-<version>/net/*.ko drivers or drivers/platform/*.ko, usr/*.ko, etc.....

To fix this.

-- Install centos8 using there manual installer or netboot it via a mirror.
-- Ensure you install it to a NEW disk partition, do not erase the maas deployed image.
after the system comes up, copy the /lib/modules/<kernel> to /lib/modules on the maas deployed disk.

#mount the root disk
$mkdir /mnt/maasdisk
$mount </dev/device/partition> /mnt/maasdisk

#mount the efi partition
$mount </dev/device/parititon> /mnt/maasdisk/boot/efi/

#bind mount sys and dev
$mount --rbind /sys /mnt/maasdisk/sys
$mount --rbind /dev /mnt/maasdisk/dev
$mount -t proc /proc /mnt/maasdisk/proc

#for good measure ensure the kernels on the host machine and maas disk image are the same and copy the modules from the host machine to the maas disk image.
$mv /mnt/maasdisk/lib/modules/<kernel-modules> -> <kernel-modules.old>
$cp -R /lib/modules/* /mnt/maasdisk/lib/modules/

#chroot into maasdisk
$chroot /mnt/maasdisk

#rebuild initramfs
$dracut --regenerate-all --force

#verify the maas disk image now boots
Success!

-- copy the maas disk image /lib/modules and initrd to the custom maas image created via packer-maas.
$ tar -xvf maas.tar.img

# replace the initrd and /lib/modules with the ones used to repair maas disk image, tar the conents back and upload to maas.

$tar -Sczpf $OUTPUT --selinux -C <maas_img_dir> .
$ maas $PROFILE boot-resources create name='centos/8-custom' title='CentOS 8 Cus
tom' architecture='amd64/generic' filetype='tgz' content@=centos8.tar.gz