Introduction

The System Management BIOS (SMBIOS) specification defines data structures (and access methods) that can be used to read management information produced by the BIOS of a computer.

This allows us to gather hardware information about the running system and use that as part of our labels.

How does Elemental use SMBIOS data?

The registration client tries to gather SMBIOS data by running dmidecode during the initial registration of the node and that data is sent to the registration controller to use on interpolating different fields in the inventory that we create for that node.

Currently, we support interpolating that data into the machineName and the machineInventoryLabels of a machineRegistration

The interpolation format is as follows:

{$KEY/VALUE} and ${KEY/SUBKEY/VALUE}

This can be mixed with normal strings so my-prefix-${KEY/VALUE} would result into the resolved values with my-prefix- prefixed

For example, having the following SMBIOS data:

  1. System Information
  2. Manufacturer: My manufacturer
  3. Product Name: Awesome PC
  4. Version: Not Specified
  5. Serial Number: THX1138
  6. Family: Toretto

And setting the machineName to serial-${System Information/Serial Number} would result in the final value of serial-THX1138

This is useful to generate automatic names for machines based on their hardware values, for example using the UUID or the Product name. Our default machineName when the registration values are empty is "m-${System Information/UUID}".

Smbios - 图1warning

All non-valid characters will be changed into - automatically on parse. Valid characters for labels are alphanumeric and -,_ and . For machineName the constraints are stricter as that value is used for the hostname so valid values are lowercase alphanumeric and - only.

A good use of SMBIOS data is to set up different labels for all your machines and get those values from the hardware directly.

Having your machineInventoryLabels on the machineRegistration set to SMBIOS data would allow you to use selectors down the line to select similar machines.

For example using the following label cpuFamily: "${Processor Information/Family} would allow you to use a selector to search for i7 cpus in your machine fleet.

registration example with smbios labels

  1. apiVersion: elemental.cattle.io/v1beta1
  2. kind: MachineRegistration
  3. metadata:
  4. name: fire-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. element: fire
  19. manufacturer: "${Product/Vendor}"
  20. productName: "${Product/Name}"
  21. serialNumber: "${Product/Serial Number}"
  22. machineUUID: "${Product/UUID}"