Hardware Labels

When a node is registered, hardware data is collected and made available to the MachineRegistration in the same way as SMBIOS data.

This data can be used for easy identification and selection via a MachineSelector.

The following are available for templating:

LabelDescription
${System Data/Memory/Total Physical Bytes}The total RAM memory in the node, expressed in bytes
${System Data/CPU/Total Cores}Total CPU cores
${System Data/CPU/Total Threads}Total CPU threads
${System Data/CPU/Vendor}CPU vendor
${System Data/CPU/Model}CPU model
${System Data/GPU/Vendor}GPU vendor (Only available if the node has an identifiable GPU)
${System Data/GPU/Model}GPU model (Only available if the node has an identifiable GPU)
${System Data/Network/Number Interfaces}Number of network interfaces in the system
${System Data/Network/{Iface name}/Name}Network interface name
${System Data/Network/{Iface name}/IsVirtual}Boolean indicating virtual network interface
${System Data/Block Devices/Number Devices}Number of block devices in the system (includes DVD and USB drives)
${System Data/Block Devices/{Disk name}/Name}Device name of the block device (i.e. sda, sr0, vda, etc…)
${System Data/Block Devices/{Disk name}/Removable}Whether this block device is removable (i.e. DVD)
${System Data/Block Devices/{Disk name}/Size}Total space in this block device, expressed in bytes
${System Data/Block Devices/{Disk name}/Drive Type}Drive type of this block device, see table below
${System Data/Block Devices/{Disk name}/Storage Controller}Controller type for this block device connection, see table below

Hardware Labels - 图1info

On both Block Devices and Network the device name is used as a sub-block, as there could be more than one device.

Block device drive types

TypeDescription
HDDHard disk drive
FDDFloppy disk drive
ODDOptical disk drive
SSDSolid-state drive
virtualvirtual drive i.e. loop devices
Unknownunknown drive type

Block device controller types

TypeDescription
IDEIntegrated Drive Electronics
SCSISmall computer system interface
NVMeNon-volatile Memory Express
MMCMulti-media controller (used for mobile phone storage devices)
virtioVirtualized storage controller/driver
looploop device
Unknownunknown controller type

Example MachineRegistration

registration example with smbios labels

  1. apiVersion: elemental.cattle.io/v1beta1
  2. kind: MachineRegistration
  3. metadata:
  4. name: my-nodes
  5. namespace: fleet-default
  6. spec:
  7. config:
  8. cloud-config:
  9. users:
  10. - name: root
  11. passwd: root
  12. elemental:
  13. install:
  14. reboot: true
  15. device: /dev/sda
  16. debug: true
  17. machineInventoryLabels:
  18. elemental.cattle.io/CpuTotalCores: "${CPU/TotalCores}"
  19. elemental.cattle.io/CpuTotalThreads: "${CPU/TotalThreads}"
  20. elemental.cattle.io/TotalMemoryBytes: "${Memory/TotalPhysicalBytes}"
  21. elemental.cattle.io/NumDisks: "${Storage/TotalDisks}"