LVMVolumeGroupConfigselects existing Talos volumes or whole disks and creates the physical volumes and volume group.LVMLogicalVolumeConfigcreates logical volumes inside the volume group.- LVM status resources (
pvs,vgs, andlvs) expose the final state discovered on the node.
Provision LVM storage
The simplest LVM setup is a volume group backed directly by whole disks. Use this when the entire disk should be dedicated to LVM and no Talos partition needs to be created first. The following example createsvg-pool from two whole disks and provisions a logical volume named lv-data:
volume.
For whole disks, the expression can also use the disk variable.
Use selectors that match only the intended devices: Talos initializes matched devices as LVM physical volumes.
You can match disks by stable properties such as serial number, WWID, or symlink, depending on what the node reports in the Disk resource:
/dev/sd* names when possible.
Device names can change across boots or when hardware is added or removed.
Configure volume groups
AnLVMVolumeGroupConfig document requires:
name: the volume group name, 1-63 characters, using ASCII letters, digits, hyphens, and underscores.provisioning.volumeSelector.match: a CEL expression selecting the disks or partitions to use as physical volumes.
LVMPhysicalVolumeSpec for each matched device, then creates or extends the volume group so it contains those physical volumes.
If a selector conflict cannot be resolved, Talos reports it with an LVMValidationError resource.
Configure logical volumes
AnLVMLogicalVolumeConfig document requires:
name: the logical volume name, 1-63 characters, using ASCII letters, digits, hyphens, and underscores.type: one oflinear,raid0,raid1, orraid10.provisioning.volumeGroup: the target volume group name.provisioning.maxSize: the desired maximum size, either an absolute size such as50GiBor a percentage of the volume group such as80%.
provisioning.minSize: minimum acceptable size when using an absolutemaxSize.mirrors: number of mirror copies forraid1andraid10; defaults to1when unset.stripes: number of stripes forraid0andraid10; defaults to all available physical volumes when unset and must be at least2when set.
/dev/vg-pool/lv-data.
Talos does not format or mount the logical volume through the LVM configuration itself; configure the consumer of the block device separately.
Use raw volume partitions as physical volumes
Instead of selecting whole disks directly, an LVM volume group can be backed by Talos raw volume partitions. This is useful when Talos should first allocate partitions from available disk space, and LVM should use those partitions as physical volumes. The following example creates two raw volumes and selects their partition labels forvg-pool:
r- when Talos creates their partition labels.
In this example, the LVMVolumeGroupConfig selector matches the raw volume partitions labeled r-lvm-a and r-lvm-b.
A logical volume can also back a Talos user volume.
For details, see User Volumes.
Inspect LVM state
Use the LVM status resource aliases to inspect physical volumes, volume groups, and logical volumes.Remove LVM resources
First remove theLVMLogicalVolumeConfig and LVMVolumeGroupConfig documents from the machine configuration.
If the documents remain in configuration, Talos will reconcile them again.
Then remove the on-disk LVM objects with talosctl wipe:
talosctl wipe pv.