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.11.tar.gz (92.5 kB view details)

Uploaded Source

Built Distributions

os_vm_expire-0.9.11-py3-none-any.whl (85.9 kB view details)

Uploaded Python 3

os_vm_expire-0.9.11-py2-none-any.whl (85.9 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: os-vm-expire-0.9.11.tar.gz
  • Upload date:
  • Size: 92.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.1 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/2.7.14

File hashes

Hashes for os-vm-expire-0.9.11.tar.gz
Algorithm Hash digest
SHA256 80cc11023c1f42112db877d39445002713016cef078b40d2d92d1478347e3c46
MD5 4fc8610c62a04179d74877fe091fcfa9
BLAKE2b-256 563e480aaa8ebcca1b961b9062cb661f984c5497aa737be538c54feb0d230cf2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: os_vm_expire-0.9.11-py3-none-any.whl
  • Upload date:
  • Size: 85.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.1 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.6.3

File hashes

Hashes for os_vm_expire-0.9.11-py3-none-any.whl
Algorithm Hash digest
SHA256 0d6e1beb47197b4f81aefd1204788026924a0c567ddc56a76b01c4d58abc2b3d
MD5 aa02f020f8a2ddb74e069b791419e0b6
BLAKE2b-256 04c574c56d13f8d474234acdb1b765363753a28f37e06fc007d49a7e755c6a10

See more details on using hashes here.

File details

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

File metadata

  • Download URL: os_vm_expire-0.9.11-py2-none-any.whl
  • Upload date:
  • Size: 85.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.1 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/2.7.14

File hashes

Hashes for os_vm_expire-0.9.11-py2-none-any.whl
Algorithm Hash digest
SHA256 1df6a2899a888a3bfac19d3eca14cd770ddd59995d62c5367264644ad0cd7408
MD5 69f08f94e1a6420f5599f28e6cc6b51a
BLAKE2b-256 ba61886fa1023178ba55343902ee1879cbfbc56cd5ebef0d250f725d71f5eb7d

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