From 1d8fe040c767072d581db6cfd4cee6827dae8973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Thu, 20 Aug 2026 22:58:25 -0300 Subject: [PATCH] fix(getinstdisk): prefer direct attached disks over RAID volumes The driver sort put the ahci and ata_piix controllers in the same choice group as the PMC MaxRAID and megaraid_sas RAID controllers. On a server with both, the sort could select a RAID data volume as the OS install disk. Move the RAID controllers to the second choice group. The direct attached controllers hold the likely boot volume, and a server with only RAID volumes still selects them from the second group. The SAS host adapters move to the third group and every other driver to a new fourth group, so the relative order of the remaining drivers does not change. The RHEL 10 installer includes its own copy of the script, so both carry the change. Recovered from the lenovobuild branch. --- xCAT-server/share/xcat/install/scripts/getinstdisk | 12 ++++++++---- .../share/xcat/install/scripts/getinstdisk.rhels10 | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/getinstdisk b/xCAT-server/share/xcat/install/scripts/getinstdisk index 846e33734..20020a45a 100644 --- a/xCAT-server/share/xcat/install/scripts/getinstdisk +++ b/xCAT-server/share/xcat/install/scripts/getinstdisk @@ -201,22 +201,26 @@ if [ -z "$install_disk" ]; then # Sort disks by DRIVER type case "$disk_driver" in - "ata_piix"*|"PMC MaxRAID"|"ahci"|"megaraid_sas") + "ata_piix"*|"ahci") echo "$disk $disk_data" >> "$tmpfile""$file_pre""firstchoicedisks" echo "[get_install_disk] Add disk: $disk $disk_data into $file_pre firstchoicedisks" ;; - "mptsas"|"mpt2sas"|"mpt3sas") + "PMC MaxRAID"|"megaraid_sas") echo "$disk $disk_data" >> "$tmpfile""$file_pre""secondchoicedisks" echo "[get_install_disk] Add disk: $disk $disk_data into $file_pre secondchoicedisks" ;; - *) + "mptsas"|"mpt2sas"|"mpt3sas") echo "$disk $disk_data" >> "$tmpfile""$file_pre""thirdchoicedisks" echo "[get_install_disk] Add disk: $disk $disk_data into $file_pre thirdchoicedisks" ;; + *) + echo "$disk $disk_data" >> "$tmpfile""$file_pre""fourthchoicedisks" + echo "[get_install_disk] Add disk: $disk $disk_data into $file_pre fourthchoicedisks" + ;; esac done - for seq in first second third; do + for seq in first second third fourth; do if [ -s $tmpfile$file_pre${seq}choicedisks ]; then install_file="$tmpfile$file_pre${seq}choicedisks" break diff --git a/xCAT-server/share/xcat/install/scripts/getinstdisk.rhels10 b/xCAT-server/share/xcat/install/scripts/getinstdisk.rhels10 index 57f05620a..0a058bbce 100644 --- a/xCAT-server/share/xcat/install/scripts/getinstdisk.rhels10 +++ b/xCAT-server/share/xcat/install/scripts/getinstdisk.rhels10 @@ -201,22 +201,26 @@ if [ -z "$install_disk" ]; then # Sort disks by DRIVER type case "$disk_driver" in - "ata_piix"*|"PMC MaxRAID"|"ahci"|"megaraid_sas") + "ata_piix"*|"ahci") echo "$disk $disk_data" >> "$tmpfile""$file_pre""firstchoicedisks" echo "[get_install_disk] Add disk: $disk $disk_data into $file_pre firstchoicedisks" ;; - "mptsas"|"mpt2sas"|"mpt3sas") + "PMC MaxRAID"|"megaraid_sas") echo "$disk $disk_data" >> "$tmpfile""$file_pre""secondchoicedisks" echo "[get_install_disk] Add disk: $disk $disk_data into $file_pre secondchoicedisks" ;; - *) + "mptsas"|"mpt2sas"|"mpt3sas") echo "$disk $disk_data" >> "$tmpfile""$file_pre""thirdchoicedisks" echo "[get_install_disk] Add disk: $disk $disk_data into $file_pre thirdchoicedisks" ;; + *) + echo "$disk $disk_data" >> "$tmpfile""$file_pre""fourthchoicedisks" + echo "[get_install_disk] Add disk: $disk $disk_data into $file_pre fourthchoicedisks" + ;; esac done - for seq in first second third; do + for seq in first second third fourth; do if [ -s $tmpfile$file_pre${seq}choicedisks ]; then install_file="$tmpfile$file_pre${seq}choicedisks" break