When provisioning a new RHEL 9.x VM, adding a secondary disk to the template causes the disk positions to be swapped
book
Article ID: 379870
calendar_today
Updated On:
Products
VMware Aria Suite
Issue/Introduction
When deploying RHEL 9.x VM's and you have more than 1 disk included in the VM template within vSphere, disks are not consistent across provisioning attempts leading to the boot disk being assigned to the incorrect drive location.
When adding a single disk to the template, the boot-disk takes /dev/sda. This is expected behavior.
When adding a second disk, the second disk takes /dev/sda and the boot-disk takes /dev/sdb.
The disk order gets swapped despite what is included in the template. This also causes the add-disk script to fail since /dev/sdb is now root partitioned.
Environment
RHEL 9.x
Cause
Updates and changes made to RHEL 9.x changes the functionally of how drives are assigned when compared to RHEL 7.x and 8.x
Resolution
Add an entry on the RHEL9 VM template in vSphere to amend the kernel line in grub menu of the VM.
On the RHEL9 VM template add the following: Run: vi /etc/default/grub Add: --enable-biosdevname to the end of the GRUB_CMDLINE_LINUX= line. Run: grub2-mkconfig -o /boot/grub2/grub.cfg
This kernel parameter instructs the system to use the BIOS assigned device names (like sda, sdb) instead of the potentially changing the order that the kernel might detect during boot, resulting in consistent disk naming across different systems.
Adding the parameter to the RHEL9 template keeps the boot-disk on /dev/sda instead of it switching to /dev/sdb.