From 85492585aed9c86238734f9cb862f764496afdd6 Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Wed, 12 Aug 2015 10:39:15 +0200 Subject: [PATCH] Ajout des variables Creole pour la gestion des hooks de VM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Création d'une famille "Hook" pour contenir tous les types de hook Ajout des variables hapy_vm_hook* pour la gestion des hook de VM perso Utilisation des variables dans le template oned.conf fixes #12522 @2h --- dicos/99_one-master.xml | 43 ++++++++++++++++++++++++++++++++++++++++- tmpl/oned.conf | 23 ++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/dicos/99_one-master.xml b/dicos/99_one-master.xml index a290c46..8a98e09 100644 --- a/dicos/99_one-master.xml +++ b/dicos/99_one-master.xml @@ -65,6 +65,21 @@ + + non + + + + + + + + + non + + + + @@ -158,10 +173,36 @@ l2_vnet_vlan_trunk arp_cache_poisoning + + + non + Hooks + + + + ['CREATE','RUNNING','SHUTDOWN','STOP','DONE','UNKNOWN','FAILED','CUSTOM'] + + + + hapy_vm_hook_on + hapy_vm_hook_command + hapy_vm_hook_arguments + hapy_vm_hook_remote + hapy_vm_hook_state + hapy_vm_hook_lcm_state + + Interface d'administration du Cluster OpenNebula. Active la protection contre les attaques par empoisonnement ARP. Non compatible avec les réseaux de Niveau 2 - + Activer la création de hook personnalisée sur le serveur Hâpy (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html) + Nom du Hook de machine virtuelle (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html) + Déclancheur du Hook (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html) + Script lancé par le Hook (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html) + Arguments passés au script lancé par le Hook de machine virtuelle (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html) + Exécuter le script sur le noeud plutôt que sur le maitre (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html) + État attendus par le hook lorsque le déclancheur est "CUSTOM" (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html) + État LCM attendus par le hook lorsque le déclancheur est "CUSTOM" (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html) diff --git a/tmpl/oned.conf b/tmpl/oned.conf index b3ffdfc..013dd64 100644 --- a/tmpl/oned.conf +++ b/tmpl/oned.conf @@ -596,6 +596,29 @@ VM_HOOK = [ remote = "YES" ] +%if %%getVar('activer_vm_hooks', 'non') == 'oui' +#******************************************************************************* +# Personal Hooks +#******************************************************************************* + %for %%hook in %%hapy_vm_hook +VM_HOOK = [ + name = "%%hook" + on = "%%hook.hapy_vm_hook_on" + %if %%hook.hapy_vm_hook_on == "CUSTOM" + state = %%hook.hapy_vm_hook_state + lcm_state = %%hook.hapy_vm_hook_lcm_state + %end if + command = "%%hook.hapy_vm_hook_command" + arguments = "%%hook.hapy_vm_hook_arguments" + %if %%hook.hapy_vm_hook_remote == 'oui' + remote = "YES" + %else + remote = "NO" + %end if +] + %end for +%end if + HM_MAD = [ executable = "one_hm" ]