Backlog #4136
Include support to use "epilog" and "prolog" scripts within VMM scripts
Status: | Pending | Start date: | 11/05/2015 | |
---|---|---|---|---|
Priority: | High | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | Drivers - VM | |||
Target version: | - |
Description
This is a request to include epilog and prolog scripts support to by executed by VMM scripts inside the hypervisors. A good example was included by Atodorov Storpool in this thread:
https://forum.opennebula.org/t/question-about-vmm-actions-and-libvirt-options/1433/5
Including epilog and prolog scripts defined by the user we will able to activate some administrative actions as oneadmin user during VMM executions for different VM states (copy,migrate, mv) like:
- Update/set firewall rules
- Update Kerberos tickets
- Perform image backups before VM deletion
...
etc
Cheers
Alvaro
History
#1 Updated by Anton Todorov over 5 years ago
IMO not only VMM but almost (if not) all scripts should have such feature.
or all to have only one generic loader
#!/bin/bash [ -d "${0}.d" ] && for hook in "${0}.d"/* ; do source "$hook"; done
and all code to be placed in the `.../script.d/50-upstream_code`.
Even more it would be useful to split the code by stages/function... I don’t know how to name it properly/, so we could "insert" logic in the middle/or key places/ of the script.
For example this is what I am patching to add our datastore monitoring:
https://github.com/OpenNebula/addon-storpool/blob/master/patches/im/4.14/00-monitor_ds.patch
and in the inserted file, if the requested Datastore is on storpool storage I am composing response and iterating the loop in the parent im/monitor_ds.sh:
https://github.com/OpenNebula/addon-storpool/blob/master/datastore/storpool/monitor_ds.sh#L65
Cheers,
Anton
#2 Updated by Ruben S. Montero over 5 years ago
- Tracker changed from Feature to Backlog
- Target version set to Release 5.0
#3 Updated by Ruben S. Montero over 5 years ago
- Priority changed from Normal to High
- Target version deleted (
Release 5.0)