Constraints on expiration (machine leases)
Expiration constraints, or machine leases, help you reduce machine sprawl and avoid long forgotten VMs running in vain for months.
Mist can automatically turn off or destroy machines when their expiration period lapses. Before this action happens, it can also notify relevant team members over email so they have the chance to take action.
Please keep in mind that only members of the Owners team can manage constraints. Also, constraints are available only in Mist Hosted Service (HS) and Mist Enterprise Edition (EE).
Example
Let’s assume you would like to apply the following constraints:
- Machines created by members of the Dev team must be set to expire in less than 30 days.
- By default, machines will expire in 7 days.
- When a machine expires, Mist will automatically destroy or stop it.
- The default action will be to automatically destroy the machine.
- The owner of the machine will receive an email notification 1 day before the machine expires.
To set this up, from the Teams section:
- Make sure you belong to the Owners team.
- Click on the Dev team.
- Click the gear icon next to the team policy that applies to machines.
- Fill out the fields with the relevant expiration parameters as shown below.
- Don't forget to click OK and then SAVE POLICY for the changes to take effect.
If you prefer to input your policy in JSON, you can switch to JSON mode from the top right of the web form.
In this example, the JSON equivalent would be:
{ "expiration": { "max": "30d", "default": "7d", "actions": { "available": [ "destroy", "stop", "undefine" // Only for KVM machines ], "default": "destroy" }, "notify": { "default": "1d", "require": true, "msg": "Contact Joe for help" } } }