Disk Selector
ThediskSelector field is utilized to choose the disk where the volume will be provisioned.
It is a Common Expression Language (CEL) expression that evaluates against the available disks.
The volume will be provisioned on the first disk that matches the expression and has sufficient free space for the volume.
The expression is evaluated in the following context:
system_disk(bool) - indicates if the disk is the system diskdisk(Disks.block.talos.dev) - the disk resource being evaluated
Note: TheFor the disk resource, any field available in the resource specification can be used (usesystem_diskvariable is only populated after Talos installation, so you might see an error aboutsystem_disknot being defined before installation finishes.
talosctl get disks -o yaml to see the output for your machine):
KiB,MiB,GiB,TiB,PiB,EiB- binary size multipliers (1024)kB,MB,GB,TB,PB,EB- decimal size multipliers (1000)
true or false.
If the expression returns true, the disk is selected for provisioning.
Note: In CEL, signed and unsigned integers are not interchangeable. Disk sizes are represented as unsigned integers, so suffixExamples of disk selector expressions:ushould be used in constants to avoid type mismatch, e.g.disk.size > 10u * GiB.
disk.transport == 'nvme': select the NVMe disks onlydisk.transport == 'scsi' && disk.size < 2u * TiB: select SCSI disks smaller than 2 TiBdisk.serial.startsWith('deadbeef') && !cdrom: select disks with serial number starting withdeadbeefand not of CD-ROM type'/dev/disk/by-path/pci-0000:00:1f.2-ata-1' in disk.symlinks: select disks with a specific stable symlink
Minimum, Maximum and Grow
TheminSize and maxSize fields define the minimum and maximum size of the volume, respectively.
Talos Linux will always ensure that the volume is at least minSize in size and will not exceed maxSize.
If maxSize is not set, the volume will grow to utilize the maximum available space on the disk.
The grow flag controls what happens when the volume already exists:
- On initial creation:
growis ignored. The new volume is created betweenminSizeandmaxSize(or full disk ifmaxSizeis unset). - On subsequent boots (when the volume already exists):
- If
grow: false, the existing volume size is never changed. - If
grow: true, and the current volume is smaller thanmaxSize(ormaxSizeis unset), Talos will expand the volume to fill available space after it.
- If
minSize might influence disk selection - if the disk does not have enough free space to satisfy the minimum size requirement, it will not be selected for provisioning.
Volume Selector
ThevolumeSelector field is a CEL expression that allows you to match existing volumes based on their properties.
It is evaluated against the available volumes, and the first volume that matches the expression will be picked up.
The expression is evaluated in the following context:
volume(DiscoveredVolumes.block.talos.dev) - the volume resource being evaluateddisk(Disks.block.talos.dev) - the disk resource where the volume is located
disk field, see Disk Selector above.
For the volume field, any field available in the resource specification can be used (use talosctl get discoveredvolumes -o yaml to see the output for your machine):
volume.partition_label == 'MY-DATA': match volumes with partition labelMY-DATAvolume.name == 'xfs' && volume.size > 1000u * TB: match XFS volumes larger than 1000 TBvolume.name == 'xfs' && disk.transport == 'nvme': match XFS volumes on NVMe disksvolume.partition_index == 2 && disk.serial == 'SERIAL123': match second partition on a disk with serial numberSERIAL123