How to switch CentOS8 VM to use a SCSI or SATA Controller for the booting vHDD instead of a NVME?

Issues related to hardware problems
Post Reply
swinster
Posts: 4
Joined: 2019/10/20 16:34:05

How to switch CentOS8 VM to use a SCSI or SATA Controller for the booting vHDD instead of a NVME?

Post by swinster » 2023/07/22 15:22:12

Hi all,

We have a CentOS 8 Stream VM built in ESXi that uses a vHDD attached to a virtual NVME controller. Unfortunately, we need to transfer this VM to an environment where this controller is not supported, so we need to switch to a SATA or SCSI controller. When we install either of these controllers and attach the vHDD, CentOS 8 books into emergency mode (dracut). We can switch the vHDD back to be controlled by NVME (or even IDE; unfortunately, IDE is also not supported), and the VM will boot normally.

I'm not entirely sure what I need to do to get the VM to boot correctly when the vHDD is attached to either a SCSI or SATA controller or whether this is something that needs to be done from dracut or it can be done when the VM boots normally using the NVME or IDE controller.

Pointers welcome.

User avatar
TrevorH
Site Admin
Posts: 33223
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to switch CentOS8 VM to use a SCSI or SATA Controller for the booting vHDD instead of a NVME?

Post by TrevorH » 2023/07/22 15:35:55

Switch it to the new host, choose the rescue kernel from the list (usually the last one) and that should boot up as it contains all drivers for all hardware. Once booted either

yum update to the latest kernel or
yum reinstall kernel-$your-latest-kernel-version or
run dracut -f --kver=$your-latest-kernel-version

Both the first two will work as the kernel install runs dracut to build the initramfs for the current hardware for you. For the third option, the list of installed kernel versions in the right format can be found by listing /lib/modules and picking the highest version number listed there - e.g. 4.18.0-477.15.1.el8_8.x86_64

Or, work out what driver the new hardware needs and rebuild the initramfs on the VM before you move it and tell dracut to include the correct module in the initramfs.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

swinster
Posts: 4
Joined: 2019/10/20 16:34:05

Re: How to switch CentOS8 VM to use a SCSI or SATA Controller for the booting vHDD instead of a NVME?

Post by swinster » 2023/07/23 01:13:11

@TrevorH - Awesome. It's always so simple once you know what you are looking for.

FWIW, running `yum update` did update some packages but did not resolve the issue. I then when straight to running the `dracut` command, and specifically for me, that was:

Code: Select all

dracut -f --kver=4.18.0-500.el8.x86_64
This resolved the issue nicely.

Many thanks for your help

Post Reply