1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-11 05:17:41 +03:00

feature #476: new hook trigger on PROLOG

This commit is contained in:
Jaime Melis 2011-06-07 17:58:25 +02:00
parent cefb00c9ea
commit 5e3258c6f6
2 changed files with 11 additions and 0 deletions

View File

@ -315,6 +315,7 @@ IMAGE_MAD = [
# name : for the hook, useful to track the hook (OPTIONAL)
# on : when the hook should be executed,
# - CREATE, when the VM is created (onevm create)
# - PROLOG, when the VM is in the prolog state
# - RUNNING, after the VM is successfully booted
# - SHUTDOWN, after the VM is shutdown
# - STOP, after the VM is stopped (including VM image transfers)

View File

@ -93,6 +93,16 @@ VirtualMachinePool::VirtualMachinePool(SqlDB * db,
add_hook(hook);
}
else if ( on == "PROLOG" )
{
VirtualMachineStateHook * hook;
hook = new VirtualMachineStateHook(name, cmd, arg, remote,
VirtualMachine::PROLOG, VirtualMachine::ACTIVE);
add_hook(hook);
state_hook = true;
}
else if ( on == "RUNNING" )
{
VirtualMachineStateHook * hook;