1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-24 02:03:52 +03:00

Added some hook samples to oned.conf and modified SHUTDOWN hook

git-svn-id: http://svn.opennebula.org/one/trunk@462 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
Rubén S. Montero 2009-04-09 23:31:41 +00:00
parent 3ae441a176
commit 0ec3d2e084
2 changed files with 29 additions and 13 deletions

View File

@ -179,34 +179,50 @@ TM_MAD = [
# absolute path or relative to $ONE_LOCATION/lib/mads (or
# /usr/lib/one/mads/ if OpenNebula was installed in /)
#
# arguments : for the driver executable, can be an absolute path or relative
# to $ONE_LOCATION/etc (or /etc/one/ if OpenNebula was installed
# arguments : for the driver executable, can be an absolute path or relative
# to $ONE_LOCATION/etc (or /etc/one/ if OpenNebula was installed
# in /)
#
# Virtual Machine Hooks (VM_HOOK) defined by:
# name : for the hook, useful to track the hook (OPTIONAL)
# on : when the hook should be executed
# 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)
# - RUNNING, after the VM is successfully booted
# - SHUTDOWN, after the VM is shutdown
# - STOP, after the VM is stopped (including VM image transfers)
# command : use absolute path here
# arguments : for the hook. You can access to VM template variables with $
# - $ATTR, the value of an attribute e.g. $NAME or $VM_ID
# - $ATTR[VAR], the value of a vector e.g. $NIC[MAC]
# - $ATTR[VAR, COND], same of previous but COND select between
# - $ATTR[VAR, COND], same of previous but COND select between
# multiple ATTRs e.g. $NIC[MAC, NETWORK="Public"]
# remote : values,
# - YES, The hook is executed in the host where the VM was
# allocated
# - NO, The hook is executed in the OpenNebula server (default)
#-------------------------------------------------------------------------------
HM_MAD = [
executable = "one_hm" ]
#-------------------------------------------------------------------------------
#-------------------------------- Hook Examples --------------------------------
#VM_HOOK = [
# name = "dhcp",
# on = "create",
# command = "/bin/echo",
# arguments = "$NAME $NIC[MAC] > /tmp/test.$VM_ID" ]
# arguments = "$NAME > /tmp/test.$VM_ID" ]
#-------------------------------------------------------------------------------
#VM_HOOK = [
# name = "ebtables",
# on = "running",
# command = "/usr/local/one/bin/set_net",
# arguments = '$NIC[MAC, Network = "Private"]',
# remote = "yes" ]
#-------------------------------------------------------------------------------
#VM_HOOK = [
# name = "mail",
# on = "running",
# command = "/usr/local/one/bin/send_mail",
# arguments = "$VM_ID $NAME",
# remote = "no" ]
#------------------------------------------------------------------------------

View File

@ -101,7 +101,7 @@ VirtualMachinePool::VirtualMachinePool(SqliteDB * db,
VirtualMachineStateHook * hook;
hook = new VirtualMachineStateHook(name, cmd, arg, remote,
VirtualMachine::LCM_INIT, VirtualMachine::DONE);
VirtualMachine::EPILOG, VirtualMachine::ACTIVE);
add_hook(hook);
state_hook = true;