Repository: siderolabs/talos

Issue #10292: Talos `1.9.3`: `diskSelector` is not working for disks behind a RAID controller
Created: 2025-02-04T23:31:11Z
Bug Report
Talos 1.9.3 is reporting SSD disks TYPE as UNKNOWN behind a RAID controller
Description
I tried:

RAID-0 with 1 and 2 disks
RAID-1 with 2 disks

RAID-0 with 1 disk:
$ talosctl -n 172.18.0.52 -e 172.18.0.52 disks --insecure
DEV          MODEL            SERIAL   TYPE      UUID   WWID                                   MODALIAS      NAME   SIZE     BUS_PATH                                                                                       SUBSYSTEM          READ_ONLY   SYSTEM_DISK    
/dev/sda     PERC H740P Adp   -        UNKNOWN   -      naa.64cd98f0b4518d002f355bc93432dc00   scsi:t-0x00   -      480 GB   /pci0000:17/0000:17:00.0/0000:18:00.0/host0/target0:2:0/0:2:0:0                                /sys/class/block               

RAID-0 with 2 disks:
$ talosctl -n 172.18.0.52 -e 172.18.0.52 disks --insecure                                                                                                                                                                              
DEV          MODEL            SERIAL   TYPE      UUID   WWID                                   MODALIAS      NAME   SIZE     BUS_PATH                                                                                       SUBSYSTEM          READ_ONLY   SYSTEM_DISK    
/dev/sda     PERC H740P Adp   -        UNKNOWN   -      naa.64cd98f0b4518d002f355b4e7c892598   scsi:t-0x00   -      959 GB   /pci0000:17/0000:17:00.0/0000:18:00.0/host0/target0:2:0/0:2:0:0                                /sys/class/block                                    

RAID-1 with 2 disks:
$ talosctl -n 172.18.0.52 -e 172.18.0.52 disks --insecure                                                                                                                                                                              
DEV          MODEL            SERIAL   TYPE      UUID   WWID                                   MODALIAS      NAME   SIZE     BUS_PATH                                                                                       SUBSYSTEM          READ_ONLY   SYSTEM_DISK                                   
/dev/sda     PERC H740P Adp   -        UNKNOWN   -      naa.64cd98f0b4518d002f3556c1aeb59cf1   scsi:t-0x00   -      480 GB   /pci0000:17/0000:17:00.0/0000:18:00.0/host1/target1:2:0/1:2:0:0                                /sys/class/block                                    

Those 2 disks were wiped before attempting to install Talos
Error that I got when trying to apply-config:
$ ./apply-config.sh 172.18.0.52 node001.yaml                                                                                                                                                                                           
error applying new configuration: rpc error: code = InvalidArgument desc = runtime configuration validation failed: 1 error occurred:                                                                                                                                           
        * no disks matched the expression: disk.size < 900000000000u && disk.transport != "" && !disk.readonly && !disk.cdrom

node001.yaml:
...
machine:
    install:
        diskSelector:
            size: < 1000GB
...


I also tried different diskSelector options against UNKNOWN type which is my ssd and also hdd drives. None of those worked for me. Example using wwid:
$ talosctl -n 172.18.0.52 -e 172.18.0.52 disks --insecure
DEV          MODEL            SERIAL   TYPE      UUID   WWID                                   MODALIAS      NAME   SIZE     BUS_PATH                                                          SUBSYSTEM          READ_ONLY   SYSTEM_DISK
/dev/loop0   -                -        UNKNOWN   -      -                                      -             -      74 MB    /virtual                                                          /sys/class/block   *           
/dev/sda     PERC H740P Adp   -        UNKNOWN   -      naa.64cd98f0b4518d002f355bc93432dc00   scsi:t-0x00   -      480 GB   /pci0000:17/0000:17:00.0/0000:18:00.0/host0/target0:2:0/0:2:0:0   /sys/class/block               *
/dev/sdb     PERC H740P Adp   -        HDD       -      naa.64cd98f0b4518d002f3556cec3146a4e   scsi:t-0x00   -      1.2 TB   /pci0000:17/0000:17:00.0/0000:18:00.0/host0/target0:2:1/0:2:1:0   /sys/class/block               
/dev/sdc     PERC H740P Adp   -        HDD       -      naa.64cd98f0b4518d002f3556ddd8ac8af9   scsi:t-0x00   -      1.2 TB   /pci0000:17/0000:17:00.0/0000:18:00.0/host0/target0:2:2/0:2:2:0   /sys/class/block               
/dev/sdd     PERC H740P Adp   -        HDD       -      naa.64cd98f0b4518d002f3556ecefdf9e2f   scsi:t-0x00   -      1.2 TB   /pci0000:17/0000:17:00.0/0000:18:00.0/host0/target0:2:3/0:2:3:0   /sys/class/block

