Skip to main content

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.

Metadata

Release files for os-vm-expire 0.9.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for os-vm-expire 0.9.12
File Size Uploaded
os-vm-expire-0.9.12.tar.gz 92.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for os-vm-expire 0.9.12
File Interpreter ABI Platform
os_vm_expire-0.9.12-py3-none-any.whl Python 3 none any Details
os_vm_expire-0.9.12-py2-none-any.whl Python 2 none any Details

Total release size: 264.4 kB

Release files / os-vm-expire-0.9.12.tar.gz

Download URL os-vm-expire-0.9.12.tar.gz
Size 92.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4a31c375a03db9b399c72420c4ce36fc23b009428a508103bf8e2eeb3d52e0f4
BLAKE2b-256 checksum
How to use checksums
291a756fddb2c1a5e76cdb4e82283373048ee8116773f3de49bc68f2e471db07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.14

Release files / os_vm_expire-0.9.12-py3-none-any.whl

Download URL os_vm_expire-0.9.12-py3-none-any.whl
Size 85.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
702847b6e392f2d74d57a8b411a987b9b705860463a393a8f8908bb5848dfc66
BLAKE2b-256 checksum
How to use checksums
1a6c584b76905f21050a1f6893747ed8653f0a0d6a70f5cb4d031d2d1d3a289a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.4.6

Release files / os_vm_expire-0.9.12-py2-none-any.whl

Download URL os_vm_expire-0.9.12-py2-none-any.whl
Size 85.9 kB
Tags Python 2
SHA-256 checksum
How to use checksums
6c8528c9bcf2601956a69fad7181d87c56cf04e1c310e3eb8e24a4e4ec7cd0ee
BLAKE2b-256 checksum
How to use checksums
a9c70d17d33164eb4731208de0c51e81da65b81cec512e6dfd70d5756ae1ee27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.14

Release history Release notifications | RSS feed

This release

0.9.12 This release

3 release files

0.9.11

3 release files

0.9.9

3 release files

0.9.8

3 release files

0.9.7

3 release files

0.9.6

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page