One of the major use cases for using private cloud & OpenStack is running labs; these labs can be for your dev, qa or sales organization. In these labs, OpenStack is used to create various infrastructure objects (Instances, Images, Volumes etc) on demand for development, test or demonstration purposes. OpenStack makes it very easy to enable self-service for infrastructure automation, but users typically forget to delete unused objects which can result in high resource usage. From our own experience creating 100s of instances with every build, the number of instances can grow quickly and if left unchecked, our lab cluster runs out of resources in a matter of days.

Mors – A Lease Manager for OpenStack

To solve the common problem of ‘forgotten’ instances in lab environments, Platform9 has introduced a new OpenStack service Mors, (http://github.com/openstack/mors, http://launchpad.net/mors). Mors is open source and we are working to make it an official OpenStack project. Mors, named after the Roman god of death, is a lease manager for various OpenStack objects.

How to Use Mors

Administrators can enable or disable Mors on any tenant in OpenStack. Once enabled, an administrator can set up a ‘lease’ duration for instances. For a tenant managed by Mors, the instances will be deleted when their lease expires. The default expiry of a lease is:

instance.expiration_time = instance.created_time + tenant.lease_duration

A user can renew his instance lease anytime as long as the duration of extension is less than or equal to the tenant lease policy, in other words:

max_instance_lease <= now + tenant.lease_duration

A user can always come back at a later point of time and renew the release again.

Instance leases can be modified by both ‘member’ and ‘admin’ roles. Tenant lease policies can be added, removed, modified by ‘admin’ roles only.

Architecture

Roadmap

This is a small start and we already have a lot of interesting features in the roadmap such as ‘notifications’ for lease expiration to the owner, adding more sophisticated policies like powering off instances before deleting them, adding a lease for Glance images and other OpenStack objects. We would love to hear your feedback and more than welcome participation from the active OpenStack community. Please check out the project at http://launchpad.net/mors & https://github.com/openstack/mors.