Inventory Management

The SUSE® Rancher Prime: OS Manager operator can hold an inventory of machines and the mapping of the machine to it’s configuration and assigned cluster.

MachineInventory

The MachineInventory holds all the relevant information for a registered machine.

Upon successful registration, the MachineInventory will inherit all machineInventoryLabels defined in the related MachineRegistration.

The registering host also sends system annotations tracking information regarding the authentication method used, the running OS version and the current IP address.

Those annotations are added to the associated MachineInventory.

SUSE® Rancher Prime: OS Manager machines attempt a registration update every 30 minutes to update labels and annotations.

System Annotations

The following annotations are automatically added to the MachineInventory tracking the host. The keys are prefixed with the value of the labelPrefix field in the MachineRegistration (defaults to elemental.cattle.io).

Key Description

<labelPrefix>/auth

Authentication used during registration (one of tpm, emulated-tpm, mac, sys-uuid)

<labelPrefix>/registration-ip

IP address used during last registration

<labelPrefix>/os.unmanaged

Only present when set to true, disables OS management functionality on the tracked host

<labelPrefix>/name

NAME from /etc/os-release

<labelPrefix>/version

VERSION from /etc/os-release

<labelPrefix>/version-id

VERSION_ID from /etc/os-release

<labelPrefix>/id

ID from /etc/os-release

<labelPrefix>/pretty-name

PRETTY_NAME from /etc/os-release

<labelPrefix>/image

IMAGE from /etc/os-release

<labelPrefix>/cpe-name

CPE_NAME from /etc/os-release

Reference

apiVersion: elemental.cattle.io/v1beta1
kind: MachineInventory
metadata:
  # Machine annotations can be useful to identify hosts
  annotations:
    elemental.cattle.io/auth: tpm
    elemental.cattle.io/registration-ip: 192.168.122.152
  labels:
    # A label inherited from the MachineRegistration definition
    element: fire
    # Generic SMBIOS labels that are typically populated with
    # the MachineRegister approach
    machineUUID: f266c64b-3972-40e7-9937-3dc4a311436c
    manufacturer: QEMU
    productName: Standard-PC-Q35-ICH9-2009
    serialNumber: Not-Specified
    # Custom labels can be applied to each MachineInventory
    myCustomLabel: foo
  name: m-479ab68e-00ff-4081-a731-5b1a76610289
  # The namespace must match the namespace of the cluster
  # assigned to the clusters.provisioning.cattle.io resource
  namespace: fleet-default
  # A reference to the MachineInventorySelector that links the
  # machine to a Cluster definition
  ownerReferences:
  - apiVersion: elemental.cattle.io/v1beta1
    controller: true
    kind: MachineInventorySelector
    name: fire-machine-selector-qcn7d
    uid: 0a1f751e-4ca9-4a0d-919a-97ba1f434d12
spec:
  # The hash of the TPM EK public key. This is used if you are
  # using TPM2 to identify nodes. Nodes can report their TPM
  # hash by using the MachineRegistration.
  tpmHash: d68795c6192af9922692f050b...

MachineRegistration

MachineRegistration holds information on how to install, reset, and configure all connected SUSE® Rancher Prime: OS Manager machines.

The spec.labelPrefix field defines the prefix for labels and annotations generated by the operator (defaults to elemental.cattle.io).

The spec.machineInventoryLabels and spec.machineInventoryAnnotations fields hold label and annotation templates rendered to actual labels and annotations applied to the MachineInventories tracking the registered machines.

SUSE® Rancher Prime: OS Manager machines attempt a registration update every 30 minutes to update labels and annotations.

While it’s possible to modify the spec.config definition, updates to the spec.config will be ignored by machines that already completed installation. Machines that couldn’t complete the installation will try again every 30 minutes by reloading the remote MachineRegistration definition. This can be useful to correct spec.config mistakes that prevent successful installation (for ex. spec.config.elemental.install.device), without having to create a new MachineRegistration and a new ISO.

Reference

apiVersion: elemental.cattle.io/v1beta1
kind: MachineRegistration
metadata:
  name: fire-nodes
  # The namespace must match the namespace of the cluster
  # assigned to the clusters.provisioning.cattle.io resource
  namespace: fleet-default
spec:
  # The cloud config that will be used to provision the node
  config:
    cloud-config:
      users:
        - name: root
          passwd: root
    elemental:
      install:
        reboot: true
        device: /dev/sda
        debug: true
      reset:
        enabled: true
        debug: true
        reset-persistent: true
        reset-oem: true
        reboot: true
  # Labels to be added to the created MachineInventory object
  machineInventoryLabels:
    element: fire
    manufacturer: "${System Information/Manufacturer}"
    productName: "${System Information/Product Name}"
    serialNumber: "${System Information/Serial Number}"
    machineUUID: "${System Information/UUID}"
  # Annotations to be added to the created MachineInventory object
  machineInventoryAnnotations: {}