MachineInventory with the
elemental.cattle.io/resettable: "true" annotation will trigger the execution of a reset plan, upon deletion.
machineinventory.elemental.cattle.io finalizer is going to be removed only after the plan has been executed successfully by the
elemental-system-agent running on the machine.
You can investigate why a
MachineInventory has not been deleted yet, by examining it:
# deletionTimestamp has been set. This object has been marked for deletion.
# `resettable` annotation is enabled.
# This means the machine has to go through reset, before deletion of this object.
# `machineinventory.elemental.cattle.io` finalizer is set.
# The `elemental-operator` is going to create a reset plan for the machine to execute.
# After successful execution of the reset plan, the finalizer is removed and the object will be deleted.
# Most recent condition shows that the MachineInventory is waiting for a plan to be applied.
- lastTransitionTime: "2023-08-04T08:41:25Z"
message: waiting for plan to be applied
# The plan to be executed is referenced.
# Normally it has the same name of the MachineInventory and lives within the same namespace.
You can also examine the referenced plan
Note that the
elemental-system-agent running on the machine is watching this secret and it should execute the plan.
You can also monitor its progress from the machine logs:
journalctl -u elemental-system-agent -f.
# This is a `elemental.cattle.io/plan` secret plan.
# This is a `reset` plan type.
# It is owned by the `MachineInventory` waiting for deletion.
- apiVersion: elemental.cattle.io/v1beta1
# The plan has not been applied yet.
# It also hasn't failed.
# The actual plan to be executed, base64 encoded.
The plan created by the
elemental-operator should contain the following instructions:
// A cloud-init config file is created on the default /oem directory.
// This config will be executed once in recovery mode.
"name": "configure next boot to recovery mode",
"name": "schedule reboot",
elemental-system-agent successfully executed the plan, the
machineinventory.elemental.cattle.io finalizer on the
MachineInventory will be removed and the
MachineInventory will be deleted.
Note that this is not an indication that the machine has been fully reset yet.
This is a limitation of the current implementation and it will eventually improve, so that it will be possible to completely track the reset status.
However, at this stage we do expect the host to undergo reboot, and reboot in recovery mode.
Once in recovery mode, the
cos-setup-network should execute the cloud-init config that has been written on
You can monitor the status with
journalctl -u cos-setup-network -f.
The cloud-init instructions should look like the following:
name: Elemental Reset
- if: '[ -f /run/cos/recovery_mode ]'
name: Runs elemental reset
- systemctl start elemental-register-reset
elemental-register cli will register with the
elemental-operator as a new machine. This will lead to the creation of a new
MachineRegistration configuration will also be fetched to apply the reset options, for example
reset-oem, or the power settings, either
After reset, depending on the settings, the machine should either shut down or reboot and be ready to be adopted within a new cluster.
Forcefully deleting a MachineInventory undergoing reset
If the machine is unable to execute the reset instructions and the related
MachineInventory is not deleted, there are two equivalent ways you can manually fix the issue.
- Remove the
elemental.cattle.io/resettable: "true"annotation from the
- Remove the
machineinventory.elemental.cattle.iofinalizer from the
Remember to also take care of the machine itself, by fully reprovisioning it or rebooting into recovery mode and using the
elemental reset command directly.