Decommission a device using the Flight Control CLI

You can decommission a device by using the Flight Control CLI to request that the Red Hat Edge Manager service unenroll it and permanently remove its management identity.

Before you begin

  • You must install the Flight Control CLI. See Installing the Flight Control CLI in the Additional resources section.
  • You must log in to the Red Hat Edge Manager service.
  • You must know the device name in the inventory. See View device inventory and device details in the Additional resources section.

Procedure

  1. Request decommissioning for the device by running the following command:
    flightctl decommission devices/<device_name>
  2. Verify that the service accepted the request by retrieving the device in YAML format:
    flightctl get devices/<device_name> -o yaml

    The specification must include a decommissioning target, and status.lifecycle.status must move to Decommissioning. For example:

    spec:
      decommissioning:
        target: Unenroll
    status:
      lifecycle:
        status: Decommissioning
  3. Wait until the device acknowledges decommissioning. In the device YAML, confirm a condition with type: DeviceDecommissioning, reason: Completed, and a message that the device completed decommissioning and will wipe its management certificate. When decommissioning ends on the device, the agent removes its local status files from the agent data directory (by default /var/lib/flightctl), including desired.json, current.json, and rollback.json. The agent then wipes its management certificate and private key and reboots.
    status:
      conditions:
        - lastTransitionTime: "2025-03-05T20:40:48.443917332Z"
          message: The device has completed decommissioning and will wipe its management
            certificate
          reason: Completed
          status: "True"
          type: DeviceDecommissioning
  4. When status.lifecycle.status shows Decommissioned, delete the device resource:
    flightctl delete devices/<device_name>