node001.yaml:
machine:
    install:
        diskSelector:
          wwid: naa.64cd98f0b4518d002f3556cec3146a4e

output:
$ ./apply-config.sh 172.18.0.52 node001.yaml 
error applying new configuration: rpc error: code = InvalidArgument desc = runtime configuration validation failed: 1 error occurred:
        * no disks matched the expression: glob("naa.64cd98f0b4518d002f3556cec3146a4e", disk.wwid) && disk.transport != "" &&
!disk.readonly && !disk.cdrom


It worked when I set /dev/sda as my install disk regardless my /dev/sda is specified as UNKNOWN type. See disks output above.
machine:
    install:
        disk: /dev/sda

Logs
Environment

Talos version: [1.9.3]
Kubernetes version: [1.32.1]
Platform: baremetal

Duplicate issue #10315: Installation fails on xcp-ng VM with diskSelector
Created: 2025-02-08T04:30:51Z
Bug Report
talosctl --talosconfig talosconfig -n 192.168.1.152 apply-config --file worker.yaml --insecure fails for a machine in maintenance mode, not being able to find the disk with a diskSelector. I tried <=1TB and >=8GB in the worker.yaml
disk.transport != "" is the issue IMHO, not sure why that is empty though.
First try:
  install:
    diskSelector:
      size: '<= 1TB'
    image: ghcr.io/siderolabs/installer:v1.9.3
Error:
$ talosctl --talosconfig talosconfig -n 192.168.1.152 apply-config --file worker.yaml --insecure
error applying new configuration: rpc error: code = InvalidArgument desc = runtime configuration validation failed: 1 error occurred:
        * no disks matched the expression: disk.size <= 1000000000000u && disk.transport != "" && !disk.readonly && !disk.cdrom

Second try:
  install:
    diskSelector:
      size: '>= 8GB'
    image: ghcr.io/siderolabs/installer:v1.9.3
Error:
$ talosctl --talosconfig talosconfig -n 192.168.1.152 apply-config --file worker.yaml --insecure
error applying new configuration: rpc error: code = InvalidArgument desc = runtime configuration validation failed: 1 error occurred:
        * no disks matched the expression: disk.size >= 8000000000u && disk.transport != "" && !disk.readonly && !disk.cdrom

Disk info from the relevant node:
$ talosctl --talosconfig talosconfig -n 192.168.1.152 get disks --insecure
NODE   NAMESPACE   TYPE   ID      VERSION   SIZE     READ ONLY   TRANSPORT   ROTATIONAL   WWID   MODEL          SERIAL
       runtime     Disk   loop0   1         74 MB    true
       runtime     Disk   sr0     1         105 MB   false       ata                             QEMU DVD-ROM
       runtime     Disk   xvda    1         34 GB    false

Workaround
Hardcoded the disk to /dev/xvda.
Environment

Talos version: 1.9.3
Kubernetes version: 1.32.1
Platform: xcp-ng 8.3

Closing comment (2025-02-10T08:21:39Z): Might be a duplicate of #10292, please attach full output of talosctl get disks -o yaml.