talm
talm copied to clipboard
Use stable IDs for NVMe disks
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 }}
That sounds reasonable. Would you mind opening a PR with this functionality?
Sure https://github.com/cozystack/talm/pull/65