Hardware Observer

  • Canonical BootStack Charmers
Channel Revision Published Runs on
latest/stable 84 02 Jul 2024
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/stable 13 01 Nov 2023
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/candidate 113 15 Oct 2024
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/candidate 112 15 Oct 2024
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/candidate 13 30 Oct 2023
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/edge 125 19 Nov 2024
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/edge 124 19 Nov 2024
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/edge 119 11 Nov 2024
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/edge 118 11 Nov 2024
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/edge 15 03 Nov 2023
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
juju deploy hardware-observer
Show information

Platform:

Ubuntu
24.04 22.04 20.04 18.04

Lifecycle of the hardware-observer charm

This document describes the details of each event handler in hardware-observer.

The diagram above shows the basic lifecycle of the hardware-observer charm.

Install/ upgrade-charm

  • During these events we install all the required user uploaded resources after checking the available collectors present on the host and populating the “hw_tool_enable_list”.
  • If everything goes well, we store the successful resource installed state in StoredState so that it can be used later on during the checks in update-status event handler.
  • The charm also notifies the user during this event in case of any missing resources that are required to be uploaded by setting the application status to Blocked.
  • Then we proceed to install all the exporters (currently prometheus-hardware-exporter and smartctl_exporter).
  • Finally we execute the update_status event handler to ensure that the right charm status is set.

Remove

  • Remove all enabled tools and hardware resources that have been uploaded by the user and installed on the host by the charm.
  • Remove all installed exporters.
  • Remove the charm itself.

Update-status

  • Set the required charm’s status to “Blocked” based on various conditions.
    • If all resources are not installed
    • if cos-agent relation is not present
    • If exporter config is not correctly provided
    • If any enabled hardware tools have not been installed correctly
    • If any of the exporters are not healthy (service failed for some reason)
  • Otherwise, set the charm’s status to “Active”.

Config-changed

  • We defer the event in case all required resources have not been uploaded and installed.
  • If the cos-agent relation is present, then we validate the provided config to make sure it’s proper and render the configuration file for each exporter. If the config file setup fails for any reason, we set the charm’s status to “Blocked” with an appropriate status message.
  • Finally we execute the update-status event handler to ensure that the right charm status is set.

Cos-agent relation joined

  • Defer the event in case the resources have not been uploaded and installed.
  • Once that’s done, we proceed to enable and start each exporter service.
  • Run update-status event handler to ensure the right charm status is set.

Cos-agent relation departed

  • Disable and stop each running exporter service.
  • Run update-status event handler to ensure the right charm status is set.

Help improve this document in the forum (guidelines). Last updated 5 months ago.