Constraints on expiration (machine leases)

Expiration constraints (leases) can help you reduce machine sprawl. You no longer have to spend valuable time trying to figure out who owns a machine and what to do with it.

Organization owners can impose expiration constraints to all machines created or edited through Mist.

For example, let’s assume you have the following expiration policy:

  • Machines created by the Dev team will expire in less than 30 days.
  • The default expiration will be in 7 days.
  • When a machine expires, it will either be automatically destroyed or stopped.
  • The default action will be to automatically destroy the machine.
  • The owner of the machine must receive an email notification 1 day before the machine expires.

To set this up, from the Teams section:

  1. Make sure you belong to the Owners team.
  2. Click on the Dev team.
  3. Click the gear icon next to an RBAC policy that applies to machines.
  4. Input a JSON with the relevant expiration parameters.

In this example, the JSON looks like this:

{
  "expiration": {
    "max": "30d",
    "default": "7d",
    "actions": {
      "available": [
        "destroy",
        "stop"
      ],
      "default": "destroy"
    },
    "notify": {
      "default": "1d",
      "require": true,
      "msg": "Contact Joe for help"
    }
  }
}

Please keep in mind that expiration constraints are supported in Mist v4.2 and later. Also, they are available only in Mist Hosted Service (HS) and Mist Enterprise Edition (EE).

Still need help? Contact Us Contact Us