<div dir="ltr">yup. Now add the sys.stderr.write line somewhere, with a marker you can grep for, and try, then check the vdsm.log file for the marker. I'd also add an external log dump for the development testing, and comment it out before going into production</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 12, 2016 at 11:02 AM, Jean-Pierre Ribeauville <span dir="ltr"><<a href="mailto:jpribeauville@axway.com" target="_blank">jpribeauville@axway.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="FR" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">173078 4 -rwxrwxrwx. 1 vdsm kvm 1292 Jan 12 15:51 test_hook.py<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Looks fine , isn’t ?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">J.P.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">De :</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Dan Yasny [mailto:<a href="mailto:dyasny@gmail.com" target="_blank">dyasny@gmail.com</a>]
<br>
<b>Envoyé :</b> mardi 12 janvier 2016 17:00</span></p><div><div class="h5"><br>
<b>À :</b> Jean-Pierre Ribeauville<br>
<b>Cc :</b> <a href="mailto:users@ovirt.org" target="_blank">users@ovirt.org</a><br>
<b>Objet :</b> Re: [ovirt-users] vdsm hook issues<u></u><u></u></div></div><p></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">So, to make is work, you need to chown 36:36 and chmod +x for 36:36 of course. <u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">As for logging, since the hook is run under the vdsm context, you can tap right into the logging of vdsm, or you can write your own log file, whatever you prefer to code. <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">See <a href="https://github.com/oVirt/vdsm/blob/master/vdsm_hooks/vmfex/before_vm_start.py" target="_blank">https://github.com/oVirt/vdsm/blob/master/vdsm_hooks/vmfex/before_vm_start.py</a> line 197 - sys.stderr.write will actually dump into the vdsm log.<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Tue, Jan 12, 2016 at 10:55 AM, Jean-Pierre Ribeauville <<a href="mailto:jpribeauville@axway.com" target="_blank">jpribeauville@axway.com</a>> wrote:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">/usr/share/vdsm/hooking.py is present on my host.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">I placed my test_hook.py in /usr/libexec/vdsm/hooks/before_vm_start</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">As I want to have it invoked for every started VM , I don’t need custom property ;
Am I right ?</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Remains the point “</span><span lang="EN-US">make it accessible to vdsm:kvm” what do
you mean ?</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">BTW , are vdsm hooks log infos located in /var/log/vdsm/vdsm.log ?</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Thx for help.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">J.P.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">De :</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Dan Yasny [mailto:<a href="mailto:dyasny@gmail.com" target="_blank">dyasny@gmail.com</a>]
<br>
<b>Envoyé :</b> mardi 12 janvier 2016 16:48</span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><br>
<b>À :</b> Jean-Pierre Ribeauville<br>
<b>Cc :</b> <a href="mailto:users@ovirt.org" target="_blank">users@ovirt.org</a><br>
<b>Objet :</b> Re: [ovirt-users] vdsm hook issues<u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">OK, so the hooking module is included in the vdsm package itself. Please make sure you have /usr/share/vdsm/hooking.py on the host.<u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">The manual run fails, because it is not running in the vdsm context, and so the modules imported are the python site-packages and not the submodules under vdsm. <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">To make a hook work, you need to place it on the host, make it accessible to vdsm:kvm, and maybe define a custom property, if you don't want the hook to just run on every started
VM. <u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">On Tue, Jan 12, 2016 at 10:35 AM, Jean-Pierre Ribeauville <<a href="mailto:jpribeauville@axway.com" target="_blank">jpribeauville@axway.com</a>> wrote:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi,</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">1° It’s a full RHEL7 OS.<br>
2° <br>
vdsm-python-zombiereaper-4.16.27-0.el7.centos.noarch</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">vdsm-python-4.16.27-0.el7.centos.noarch</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">vdsm-yajsonrpc-4.16.27-0.el7.centos.noarch</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">vdsm-xmlrpc-4.16.27-0.el7.centos.noarch</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">vdsm-cli-4.16.27-0.el7.centos.noarch</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">vdsm-jsonrpc-java-1.0.15-1.el7.noarch</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">vdsm-jsonrpc-4.16.27-0.el7.centos.noarch</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">vdsm-4.16.27-0.el7.centos.x86_64</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:18.0pt">
<span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> 3°
</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:18.0pt">
<span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">#!/usr/bin/python</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">1)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">2)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">import os</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">3)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">import sys</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">4)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">import grp</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">5)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">import pwd</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">6)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">import traceback</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">7)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">8)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">import hooking</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">9)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">10)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">def createChannelElement(domxml):</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">11)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> '''</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">12)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> <channel type='unix'></span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">13)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> <source mode='bind' path='//var/lib/libvirt/qemu/VM_RHEL7-1_omnivision_1.agent'/></span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">14)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> <target type='virtio' name='omnivision_1.agent'/></span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">15)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </channel></span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">16)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> '''</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">17)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">18)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> channel = domxml.createElement('channel')</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">19)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> disk.setAttribute('type', 'unix')</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">20)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">21)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> source = domxml.createElement('source')</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">22)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> source.setAttribute('mode', 'bind')</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">23)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">24)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> # find domain name</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">25)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> domainame = domxml.getElementsByTagName('name')</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">26)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">27)</span><span style="font-size:7.0pt;color:#1f497d">
</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> source.setAttribute('path', '//var/lib/libvirt/qemu/' + domainame + '_omnivision_1.agent')</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">28)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">disk.appendChild(source)</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">29)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">30)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> target = domxml.createElement('target')</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">31)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> target.setAttribute('type', 'virtio')</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">32)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> target.setAttribute('name', 'omnivision_1.agent')</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">33)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> disk.appendChild(target)</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">34)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">35)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> return channel</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">36)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">37)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">try:</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">38)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> domxml = hooking.read_domxml()</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">39)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> devices = domxml.getElementsByTagName('devices')[0]</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">40)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> channeldev = createChannelElement(domxml)</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">41)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> sys.stderr.write('createChannel: adding xml: %s\n' % channeldev.toxml())</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">42)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> devices.appendChild(channeldev)</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">43)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">44)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> hooking.write_domxml(domxml)</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">45)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">except:</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">46)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> sys.stderr.write('createChannel: [unexpected error]: %s\n' %</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">47)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> traceback.format_exc())</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">48)</span><span lang="EN-US" style="font-size:7.0pt;color:#1f497d">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> sys.exit(2)</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Thx for help.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Regards,</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">J.P.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">De :</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Dan Yasny [mailto:<a href="mailto:dyasny@gmail.com" target="_blank">dyasny@gmail.com</a>]
<br>
<b>Envoyé :</b> mardi 12 janvier 2016 16:23<br>
<b>À :</b> Jean-Pierre Ribeauville<br>
<b>Cc :</b> <a href="mailto:users@ovirt.org" target="_blank">users@ovirt.org</a><br>
<b>Objet :</b> Re: [ovirt-users] vdsm hook issues</span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">1. Are you using a full OS or a node?<u></u><u></u></p>
<div>
<p class="MsoNormal">2. rpm -qa |grep vdsm<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">3. if possible, post the hook code<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">On Tue, Jan 12, 2016 at 10:17 AM, Jean-Pierre Ribeauville <<a href="mailto:jpribeauville@axway.com" target="_blank">jpribeauville@axway.com</a>> wrote:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Hi,</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">1) is it enough to add a hook.py in /usr/libexec/vdsm/hooks/before_vm_start directory , and then shut down and reboot a guest to</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> see this hook.py invoked ?</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">2) when running manually my hook.py, I got following error :
</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> ImportError: No module named hooking</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> Do I have to install anything to solve this issue ?</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal">Thanks for help.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Regards,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:0cm 4.5pt 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Arial","sans-serif";color:#888888"> </span></b><u></u><u></u></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:8.5pt;font-family:"Arial","sans-serif";color:#888888">J.P. Ribeauville</span></b><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.5pt;font-family:"Arial","sans-serif";color:#737373"> </span><u></u><u></u></p>
</td>
</tr>
<tr>
<td style="padding:2.25pt 4.5pt 4.5pt 0cm">
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:"Arial","sans-serif";color:red">P:
</span><span style="font-size:8.5pt;font-family:"Arial","sans-serif";color:#737373"><a href="tel:%2B33.%280%29.1.47.17.20.49" target="_blank">+33.(0).1.47.17.20.49</a></span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:"Arial","sans-serif";color:#737373">.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:"Arial","sans-serif";color:#737373">Puteaux 3 Etage 5 Bureau 4</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:"Arial","sans-serif";color:#737373"> </span><u></u><u></u></p>
<p class="MsoNormal"><u><span lang="EN-US" style="font-size:9.0pt;color:red"><a href="mailto:jpribeauville@axway.com" target="_blank"><span lang="FR">jpribeauville@axway.com</span></a></span></u><u><span style="font-size:9.0pt;color:red"><br>
</span></u><span style="font-size:9.0pt;color:red"><a href="http://www.axway.com/" target="_blank"><span style="color:red">http://www.axway.com</span></a></span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:"Arial","sans-serif";color:#737373"> </span><u></u><u></u></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"> <u></u><u></u></p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:4.5pt 4.5pt 4.5pt 0cm">
<p class="MsoNormal"><span style="font-size:18.0pt;font-family:Webdings;color:#888888">P</span><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#888888"> Pensez à l’environnement
avant d’imprimer.</span><u></u><u></u></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@ovirt.org" target="_blank">Users@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/users" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a><u></u><u></u></p>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>
</blockquote></div><br></div>