Skip to main content

Manage VM expiration and deletion

Project description

Manage VM expiration and auto-deletion in an Openstack cloud.

This project is an unofficial Openstack project, but follows Openstack projects architecture, with a Horizon plugin and associated services.

The Openstack VmExpiration Management service adds an expiration to VMs. After expiration, VM is deleted. User can extend the VM lifetime via API or Horizon. Expiration extend is not limited, user can always extend a VM, but it will be extended only for a configured duration. User cannot extend it more than configured duration. Example:

  • date A: VM is created, VM will expire at A + N days

  • some days before expiration user is notified

  • user extend VM to today + M days (M is configuration based, user cannot specify it)

  • if user tries to extend VM again, it will be extend again to today + M days

Requirements

Nova notifications need to be enabled to get VM start and end messages.

Software has been tested on Pike and Otaca, and in single and multi domain configuration. It *should* work from **Newton.

Features

  • On VM creation, add an expiration date

  • On near-expiration date, send an email to user

  • Horizon plugin to view VM expiration and extend expiration time

  • On expiration date, delete the VM and send an email to user

  • CLI commands to extend a VM or remove expiration from a VM (admin only)

Configuration

Configuration files are expected in directory /etc/os-vm-expire/ :

  • osvmexpire.conf

  • policy.json

  • osvmexpire-api-paste.ini (for wsgi server)

Main configuration file can be specified via environment variable OSVMEXPIRE_CONFIG.

Components

Start API server

For dev (port 8000)

export OSVMEXPIRE_PORT=9411 # optional
osvmexpire-wsgi-api

For prod

uwsgi --master --die-on-term --emperor /etc/os-vm-expire/vassals --logto /var/log/os-vm-expire/osvmexpire-api.log --stats localhost:9314

Start worker

Manage nova notifications on instance creation and deletion to create/delete expiration objects.

osvmexpire-worker --config-file /etc/os-vm-expire/osvmexpire.conf

Start cleaner

Checks expiration time of VMs and sends notifications before expiration to let use extend the VM if necessary. Once expiration is reached (and if user could be notified of expiration), deletes the VM.

osvmexpire-cleaner --config-file /etc/os-vm-expire/osvmexpire.conf

CLI usage

Those command-line tools need access to configuration file, so are dedicated to administer the tool, not for end user.

osvmexpire-manage vm list
osvmexpire-manage vm extend -h
osvmexpire-manage vm remove -h

Credits

Code is mostly inspired (code base coming from) the Barbican Openstack project, code was more or less updated to manage different objects. This project takes the same license and kept original file headers.

This project was developed by the GenOuest core facility, IRISA, France.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

os-vm-expire-0.9.6.tar.gz (90.0 kB view details)

Uploaded Source

Built Distributions

os_vm_expire-0.9.6-py3-none-any.whl (83.0 kB view details)

Uploaded Python 3

os_vm_expire-0.9.6-py2-none-any.whl (83.0 kB view details)

Uploaded Python 2

File details

Details for the file os-vm-expire-0.9.6.tar.gz.

File metadata

File hashes

Hashes for os-vm-expire-0.9.6.tar.gz
Algorithm Hash digest
SHA256 6ab7dc329d6ae04eb8a01a23a6e120aee8d7f846110c2a78a78c426e4829b9ae
MD5 a62a773d12c55ca56f16250f5bdd46c8
BLAKE2b-256 c55d51d00fcd1ac441f6745d3d58b372818ef442cf9f8a15ebc4cd9690d55709

See more details on using hashes here.

File details

Details for the file os_vm_expire-0.9.6-py3-none-any.whl.

File metadata

File hashes

Hashes for os_vm_expire-0.9.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0a99f36d7e5b1364a3d66440bf8e50bd1f73d3ae22c7e2e49f0fb0158aa42ca3
MD5 2d8954abd11fc02c9a598a2407d9055c
BLAKE2b-256 06ee70d04a879fd35cdee16177ae707df9e1c3c3b65bb5c2fd4c74c3fc2ddaaf

See more details on using hashes here.

File details

Details for the file os_vm_expire-0.9.6-py2-none-any.whl.

File metadata

File hashes

Hashes for os_vm_expire-0.9.6-py2-none-any.whl
Algorithm Hash digest
SHA256 a79c8c2f635a1047c0550e74e795feff28ae62f7060f5708bf5b35da14373754
MD5 bd58f20089162d8b1bcd9d708637e2e5
BLAKE2b-256 ac894a7fe7dddddc94103ff3639b8c212f0917b370db1df6be4a77e960c3ef80

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page