talm icon indicating copy to clipboard operation
talm copied to clipboard

Use stable IDs for NVMe disks

Open wasd171 opened this issue 6 months ago • 2 comments

Currently templates use talm.discovered.system_disk_name for detecting system disk name. Issue with it is that disk names are not stable. Could we add an additional helper to talm to use /dev/disk/by-id paths for NVMe disks?

Something like that

{{- define "talm.discovered.system_disk_nvme_id" }}
{{- $diskName := ( include "talm.discovered.system_disk_name" . ) }}
{{- range (lookup "disks" "" "").items }}
{{- if and (eq .spec.dev_path $diskName) (eq .spec.transport "nvme") .spec.wwid }}
{{- printf "/dev/disk/by-id/nvme-%s" .spec.wwid }}
{{- end }}
{{- end }}
{{- end }}

wasd171 avatar Jun 25 '25 14:06 wasd171

That sounds reasonable. Would you mind opening a PR with this functionality?

kvaps avatar Jun 25 '25 14:06 kvaps

Sure https://github.com/cozystack/talm/pull/65

wasd171 avatar Jun 25 '25 14:06 wasd171