Unit statesΒΆ

The unit status is the way to know what is happening with a unit. You can use the tsuru app-info -a <appname> to see the unit status:

$ tsuru app-info -a tsuru-dashboard
Application: tsuru-dashboard
Repository: git@localhost:tsuru-dashboard.git
Platform: python
...
Units: 1
+------------+---------+
| Unit       | State   |
+------------+---------+
| 9cf863c2c1 | started |
+------------+---------+

The unit state flow is:

+----------+                           start          +---------+
| building |                   +---------------------+| stopped |
+----------+                   |                      +---------+
      ^                        |                           ^
      |                        |                           |
 deploy unit                   |                         stop
      |                        |                           |
      +                        v       RegisterUnit        +
 +---------+  app unit   +----------+  SetUnitStatus  +---------+
 | created | +---------> | starting | +-------------> | started |
 +---------+             +----------+                 +---------+
                               +                         ^ +
                               |                         | |
                         SetUnitStatus                   | |
                               |                         | |
                               v                         | |
                           +-------+     SetUnitStatus   | |
                           | error | +-------------------+ |
                           +-------+ <---------------------+
  • created: is the initial status of an unit.
  • building: is the status for units being provisioned by the provisioner, like during deployment.
  • error: is the status for units that failed to start, because of an application error.
  • starting: is set when the container is started in docker.
  • started: is for cases where the unit is up and running.
  • stopped: is for cases where the unit has been stopped.