|
| 1 | +syntax = "proto3"; |
| 2 | + |
| 3 | +package talos.resource.definitions.storage; |
| 4 | + |
| 5 | +option go_package = "github.com/siderolabs/talos/pkg/machinery/api/resource/definitions/storage"; |
| 6 | +option java_package = "dev.talos.api.resource.definitions.storage"; |
| 7 | + |
| 8 | +// LVMLogicalVolumeStatusSpec is the spec for LVMLogicalVolumeStatus resource. |
| 9 | +// |
| 10 | +// Fields mirror the colon-separated output of `lvdisplay -c`. |
| 11 | +message LVMLogicalVolumeStatusSpec { |
| 12 | + // Path is the device-mapper path of the LV, e.g. /dev/vg0/data. |
| 13 | + string path = 1; |
| 14 | + // VGName is the parent volume group name. |
| 15 | + string vg_name = 2; |
| 16 | + // Access is a bitmask of LV access flags (1=read, 2=write, 4=visible). |
| 17 | + uint64 access = 3; |
| 18 | + // Status is a bitmask of LV status flags (1=active, 2=allocated, …). |
| 19 | + uint64 status = 4; |
| 20 | + // InternalLVNumber is the historical internal LV index; always -1 in modern LVM, normalised to 0. |
| 21 | + uint64 internal_lv_number = 5; |
| 22 | + // OpenCount is the number of times the LV is currently open (mounted/held). |
| 23 | + uint64 open_count = 6; |
| 24 | + // SizeBytes is the LV size in bytes (sectors × 512 from the raw output). |
| 25 | + uint64 size_bytes = 7; |
| 26 | + // CurrentLE is the current number of logical extents allocated to the LV. |
| 27 | + uint64 current_le = 8; |
| 28 | + // AllocatedLE is the number of LEs allocated for snapshot/mirror copies; 0 for plain LVs. |
| 29 | + uint64 allocated_le = 9; |
| 30 | + // AllocPolicy is the allocation policy enum (0=normal, 1=contiguous, 2=anywhere, 3=cling, 4=inherit). |
| 31 | + uint64 alloc_policy = 10; |
| 32 | + // ReadAheadSectors is the configured read-ahead in 512-byte sectors; 0 means auto. |
| 33 | + uint64 read_ahead_sectors = 11; |
| 34 | + // Major is the kernel block-device major number for the LV. |
| 35 | + uint32 major = 12; |
| 36 | + // Minor is the kernel block-device minor number for the LV. |
| 37 | + uint32 minor = 13; |
| 38 | +} |
| 39 | + |
| 40 | +// LVMPhysicalVolumeStatusSpec is the spec for LVMPhysicalVolumeStatus resource. |
| 41 | +// |
| 42 | +// Fields mirror the colon-separated output of `pvdisplay -c`. |
| 43 | +message LVMPhysicalVolumeStatusSpec { |
| 44 | + // Device is the block-device path backing the PV, e.g. /dev/sda1. |
| 45 | + string device = 1; |
| 46 | + // VGName is the parent volume group name; empty if the PV is not assigned to a VG. |
| 47 | + string vg_name = 2; |
| 48 | + // SizeBytes is the usable PV size in bytes (sectors × 512 from the raw output). |
| 49 | + uint64 size_bytes = 3; |
| 50 | + // InternalPVNumber is the historical internal PV index; always -1 in modern LVM, normalised to 0. |
| 51 | + uint64 internal_pv_number = 4; |
| 52 | + // Status is a bitmask of PV status flags (allocatable, exported, missing, …). |
| 53 | + uint64 status = 5; |
| 54 | + // Allocatable mirrors the allocatable bit from Status; non-zero means new LVs can use this PV. |
| 55 | + uint64 allocatable = 6; |
| 56 | + // CurrentLE is the number of LEs currently in use on this PV; -1 in raw output is normalised to 0. |
| 57 | + uint64 current_le = 7; |
| 58 | + // PESize is the physical-extent size in bytes (KiB × 1024); matches the parent VG. |
| 59 | + uint64 pe_size = 8; |
| 60 | + // TotalPE is the total number of physical extents on this PV. |
| 61 | + uint64 total_pe = 9; |
| 62 | + // FreePE is the number of physical extents on this PV not yet allocated. |
| 63 | + uint64 free_pe = 10; |
| 64 | + // AllocPE is the number of physical extents on this PV currently allocated to LVs. |
| 65 | + uint64 alloc_pe = 11; |
| 66 | + // UUID is the stable PV identifier written to the PV label. |
| 67 | + string uuid = 12; |
| 68 | +} |
| 69 | + |
| 70 | +// LVMVolumeGroupStatusSpec is the spec for LVMVolumeGroupStatus resource. |
| 71 | +// |
| 72 | +// Fields mirror the colon-separated output of `vgdisplay -c`. |
| 73 | +message LVMVolumeGroupStatusSpec { |
| 74 | + // Name is the volume group name. |
| 75 | + string name = 1; |
| 76 | + // Access is the VG access mode string emitted by vgdisplay (e.g. "r/w", "r--"). |
| 77 | + string access = 2; |
| 78 | + // Status is a bitmask of VG status flags (resizable, exported, clustered, …). |
| 79 | + uint64 status = 3; |
| 80 | + // InternalVGNumber is the historical internal VG index; always -1 in modern LVM, normalised to 0. |
| 81 | + uint64 internal_vg_number = 4; |
| 82 | + // MaxLV is the configured max number of LVs in the VG; 0 means no limit. |
| 83 | + uint64 max_lv = 5; |
| 84 | + // CurLV is the current number of LVs in the VG. |
| 85 | + uint64 cur_lv = 6; |
| 86 | + // OpenLV is the number of LVs in the VG that are currently open. |
| 87 | + uint64 open_lv = 7; |
| 88 | + // MaxLVSize is the configured per-LV size cap in sectors; 0 means no limit. |
| 89 | + uint64 max_lv_size = 8; |
| 90 | + // MaxPV is the configured max number of PVs in the VG; 0 means no limit. |
| 91 | + uint64 max_pv = 9; |
| 92 | + // CurPV is the current number of PVs in the VG. |
| 93 | + uint64 cur_pv = 10; |
| 94 | + // ActPV is the number of currently active PVs (online and accessible). |
| 95 | + uint64 act_pv = 11; |
| 96 | + // SizeBytes is the total VG size in bytes (KiB × 1024 from the raw output). |
| 97 | + uint64 size_bytes = 12; |
| 98 | + // PESize is the physical-extent size in bytes (KiB × 1024); 4 MiB by default. |
| 99 | + uint64 pe_size = 13; |
| 100 | + // TotalPE is the total number of physical extents in the VG. |
| 101 | + uint64 total_pe = 14; |
| 102 | + // AllocPE is the number of physical extents currently allocated to LVs. |
| 103 | + uint64 alloc_pe = 15; |
| 104 | + // FreePE is the number of physical extents available for new allocations. |
| 105 | + uint64 free_pe = 16; |
| 106 | + // UUID is the stable VG identifier used in LVM metadata. |
| 107 | + string uuid = 17; |
| 108 | +} |
| 109 | + |
0 commit comments