Agent

A Juju agent is a running instance of the jujud binary.

There are controller agents, unit agents, and machine agents. An agent performs different roles depending on this. A controller agent is responsible for running the controller node. A unit agent is responsible for managing the lifecycle of units running on the machine. A machine agent manages its respective unit agents. In particular, it is the machine agent that creates the unit agent. A machine agent also manages any containers that may be requested on that machine and also the resources on the machine, for example, storage for the units.

In general, all agents track state changes, respond to those changes, and pass updated information back to the controller. A model’s status (status command) is built up from the communication between a controller and all the agents running in that model. Agents are also responsible for all logging that goes on in Juju.

The agent’s software version is generally consistent across a controller (and its models) and is thus determined at controller-creation time. By default the agent uses the same version as that of the local Juju client but this can be tweaked if desired. See Agent versions and streams for how to do this.

An agent is managed manually by accessing the machine it’s running on and referring to its systemd service. For example, to restart the machine agent on machine ‘2’:

juju ssh 2 sudo service jujud-machine-2 restart