[ovirt-users] vdsm hook after node upgrade

2022-04-12 Thread Nathanaël Blanchet

Hi,

I've upgraded my hosts from 4.4.9 to 4.4.10 and none of my vdsm hooks 
are present anymore... i believed those additionnal personnal data were 
persistent across update...


--
Nathanaël Blanchet

Supervision réseau
SIRE
227 avenue Professeur-Jean-Louis-Viala
34193 MONTPELLIER CEDEX 5   
Tél. 33 (0)4 67 54 84 55
Fax  33 (0)4 67 54 84 14
blanc...@abes.fr
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/XZIF7CRTSE2BAECCZ72M2EH7F4I5FYQ7/


[ovirt-users] vdsm hook

2018-08-20 Thread 董青龙
Hi all,
I want to write a hook in which name or id of the vm can be acquired 
and the hook should be executed before the vm shutdown. I could acquire name or 
id of the vm in a before_vm_start hook using "hooking.read_domxml()". However, 
it did not work in a before_vm_destroy hook. So what should I do? Can Anyone 
give me some advice? Thanks a lot!___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/OL3HQTHG6C4DZ7R7DZAIX5Z3QCLW6IBW/


Re: [ovirt-users] vdsm hook noipspoof on interface level

2018-04-27 Thread Eitan Raviv
Probably an easier solution than implementing a vdsm hook in code, would be
to use network filter parameters in the web-admin UI of the engine.

If the vNic profile of the network on the WAN interface (the one you would
like to restrict IPs on) has a clean-traffic filter, then you can specify a
different set of IPs for any interface using this network.
In the web-admin UI of the engine go to -
 Compute | Virtual machines |  | Network Interfaces | 
 and click  edit.

At the bottom of the edit form you can insert the ip pool for the interface
by specifying several key-value pairs where the key is 'IP' and the value
is the ip address (e.g. 192.168.122.13).

HTH




On Sun, Apr 15, 2018 at 3:24 AM, Peter Hudec  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
>
> Thanks,
>
> this was the last part into my puzzle, HOST INTERFACE params.
>
> The example hook provided in
> https://bugzilla.redhat.com/show_bug.cgi?id=1366905#c8,
> https://bugzilla.redhat.com/attachment.cgi?id=1232201 looks good, but
> it seems to set the IP param on all interfaces too, regardless on
> which interface the NIC PARAM is set.
>
> The hooks should be called per vNIC, as reading the
> https://www.ovirt.org/documentation/admin-guide/appe-VDSM_and_Hooks/#the
> - -vdsm-hook-domain-xml-object,
> the one/several of thees hooks should be used or maybe I'm wrong ;(
>
> Peter
>
> On 14/04/2018 07:04, Eitan Raviv wrote:
> > You might find the following useful:
> >
> > https://ovirt.org/develop/release-management/features/network/networkf
> ilterparameters/
> >
> >  HTH
> >
> > On Thu, Apr 12, 2018, 14:52 Peter Hudec  > > wrote:
> >
> > Hi,
> >
> > I would like to restrict of usage IP address on VMs. Thos could be
> > achied by usinf clear-filter instead of vdsm-no-mac-spoofing.
> >
> > I have found noipspoof vdsm hook,
> > https://github.com/oVirt/vdsm/tree/master/vdsm_hooks/noipspoof.
> >
> > This hook but set the filtering on all interfaces, the setting is
> > on VM level, not interface level. So if the there are more
> > interfaces on all of them. I would like just restrict the WAN
> > interface on multi homed VMs.
> >
> > Peter
> >
> > -- *Peter Hudec* Infraštruktúrny architekt phu...@cnc.sk
> >   > >
> >
> > *CNC, a.s.* Borská 6, 841 04 Bratislava Recepcia: +421 2  35 000
> > 100
> >
> > Mobil:+421 905 997 203 *www.cnc.sk *
> > >
> >
> > ___ Users mailing list
> > Users@ovirt.org 
> > http://lists.ovirt.org/mailman/listinfo/users
> >
>
>
> - --
> *Peter Hudec*
> Infraštruktúrny architekt
> phu...@cnc.sk 
>
> *CNC, a.s.*
> Borská 6, 841 04 Bratislava
> Recepcia: +421 2  35 000 100
>
> Mobil:+421 905 997 203
> *www.cnc.sk* 
>
> -BEGIN PGP SIGNATURE-
>
> iQIzBAEBCgAdFiEEqSUbhuEwhryifNeVQnvVWOJ35BAFAlrSm54ACgkQQnvVWOJ3
> 5BDz5A//dqyf9wnvkRCjEmeUkMsN72qL7o+utazM7L8S4sY4Pu6INsPhpy7QtwHw
> fyXbdrU9qy+5ts3g+yoxpsdkTWUk47m/6nQR3fiw0nXJu44/ABl+Hw4g0H3/k86f
> 7sYOYvZ8IfCpL9/2r1VRlP8j7e+CdI8Ltcjppn7PtKhPT03f87p2PT1pJd95DYS+
> GbqZZ6yOAUlePP/808+f7hYxKNz0ek1tf/ZxzLgSJsCl1PsIhKiCBiuze/5hdeL5
> /VNWVSqVXNZdzOZkupxas50f/AH6g4DXniyChqvoTi+D37Wpf5yTxXM5C+Qf36Ok
> 2qZEovxuno51A5l9qIE0n2LQ3I6zJbybdth33sV1uxFK65CWxlfLgbPxb4+9JONF
> 2yozK/DtmGC7Hree2INBGOJA/55fCrccxSMuLW8JbmZqx43uCrE/FBWZhXE6Lx+f
> F5hR5e3kJEWjEtyPKpdtXedmOsb06xvGq+WFOGl8VgaRmNgsuLN/YYy13kRDY+0K
> j//ZX7ZqBaP9TqaW9y1LljTPLGugqVX+uzPdbUvW4vqahNU8mT5Kq1pBrrGPdY+C
> FolC1CLiWixAAhtSXfJihflFUJq+pYkAXDYBNPj/uyuIyeGXABw1UkJqgc0bVAal
> lSAMK2P09xwJ8Db5HpqxXpOHe/s5XdYD8Mj0jebQ2308CPNxfQM=
> =AvLd
> -END PGP SIGNATURE-
>



-- 
Eitan Raviv
IRC: erav (#ovirt #vdsm #devel #rhev-dev)
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] vdsm hook noipspoof on interface level

2018-04-14 Thread Peter Hudec
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Thanks,

this was the last part into my puzzle, HOST INTERFACE params.

The example hook provided in
https://bugzilla.redhat.com/show_bug.cgi?id=1366905#c8,
https://bugzilla.redhat.com/attachment.cgi?id=1232201 looks good, but
it seems to set the IP param on all interfaces too, regardless on
which interface the NIC PARAM is set.

The hooks should be called per vNIC, as reading the
https://www.ovirt.org/documentation/admin-guide/appe-VDSM_and_Hooks/#the
- -vdsm-hook-domain-xml-object,
the one/several of thees hooks should be used or maybe I'm wrong ;(

Peter

On 14/04/2018 07:04, Eitan Raviv wrote:
> You might find the following useful:
> 
> https://ovirt.org/develop/release-management/features/network/networkf
ilterparameters/
>
>  HTH
> 
> On Thu, Apr 12, 2018, 14:52 Peter Hudec  > wrote:
> 
> Hi,
> 
> I would like to restrict of usage IP address on VMs. Thos could be 
> achied by usinf clear-filter instead of vdsm-no-mac-spoofing.
> 
> I have found noipspoof vdsm hook, 
> https://github.com/oVirt/vdsm/tree/master/vdsm_hooks/noipspoof.
> 
> This hook but set the filtering on all interfaces, the setting is
> on VM level, not interface level. So if the there are more
> interfaces on all of them. I would like just restrict the WAN
> interface on multi homed VMs.
> 
> Peter
> 
> -- *Peter Hudec* Infraštruktúrny architekt phu...@cnc.sk
>   >
> 
> *CNC, a.s.* Borská 6, 841 04 Bratislava Recepcia: +421 2  35 000
> 100
> 
> Mobil:+421 905 997 203 *www.cnc.sk *
> >
> 
> ___ Users mailing list 
> Users@ovirt.org  
> http://lists.ovirt.org/mailman/listinfo/users
> 


- -- 
*Peter Hudec*
Infraštruktúrny architekt
phu...@cnc.sk 

*CNC, a.s.*
Borská 6, 841 04 Bratislava
Recepcia: +421 2  35 000 100

Mobil:+421 905 997 203
*www.cnc.sk* 

-BEGIN PGP SIGNATURE-

iQIzBAEBCgAdFiEEqSUbhuEwhryifNeVQnvVWOJ35BAFAlrSm54ACgkQQnvVWOJ3
5BDz5A//dqyf9wnvkRCjEmeUkMsN72qL7o+utazM7L8S4sY4Pu6INsPhpy7QtwHw
fyXbdrU9qy+5ts3g+yoxpsdkTWUk47m/6nQR3fiw0nXJu44/ABl+Hw4g0H3/k86f
7sYOYvZ8IfCpL9/2r1VRlP8j7e+CdI8Ltcjppn7PtKhPT03f87p2PT1pJd95DYS+
GbqZZ6yOAUlePP/808+f7hYxKNz0ek1tf/ZxzLgSJsCl1PsIhKiCBiuze/5hdeL5
/VNWVSqVXNZdzOZkupxas50f/AH6g4DXniyChqvoTi+D37Wpf5yTxXM5C+Qf36Ok
2qZEovxuno51A5l9qIE0n2LQ3I6zJbybdth33sV1uxFK65CWxlfLgbPxb4+9JONF
2yozK/DtmGC7Hree2INBGOJA/55fCrccxSMuLW8JbmZqx43uCrE/FBWZhXE6Lx+f
F5hR5e3kJEWjEtyPKpdtXedmOsb06xvGq+WFOGl8VgaRmNgsuLN/YYy13kRDY+0K
j//ZX7ZqBaP9TqaW9y1LljTPLGugqVX+uzPdbUvW4vqahNU8mT5Kq1pBrrGPdY+C
FolC1CLiWixAAhtSXfJihflFUJq+pYkAXDYBNPj/uyuIyeGXABw1UkJqgc0bVAal
lSAMK2P09xwJ8Db5HpqxXpOHe/s5XdYD8Mj0jebQ2308CPNxfQM=
=AvLd
-END PGP SIGNATURE-
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] vdsm hook noipspoof on interface level

2018-04-13 Thread Eitan Raviv
You might find the following useful:

https://ovirt.org/develop/release-management/features/network/networkfilterparameters/

HTH

On Thu, Apr 12, 2018, 14:52 Peter Hudec  wrote:

> Hi,
>
> I would like to restrict of usage IP address on VMs. Thos could be
> achied by usinf clear-filter instead of vdsm-no-mac-spoofing.
>
> I have found noipspoof vdsm hook,
> https://github.com/oVirt/vdsm/tree/master/vdsm_hooks/noipspoof.
>
> This hook but set the filtering on all interfaces, the setting is on VM
> level, not interface level. So if the there are more interfaces on all
> of them. I would like just restrict the WAN interface on multi homed VMs.
>
> Peter
>
> --
> *Peter Hudec*
> Infraštruktúrny architekt
> phu...@cnc.sk 
>
> *CNC, a.s.*
> Borská 6, 841 04 Bratislava
> Recepcia: +421 2  35 000 100
>
> Mobil:+421 905 997 203
> *www.cnc.sk* 
>
> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
>
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


[ovirt-users] vdsm hook noipspoof on interface level

2018-04-12 Thread Peter Hudec
Hi,

I would like to restrict of usage IP address on VMs. Thos could be
achied by usinf clear-filter instead of vdsm-no-mac-spoofing.

I have found noipspoof vdsm hook,
https://github.com/oVirt/vdsm/tree/master/vdsm_hooks/noipspoof.

This hook but set the filtering on all interfaces, the setting is on VM
level, not interface level. So if the there are more interfaces on all
of them. I would like just restrict the WAN interface on multi homed VMs.

Peter

-- 
*Peter Hudec*
Infraštruktúrny architekt
phu...@cnc.sk 

*CNC, a.s.*
Borská 6, 841 04 Bratislava
Recepcia: +421 2  35 000 100

Mobil:+421 905 997 203
*www.cnc.sk* 

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


[ovirt-users] vdsm hook issues

2016-01-12 Thread Jean-Pierre Ribeauville

Hi,

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
see this hook.py invoked ?

2) when running manually my hook.py, I got following error :
 ImportError: No module named hooking

Do I have to install anything to solve this issue ?

Thanks for help.


Regards,



J.P. Ribeauville


P: +33.(0).1.47.17.20.49
.
Puteaux 3 Etage 5  Bureau 4

jpribeauvi...@axway.com
http://www.axway.com



P Pensez à l'environnement avant d'imprimer.



___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] vdsm hook issues

2016-01-12 Thread Dan Yasny
1. Are you using a full OS or a node?
2. rpm -qa |grep vdsm
3. if possible, post the hook code

Thanks

On Tue, Jan 12, 2016 at 10:17 AM, Jean-Pierre Ribeauville <
jpribeauvi...@axway.com> wrote:

>
>
> Hi,
>
>
>
> 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
>
> see this hook.py invoked ?
>
>
>
> 2) when running manually my hook.py, I got following error :
>
>  ImportError: No module named hooking
>
>
>
> Do I have to install anything to solve this issue ?
>
>
>
> Thanks for help.
>
>
>
>
>
> Regards,
>
>
>
>
>
>
>
> *J.P. Ribeauville*
>
>
>
> P: +33.(0).1.47.17.20.49
>
> .
>
> Puteaux 3 Etage 5  Bureau 4
>
>
>
> *jpribeauvi...@axway.com *
> http://www.axway.com
>
>
>
>
>
> P Pensez à l’environnement avant d’imprimer.
>
>
>
>
>
> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
>
>
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] vdsm hook issues

2016-01-12 Thread Jean-Pierre Ribeauville
Hi,


1°  It’s a full RHEL7 OS.
2°
vdsm-python-zombiereaper-4.16.27-0.el7.centos.noarch

vdsm-python-4.16.27-0.el7.centos.noarch

vdsm-yajsonrpc-4.16.27-0.el7.centos.noarch

vdsm-xmlrpc-4.16.27-0.el7.centos.noarch

vdsm-cli-4.16.27-0.el7.centos.noarch

vdsm-jsonrpc-java-1.0.15-1.el7.noarch

vdsm-jsonrpc-4.16.27-0.el7.centos.noarch

vdsm-4.16.27-0.el7.centos.x86_64
3°
#!/usr/bin/python

1)

2)  import os

3)  import sys

4)  import grp

5)  import pwd

6)  import traceback

7)

8)  import hooking

9)

10)   def createChannelElement(domxml):

11)   '''

12)   

13) 

14) 

15)   

16)   '''

17)

18)   channel = domxml.createElement('channel')

19)   disk.setAttribute('type', 'unix')

20)

21)   source = domxml.createElement('source')

22)   source.setAttribute('mode', 'bind')

23)

24)   # find  domain name

25)   domainame = domxml.getElementsByTagName('name')

26)

27)   source.setAttribute('path', '//var/lib/libvirt/qemu/' + domainame + 
'_omnivision_1.agent')

28)   disk.appendChild(source)

29)

30)   target = domxml.createElement('target')

31)   target.setAttribute('type', 'virtio')

32)   target.setAttribute('name', 'omnivision_1.agent')

33)   disk.appendChild(target)

34)

35)   return channel

36)

37)   try:

38)  domxml = hooking.read_domxml()

39)  devices = domxml.getElementsByTagName('devices')[0]

40)  channeldev = createChannelElement(domxml)

41)  sys.stderr.write('createChannel: adding xml: %s\n' % 
channeldev.toxml())

42)  devices.appendChild(channeldev)

43)

44)  hooking.write_domxml(domxml)

45)   except:

46)  sys.stderr.write('createChannel: [unexpected error]: %s\n' %

47)  traceback.format_exc())

48)  sys.exit(2)



Thx for help.

Regards,

J.P.


De : Dan Yasny [mailto:dya...@gmail.com]
Envoyé : mardi 12 janvier 2016 16:23
À : Jean-Pierre Ribeauville
Cc : users@ovirt.org
Objet : Re: [ovirt-users] vdsm hook issues

1. Are you using a full OS or a node?
2. rpm -qa |grep vdsm
3. if possible, post the hook code

Thanks

On Tue, Jan 12, 2016 at 10:17 AM, Jean-Pierre Ribeauville 
<jpribeauvi...@axway.com<mailto:jpribeauvi...@axway.com>> wrote:

Hi,

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
see this hook.py invoked ?

2) when running manually my hook.py, I got following error :
 ImportError: No module named hooking

Do I have to install anything to solve this issue ?

Thanks for help.


Regards,



J.P. Ribeauville


P: +33.(0).1.47.17.20.49<tel:%2B33.%280%29.1.47.17.20.49>
.
Puteaux 3 Etage 5  Bureau 4

jpribeauvi...@axway.com<mailto:jpribeauvi...@axway.com>
http://www.axway.com<http://www.axway.com/>



P Pensez à l’environnement avant d’imprimer.




___
Users mailing list
Users@ovirt.org<mailto:Users@ovirt.org>
http://lists.ovirt.org/mailman/listinfo/users

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] vdsm hook issues

2016-01-12 Thread Jean-Pierre Ribeauville
Hi,

173078 4 -rwxrwxrwx. 1 vdsm kvm 1292 Jan 12 15:51 test_hook.py


Looks fine , isn’t ?

J.P.

De : Dan Yasny [mailto:dya...@gmail.com]
Envoyé : mardi 12 janvier 2016 17:00
À : Jean-Pierre Ribeauville
Cc : users@ovirt.org
Objet : Re: [ovirt-users] vdsm hook issues

So, to make is work, you need to chown 36:36 and chmod +x for 36:36 of course.

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.

See 
https://github.com/oVirt/vdsm/blob/master/vdsm_hooks/vmfex/before_vm_start.py 
line 197 - sys.stderr.write will actually dump into the vdsm log.

On Tue, Jan 12, 2016 at 10:55 AM, Jean-Pierre Ribeauville 
<jpribeauvi...@axway.com<mailto:jpribeauvi...@axway.com>> wrote:
Hi,

/usr/share/vdsm/hooking.py  is present on my host.

I placed my test_hook.py  in /usr/libexec/vdsm/hooks/before_vm_start

As I want to have it invoked for every started VM ,  I don’t need custom 
property ; Am I right ?

Remains the point “make it accessible to vdsm:kvm”  what do you mean ?

BTW , are vdsm hooks log infos located in /var/log/vdsm/vdsm.log  ?

Thx for help.

J.P.

De : Dan Yasny [mailto:dya...@gmail.com<mailto:dya...@gmail.com>]
Envoyé : mardi 12 janvier 2016 16:48

À : Jean-Pierre Ribeauville
Cc : users@ovirt.org<mailto:users@ovirt.org>
Objet : Re: [ovirt-users] vdsm hook issues

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.

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.

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.

On Tue, Jan 12, 2016 at 10:35 AM, Jean-Pierre Ribeauville 
<jpribeauvi...@axway.com<mailto:jpribeauvi...@axway.com>> wrote:
Hi,


1°  It’s a full RHEL7 OS.
2°
vdsm-python-zombiereaper-4.16.27-0.el7.centos.noarch

vdsm-python-4.16.27-0.el7.centos.noarch

vdsm-yajsonrpc-4.16.27-0.el7.centos.noarch

vdsm-xmlrpc-4.16.27-0.el7.centos.noarch

vdsm-cli-4.16.27-0.el7.centos.noarch

vdsm-jsonrpc-java-1.0.15-1.el7.noarch

vdsm-jsonrpc-4.16.27-0.el7.centos.noarch

vdsm-4.16.27-0.el7.centos.x86_64
3°
#!/usr/bin/python

1)

2)  import os

3)  import sys

4)  import grp

5)  import pwd

6)  import traceback

7)

8)  import hooking

9)

10)   def createChannelElement(domxml):

11)   '''

12)   

13) 

14) 

15)   

16)   '''

17)

18)   channel = domxml.createElement('channel')

19)   disk.setAttribute('type', 'unix')

20)

21)   source = domxml.createElement('source')

22)   source.setAttribute('mode', 'bind')

23)

24)   # find  domain name

25)   domainame = domxml.getElementsByTagName('name')

26)

27)   source.setAttribute('path', '//var/lib/libvirt/qemu/' + domainame + 
'_omnivision_1.agent')

28)   disk.appendChild(source)

29)

30)   target = domxml.createElement('target')

31)   target.setAttribute('type', 'virtio')

32)   target.setAttribute('name', 'omnivision_1.agent')

33)   disk.appendChild(target)

34)

35)   return channel

36)

37)   try:

38)  domxml = hooking.read_domxml()

39)  devices = domxml.getElementsByTagName('devices')[0]

40)  channeldev = createChannelElement(domxml)

41)  sys.stderr.write('createChannel: adding xml: %s\n' % 
channeldev.toxml())

42)  devices.appendChild(channeldev)

43)

44)  hooking.write_domxml(domxml)

45)   except:

46)  sys.stderr.write('createChannel: [unexpected error]: %s\n' %

47)  traceback.format_exc())

48)  sys.exit(2)



Thx for help.

Regards,

J.P.


De : Dan Yasny [mailto:dya...@gmail.com<mailto:dya...@gmail.com>]
Envoyé : mardi 12 janvier 2016 16:23
À : Jean-Pierre Ribeauville
Cc : users@ovirt.org<mailto:users@ovirt.org>
Objet : Re: [ovirt-users] vdsm hook issues

1. Are you using a full OS or a node?
2. rpm -qa |grep vdsm
3. if possible, post the hook code

Thanks

On Tue, Jan 12, 2016 at 10:17 AM, Jean-Pierre Ribeauville 
<jpribeauvi...@axway.com<mailto:jpribeauvi...@axway.com>> wrote:

Hi,

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
see this hook.py invoked ?

2) when running manually my hook.py, I got following error :
 ImportError: No module named hooking

Do I have to install anything to solve this issue ?

Thanks for help.


Regards,



J.P. Ribeauville


P: +33.(0).1.47.17.20.49<tel:%2B33.%280%29.1.47.17.20.49>
.
Puteaux 3 Etage 5  Bureau 4

jpribeauvi...@axway.com<mailto:jpribeauvi...@axway.com>
http://www.axway.com<http://www.axway.com/>



P Pensez à l’environneme

Re: [ovirt-users] vdsm hook issues

2016-01-12 Thread Dan Yasny
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

On Tue, Jan 12, 2016 at 11:02 AM, Jean-Pierre Ribeauville <
jpribeauvi...@axway.com> wrote:

> Hi,
>
>
>
> 173078 4 -rwxrwxrwx. 1 vdsm kvm 1292 Jan 12 15:51 test_hook.py
>
>
>
>
>
> Looks fine , isn’t ?
>
>
>
> J.P.
>
>
>
> *De :* Dan Yasny [mailto:dya...@gmail.com]
> *Envoyé :* mardi 12 janvier 2016 17:00
>
> *À :* Jean-Pierre Ribeauville
> *Cc :* users@ovirt.org
> *Objet :* Re: [ovirt-users] vdsm hook issues
>
>
>
> So, to make is work, you need to chown 36:36 and chmod +x for 36:36 of
> course.
>
>
>
> 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.
>
>
>
> See
> https://github.com/oVirt/vdsm/blob/master/vdsm_hooks/vmfex/before_vm_start.py
> line 197 - sys.stderr.write will actually dump into the vdsm log.
>
>
>
> On Tue, Jan 12, 2016 at 10:55 AM, Jean-Pierre Ribeauville <
> jpribeauvi...@axway.com> wrote:
>
> Hi,
>
>
>
> /usr/share/vdsm/hooking.py  is present on my host.
>
>
>
> I placed my test_hook.py  in /usr/libexec/vdsm/hooks/before_vm_start
>
>
>
> As I want to have it invoked for every started VM ,  I don’t need custom
> property ; Am I right ?
>
>
>
> Remains the point “make it accessible to vdsm:kvm”  what do you mean ?
>
>
>
> BTW , are vdsm hooks log infos located in /var/log/vdsm/vdsm.log  ?
>
>
>
> Thx for help.
>
>
>
> J.P.
>
>
>
> *De :* Dan Yasny [mailto:dya...@gmail.com]
> *Envoyé :* mardi 12 janvier 2016 16:48
>
>
> *À :* Jean-Pierre Ribeauville
> *Cc :* users@ovirt.org
> *Objet :* Re: [ovirt-users] vdsm hook issues
>
>
>
> 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.
>
>
>
> 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.
>
>
>
> 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.
>
>
>
> On Tue, Jan 12, 2016 at 10:35 AM, Jean-Pierre Ribeauville <
> jpribeauvi...@axway.com> wrote:
>
> Hi,
>
>
>
> 1°  It’s a full RHEL7 OS.
> 2°
> vdsm-python-zombiereaper-4.16.27-0.el7.centos.noarch
>
> vdsm-python-4.16.27-0.el7.centos.noarch
>
> vdsm-yajsonrpc-4.16.27-0.el7.centos.noarch
>
> vdsm-xmlrpc-4.16.27-0.el7.centos.noarch
>
> vdsm-cli-4.16.27-0.el7.centos.noarch
>
> vdsm-jsonrpc-java-1.0.15-1.el7.noarch
>
> vdsm-jsonrpc-4.16.27-0.el7.centos.noarch
>
> vdsm-4.16.27-0.el7.centos.x86_64
>
> 3°
>
> #!/usr/bin/python
>
> 1)
>
> 2)  import os
>
> 3)  import sys
>
> 4)  import grp
>
> 5)  import pwd
>
> 6)  import traceback
>
> 7)
>
> 8)  import hooking
>
> 9)
>
> 10)   def createChannelElement(domxml):
>
> 11)   '''
>
> 12)   
>
> 13)  path='//var/lib/libvirt/qemu/VM_RHEL7-1_omnivision_1.agent'/>
>
> 14) 
>
> 15)   
>
> 16)   '''
>
> 17)
>
> 18)   channel = domxml.createElement('channel')
>
> 19)   disk.setAttribute('type', 'unix')
>
> 20)
>
> 21)   source = domxml.createElement('source')
>
> 22)   source.setAttribute('mode', 'bind')
>
> 23)
>
> 24)   # find  domain name
>
> 25)   domainame = domxml.getElementsByTagName('name')
>
> 26)
>
> 27)   source.setAttribute('path', '//var/lib/libvirt/qemu/' +
> domainame + '_omnivision_1.agent')
>
> 28)   disk.appendChild(source)
>
> 29)
>
> 30)   target = domxml.createElement('target')
>
> 31)   target.setAttribute('type', 'virtio')
>
> 32)   target.setAttribute('name', 'omnivision_1.agent')
>
> 33)   disk.appendChild(target)
>
> 34)
>
> 35)   return channel
>
> 36)
>
> 37)   try:
>
> 38)  domxml = hooking.read_domxml()
>
> 39)  devices = domxml.getElementsByTagName('devices')[0]
>
> 40)  channeldev = createChannelElement(domxml)
>
> 41)  sys.stderr.write('createChannel: adding xml: %s\n' %
> channeldev.toxml())
>
> 42)  devices.appendChil

Re: [ovirt-users] vdsm hook issues

2016-01-12 Thread Dan Yasny
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.

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.

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.

On Tue, Jan 12, 2016 at 10:35 AM, Jean-Pierre Ribeauville <
jpribeauvi...@axway.com> wrote:

> Hi,
>
>
>
> 1°  It’s a full RHEL7 OS.
> 2°
> vdsm-python-zombiereaper-4.16.27-0.el7.centos.noarch
>
> vdsm-python-4.16.27-0.el7.centos.noarch
>
> vdsm-yajsonrpc-4.16.27-0.el7.centos.noarch
>
> vdsm-xmlrpc-4.16.27-0.el7.centos.noarch
>
> vdsm-cli-4.16.27-0.el7.centos.noarch
>
> vdsm-jsonrpc-java-1.0.15-1.el7.noarch
>
> vdsm-jsonrpc-4.16.27-0.el7.centos.noarch
>
> vdsm-4.16.27-0.el7.centos.x86_64
>
> 3°
>
> #!/usr/bin/python
>
> 1)
>
> 2)  import os
>
> 3)  import sys
>
> 4)  import grp
>
> 5)  import pwd
>
> 6)  import traceback
>
> 7)
>
> 8)  import hooking
>
> 9)
>
> 10)   def createChannelElement(domxml):
>
> 11)   '''
>
> 12)   
>
> 13)  path='//var/lib/libvirt/qemu/VM_RHEL7-1_omnivision_1.agent'/>
>
> 14) 
>
> 15)   
>
> 16)   '''
>
> 17)
>
> 18)   channel = domxml.createElement('channel')
>
> 19)   disk.setAttribute('type', 'unix')
>
> 20)
>
> 21)   source = domxml.createElement('source')
>
> 22)   source.setAttribute('mode', 'bind')
>
> 23)
>
> 24)   # find  domain name
>
> 25)   domainame = domxml.getElementsByTagName('name')
>
> 26)
>
> 27)   source.setAttribute('path', '//var/lib/libvirt/qemu/' +
> domainame + '_omnivision_1.agent')
>
> 28)   disk.appendChild(source)
>
> 29)
>
> 30)   target = domxml.createElement('target')
>
> 31)   target.setAttribute('type', 'virtio')
>
> 32)   target.setAttribute('name', 'omnivision_1.agent')
>
> 33)   disk.appendChild(target)
>
> 34)
>
> 35)   return channel
>
> 36)
>
> 37)   try:
>
> 38)  domxml = hooking.read_domxml()
>
> 39)  devices = domxml.getElementsByTagName('devices')[0]
>
> 40)  channeldev = createChannelElement(domxml)
>
> 41)  sys.stderr.write('createChannel: adding xml: %s\n' %
> channeldev.toxml())
>
> 42)  devices.appendChild(channeldev)
>
> 43)
>
> 44)  hooking.write_domxml(domxml)
>
> 45)   except:
>
> 46)  sys.stderr.write('createChannel: [unexpected error]: %s\n' %
>
> 47)  traceback.format_exc())
>
> 48)  sys.exit(2)
>
>
>
>
>
>
>
> Thx for help.
>
>
>
> Regards,
>
>
>
> J.P.
>
>
>
>
>
> *De :* Dan Yasny [mailto:dya...@gmail.com]
> *Envoyé :* mardi 12 janvier 2016 16:23
> *À :* Jean-Pierre Ribeauville
> *Cc :* users@ovirt.org
> *Objet :* Re: [ovirt-users] vdsm hook issues
>
>
>
> 1. Are you using a full OS or a node?
>
> 2. rpm -qa |grep vdsm
>
> 3. if possible, post the hook code
>
>
>
> Thanks
>
>
>
> On Tue, Jan 12, 2016 at 10:17 AM, Jean-Pierre Ribeauville <
> jpribeauvi...@axway.com> wrote:
>
>
>
> Hi,
>
>
>
> 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
>
> see this hook.py invoked ?
>
>
>
> 2) when running manually my hook.py, I got following error :
>
>  ImportError: No module named hooking
>
>
>
> Do I have to install anything to solve this issue ?
>
>
>
> Thanks for help.
>
>
>
>
>
> Regards,
>
>
>
>
>
>
>
> *J.P. Ribeauville*
>
>
>
> P: +33.(0).1.47.17.20.49
>
> .
>
> Puteaux 3 Etage 5  Bureau 4
>
>
>
> *jpribeauvi...@axway.com <jpribeauvi...@axway.com>*
> http://www.axway.com
>
>
>
>
>
> P Pensez à l’environnement avant d’imprimer.
>
>
>
>
>
>
> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
>
>
>
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] vdsm hook issues

2016-01-12 Thread Dan Yasny
So, to make is work, you need to chown 36:36 and chmod +x for 36:36 of
course.

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.

See
https://github.com/oVirt/vdsm/blob/master/vdsm_hooks/vmfex/before_vm_start.py
line 197 - sys.stderr.write will actually dump into the vdsm log.

On Tue, Jan 12, 2016 at 10:55 AM, Jean-Pierre Ribeauville <
jpribeauvi...@axway.com> wrote:

> Hi,
>
>
>
> /usr/share/vdsm/hooking.py  is present on my host.
>
>
>
> I placed my test_hook.py  in /usr/libexec/vdsm/hooks/before_vm_start
>
>
>
> As I want to have it invoked for every started VM ,  I don’t need custom
> property ; Am I right ?
>
>
>
> Remains the point “make it accessible to vdsm:kvm”  what do you mean ?
>
>
>
> BTW , are vdsm hooks log infos located in /var/log/vdsm/vdsm.log  ?
>
>
>
> Thx for help.
>
>
>
> J.P.
>
>
>
> *De :* Dan Yasny [mailto:dya...@gmail.com]
> *Envoyé :* mardi 12 janvier 2016 16:48
>
> *À :* Jean-Pierre Ribeauville
> *Cc :* users@ovirt.org
> *Objet :* Re: [ovirt-users] vdsm hook issues
>
>
>
> 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.
>
>
>
> 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.
>
>
>
> 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.
>
>
>
> On Tue, Jan 12, 2016 at 10:35 AM, Jean-Pierre Ribeauville <
> jpribeauvi...@axway.com> wrote:
>
> Hi,
>
>
>
> 1°  It’s a full RHEL7 OS.
> 2°
> vdsm-python-zombiereaper-4.16.27-0.el7.centos.noarch
>
> vdsm-python-4.16.27-0.el7.centos.noarch
>
> vdsm-yajsonrpc-4.16.27-0.el7.centos.noarch
>
> vdsm-xmlrpc-4.16.27-0.el7.centos.noarch
>
> vdsm-cli-4.16.27-0.el7.centos.noarch
>
> vdsm-jsonrpc-java-1.0.15-1.el7.noarch
>
> vdsm-jsonrpc-4.16.27-0.el7.centos.noarch
>
> vdsm-4.16.27-0.el7.centos.x86_64
>
> 3°
>
> #!/usr/bin/python
>
> 1)
>
> 2)  import os
>
> 3)  import sys
>
> 4)  import grp
>
> 5)  import pwd
>
> 6)  import traceback
>
> 7)
>
> 8)  import hooking
>
> 9)
>
> 10)   def createChannelElement(domxml):
>
> 11)   '''
>
> 12)   
>
> 13)  path='//var/lib/libvirt/qemu/VM_RHEL7-1_omnivision_1.agent'/>
>
> 14) 
>
> 15)   
>
> 16)   '''
>
> 17)
>
> 18)   channel = domxml.createElement('channel')
>
> 19)   disk.setAttribute('type', 'unix')
>
> 20)
>
> 21)   source = domxml.createElement('source')
>
> 22)   source.setAttribute('mode', 'bind')
>
> 23)
>
> 24)   # find  domain name
>
> 25)   domainame = domxml.getElementsByTagName('name')
>
> 26)
>
> 27)   source.setAttribute('path', '//var/lib/libvirt/qemu/' +
> domainame + '_omnivision_1.agent')
>
> 28)   disk.appendChild(source)
>
> 29)
>
> 30)   target = domxml.createElement('target')
>
> 31)   target.setAttribute('type', 'virtio')
>
> 32)   target.setAttribute('name', 'omnivision_1.agent')
>
> 33)   disk.appendChild(target)
>
> 34)
>
> 35)   return channel
>
> 36)
>
> 37)   try:
>
> 38)  domxml = hooking.read_domxml()
>
> 39)  devices = domxml.getElementsByTagName('devices')[0]
>
> 40)  channeldev = createChannelElement(domxml)
>
> 41)  sys.stderr.write('createChannel: adding xml: %s\n' %
> channeldev.toxml())
>
> 42)  devices.appendChild(channeldev)
>
> 43)
>
> 44)  hooking.write_domxml(domxml)
>
> 45)   except:
>
> 46)  sys.stderr.write('createChannel: [unexpected error]: %s\n' %
>
> 47)  traceback.format_exc())
>
> 48)  sys.exit(2)
>
>
>
>
>
>
>
> Thx for help.
>
>
>
> Regards,
>
>
>
> J.P.
>
>
>
>
>
> *De :* Dan Yasny [mailto:dya...@gmail.com]
> *Envoyé :* mardi 12 janvier 2016 16:23
> *À :* Jean-Pierre Ribeauville
> *Cc :* users@ovirt.org
> *Objet :* Re: [ovirt-users] vdsm hook issues
>
>
>
> 1. Are you using a full OS or a node?
>
> 2. rpm -qa |grep vdsm
>
> 3. if possible, post the hook code
>
>
>
> Thanks
>
>
>
> On Tue, Jan 12, 2016 at 10:17 AM, Jean-Pierre Ribeauvill

Re: [ovirt-users] vdsm hook issues

2016-01-12 Thread Jean-Pierre Ribeauville
Hi,

/usr/share/vdsm/hooking.py  is present on my host.

I placed my test_hook.py  in /usr/libexec/vdsm/hooks/before_vm_start

As I want to have it invoked for every started VM ,  I don’t need custom 
property ; Am I right ?

Remains the point “make it accessible to vdsm:kvm”  what do you mean ?

BTW , are vdsm hooks log infos located in /var/log/vdsm/vdsm.log  ?

Thx for help.

J.P.

De : Dan Yasny [mailto:dya...@gmail.com]
Envoyé : mardi 12 janvier 2016 16:48
À : Jean-Pierre Ribeauville
Cc : users@ovirt.org
Objet : Re: [ovirt-users] vdsm hook issues

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.

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.

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.

On Tue, Jan 12, 2016 at 10:35 AM, Jean-Pierre Ribeauville 
<jpribeauvi...@axway.com<mailto:jpribeauvi...@axway.com>> wrote:
Hi,


1°  It’s a full RHEL7 OS.
2°
vdsm-python-zombiereaper-4.16.27-0.el7.centos.noarch

vdsm-python-4.16.27-0.el7.centos.noarch

vdsm-yajsonrpc-4.16.27-0.el7.centos.noarch

vdsm-xmlrpc-4.16.27-0.el7.centos.noarch

vdsm-cli-4.16.27-0.el7.centos.noarch

vdsm-jsonrpc-java-1.0.15-1.el7.noarch

vdsm-jsonrpc-4.16.27-0.el7.centos.noarch

vdsm-4.16.27-0.el7.centos.x86_64
3°
#!/usr/bin/python

1)

2)  import os

3)  import sys

4)  import grp

5)  import pwd

6)  import traceback

7)

8)  import hooking

9)

10)   def createChannelElement(domxml):

11)   '''

12)   

13) 

14) 

15)   

16)   '''

17)

18)   channel = domxml.createElement('channel')

19)   disk.setAttribute('type', 'unix')

20)

21)   source = domxml.createElement('source')

22)   source.setAttribute('mode', 'bind')

23)

24)   # find  domain name

25)   domainame = domxml.getElementsByTagName('name')

26)

27)   source.setAttribute('path', '//var/lib/libvirt/qemu/' + domainame + 
'_omnivision_1.agent')

28)   disk.appendChild(source)

29)

30)   target = domxml.createElement('target')

31)   target.setAttribute('type', 'virtio')

32)   target.setAttribute('name', 'omnivision_1.agent')

33)   disk.appendChild(target)

34)

35)   return channel

36)

37)   try:

38)  domxml = hooking.read_domxml()

39)  devices = domxml.getElementsByTagName('devices')[0]

40)  channeldev = createChannelElement(domxml)

41)  sys.stderr.write('createChannel: adding xml: %s\n' % 
channeldev.toxml())

42)  devices.appendChild(channeldev)

43)

44)  hooking.write_domxml(domxml)

45)   except:

46)  sys.stderr.write('createChannel: [unexpected error]: %s\n' %

47)  traceback.format_exc())

48)  sys.exit(2)



Thx for help.

Regards,

J.P.


De : Dan Yasny [mailto:dya...@gmail.com<mailto:dya...@gmail.com>]
Envoyé : mardi 12 janvier 2016 16:23
À : Jean-Pierre Ribeauville
Cc : users@ovirt.org<mailto:users@ovirt.org>
Objet : Re: [ovirt-users] vdsm hook issues

1. Are you using a full OS or a node?
2. rpm -qa |grep vdsm
3. if possible, post the hook code

Thanks

On Tue, Jan 12, 2016 at 10:17 AM, Jean-Pierre Ribeauville 
<jpribeauvi...@axway.com<mailto:jpribeauvi...@axway.com>> wrote:

Hi,

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
see this hook.py invoked ?

2) when running manually my hook.py, I got following error :
 ImportError: No module named hooking

Do I have to install anything to solve this issue ?

Thanks for help.


Regards,



J.P. Ribeauville


P: +33.(0).1.47.17.20.49<tel:%2B33.%280%29.1.47.17.20.49>
.
Puteaux 3 Etage 5  Bureau 4

jpribeauvi...@axway.com<mailto:jpribeauvi...@axway.com>
http://www.axway.com<http://www.axway.com/>



P Pensez à l’environnement avant d’imprimer.




___
Users mailing list
Users@ovirt.org<mailto:Users@ovirt.org>
http://lists.ovirt.org/mailman/listinfo/users


___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] VDSM hook for setting DSCP bits?

2015-02-11 Thread Dan Yasny
On Wed, Feb 11, 2015 at 12:17 PM, Chris Adams c...@cmadams.net wrote:

 Once upon a time, Chris Adams c...@cmadams.net said:
  Once upon a time, Dan Yasny dya...@gmail.com said:
   shouldn't be hard to do. Can you provide the details of what you need
 to
   happen to the VM exactly?
   - domxml changes
   - other host level changes
   - whether the VM should be able to live migrate
 
  It looks like libvirt supports setting up DSCP bits with nwfilter, per:
 
  https://libvirt.org/formatnwfilter.html

 Oh, on reading this, nwfilter can only match, not set, so that won't
 help.  It doesn't look like libvirt has a way to set something like
 that.

 Do VDSM hooks only act on the XML, or is there a way to configure things
 outside of libvirt?


The hooks are point is the VMs lifetime where you can insert any code you
like.
There is a way to edit the domxml at certain points, because it hasn't been
passed
to libvirt for execution yet. At other points changing the domxml will do
nothing
useful because the VM is already running, but you can do other things,
execute
other commands. A classic example is an oVirt independent Vm event
monitoring
engine, to which you can issue a hook based message at certain lifecycle
points,
e.g. VM $VM is starting; VM $VM is migrating etc. No idea why you'd
need
that engine (it's quite redundant because the ovirt-engine already does all
this)
but it will definitely work.

In short, explore the hooks, note the livecycle points (they are simply
aptly named
directories on the hosts) and decide what and where you need to execute.

If you are modifying a VM, it probably makes sense to do it in
before_vm_start, but
if you're also live migrating that VM, you need to add the same changes in
before_migrate_vm_*, and if the hook script makes changes on the host, you
probably want to clean up after the VM is gone, so after_vm_stop and
after_vm_migrate_source are the places to start looking. The mechanism is
very
flexible really, you can do anything you want if the host OS is capable of
it



 --
 Chris Adams c...@cmadams.net
 ___
 Users mailing list
 Users@ovirt.org
 http://lists.ovirt.org/mailman/listinfo/users

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] VDSM hook for setting DSCP bits?

2015-02-11 Thread Chris Adams
Once upon a time, Chris Adams c...@cmadams.net said:
 Once upon a time, Dan Yasny dya...@gmail.com said:
  shouldn't be hard to do. Can you provide the details of what you need to
  happen to the VM exactly?
  - domxml changes
  - other host level changes
  - whether the VM should be able to live migrate
 
 It looks like libvirt supports setting up DSCP bits with nwfilter, per:
 
 https://libvirt.org/formatnwfilter.html

Oh, on reading this, nwfilter can only match, not set, so that won't
help.  It doesn't look like libvirt has a way to set something like
that.

Do VDSM hooks only act on the XML, or is there a way to configure things
outside of libvirt?
-- 
Chris Adams c...@cmadams.net
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] VDSM hook for setting DSCP bits?

2015-02-11 Thread Chris Adams
Once upon a time, Dan Yasny dya...@gmail.com said:
 shouldn't be hard to do. Can you provide the details of what you need to
 happen to the VM exactly?
 - domxml changes
 - other host level changes
 - whether the VM should be able to live migrate

It looks like libvirt supports setting up DSCP bits with nwfilter, per:

https://libvirt.org/formatnwfilter.html

I will play with this some to see exactly how to use it (haven't tried
it before).  If that's the case, there shouldn't be any host-level
changes required.  I would want the VM to be able to live migrate still
(with the DSCP still applied).

I'll test this out on a bare libvirt VM and see if that'll do the job,
and report back with what XML is needed.

Thanks.


 On Tue, Feb 10, 2015 at 2:34 PM, Chris Adams c...@cmadams.net wrote:
 
  Is there a VDSM hook available that can set DSCP bits on a VM's network
  interface?  I want to do some QoS for some traffic across my network,
  and it would be easier if I could set DSCP bits outside the VM.
 
  I see vdsm-hook-qos, but that appears to just set bandwidth control in
  the Linux host, not DSCP on packets for the rest of the network.
  --
  Chris Adams c...@cmadams.net
  ___
  Users mailing list
  Users@ovirt.org
  http://lists.ovirt.org/mailman/listinfo/users
 

 ___
 Users mailing list
 Users@ovirt.org
 http://lists.ovirt.org/mailman/listinfo/users


-- 
Chris Adams c...@cmadams.net
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


[ovirt-users] VDSM hook for setting DSCP bits?

2015-02-10 Thread Chris Adams
Is there a VDSM hook available that can set DSCP bits on a VM's network
interface?  I want to do some QoS for some traffic across my network,
and it would be easier if I could set DSCP bits outside the VM.

I see vdsm-hook-qos, but that appears to just set bandwidth control in
the Linux host, not DSCP on packets for the rest of the network.
-- 
Chris Adams c...@cmadams.net
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] VDSM hook for setting DSCP bits?

2015-02-10 Thread Dan Yasny
shouldn't be hard to do. Can you provide the details of what you need to
happen to the VM exactly?
- domxml changes
- other host level changes
- whether the VM should be able to live migrate

On Tue, Feb 10, 2015 at 2:34 PM, Chris Adams c...@cmadams.net wrote:

 Is there a VDSM hook available that can set DSCP bits on a VM's network
 interface?  I want to do some QoS for some traffic across my network,
 and it would be easier if I could set DSCP bits outside the VM.

 I see vdsm-hook-qos, but that appears to just set bandwidth control in
 the Linux host, not DSCP on packets for the rest of the network.
 --
 Chris Adams c...@cmadams.net
 ___
 Users mailing list
 Users@ovirt.org
 http://lists.ovirt.org/mailman/listinfo/users

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] vdsm-hook

2014-08-19 Thread Dan Kenigsberg
On Tue, Aug 19, 2014 at 09:04:59AM +0100, Dan Kenigsberg wrote:
 On Mon, Aug 18, 2014 at 01:03:46PM +0300, mhd wrote:
  i want to disable ticket in spice protocol so i should use vdsm hook for
  edit xml. this is my script and i want to run in all vm, i mean i don't
  need custom probreties , no error found in vdsm log and vm is work but
  nothing happened for disable ticket i try another attribute as example
  'type' i put vnc instend of spice and nothing happened stay  spice 
  
  what i must do ???
  
  this my script:
  
  #!/usr/bin/python
  
  import os
  import sys
  import hooking
  import traceback
  
  try:
  domxml = hooking.read_domxml()
  graphics = domxml.getElementsByTagName('graphics')[0]
  graphics.setAttribute('disable-ticketing','true')
  hooking.write_domxml(domxml)
  except:
 sys.stderr.write('ticket: [unexpected error]: %s\n' %
  traceback.format_exc())
 sys.exit(2)
  
  i search in libvirt xml about disable-ticketing schema but i don't found
  http://libvirt.org/formatdomain.html

Oh - that's because it does not exist. Instead, you should drop the
passwdValidTo and passwd attributes from the graphics element.

  
  
  i need disable ticket because i want use thin client hardware which connect
  by spice protocol but i donn't want every connection create ticket by
  computer machine..
 
 Have you placed this executable under
 usr/libexec/vdsm/hooks/after_vm_set_ticket ? When you open a VM display,
 do you see attempts to call this script in vdsm.log?
 
 Dan
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


[ovirt-users] vdsm-hook

2014-08-18 Thread mhd
hi...

i want apply this script on all vm on my host but found error when start vm
i put my script file in before_vm_start:

script file is called: ticket


!/usr/bin/python

import os
import sys
import hooking
import traceback

try:
domxml = hooking.read_domxml()
display.setAttribute('disable-ticketing')
hooking.write_domxml(domxml)


except:
sys.stderr.write('ticket: [unexpected error]: %s\n' %
traceback.format_exc())
sys.exit(2)



the error is:


hread-50::DEBUG::2014-08-18 08:15:24,502::utils::642::root::(execCmd)
'/usr/libexec/vdsm/hooks/before_vm_start/ticket' (cwd None)
Thread-50::DEBUG::2014-08-18 08:15:24,522::utils::662::root::(execCmd)
FAILED: err = '  File /usr/libexec/vdsm/hooks/before_vm_start/ticket,
line 8\ntry:\n^\nIndentationError: unexpected indent\n'; rc = 1
Thread-50::INFO::2014-08-18
08:15:24,522::hooks::100::root::(_runHooksDir)   File
/usr/libexec/vdsm/hooks/before_vm_start/ticket, line 8
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


[ovirt-users] vdsm-hook

2014-08-18 Thread mhd
i want to disable ticket in spice protocol so i should use vdsm hook for
edit xml. this is my script and i want to run in all vm, i mean i don't
need custom probreties , no error found in vdsm log and vm is work but
nothing happened for disable ticket i try another attribute as example
'type' i put vnc instend of spice and nothing happened stay  spice 

what i must do ???

this my script:

#!/usr/bin/python

import os
import sys
import hooking
import traceback

try:
domxml = hooking.read_domxml()
graphics = domxml.getElementsByTagName('graphics')[0]
graphics.setAttribute('disable-ticketing','true')
hooking.write_domxml(domxml)
except:
   sys.stderr.write('ticket: [unexpected error]: %s\n' %
traceback.format_exc())
   sys.exit(2)

i search in libvirt xml about disable-ticketing schema but i don't found
http://libvirt.org/formatdomain.html


i need disable ticket because i want use thin client hardware which connect
by spice protocol but i donn't want every connection create ticket by
computer machine..
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] vdsm-hook

2014-08-18 Thread Sven Kieske
You have an unexpected indent at line 8
this is basic python parsing stuff and has nothing
to do with ovirt.

you can check your syntax on the shell prior to
deploying:

python -m py_compile script.py

HTH

Am 18.08.2014 10:21, schrieb mhd:
 IndentationError: unexpected indent

-- 
Mit freundlichen Grüßen / Regards

Sven Kieske

Systemadministrator
Mittwald CM Service GmbH  Co. KG
Königsberger Straße 6
32339 Espelkamp
T: +49-5772-293-100
F: +49-5772-293-333
https://www.mittwald.de
Geschäftsführer: Robert Meyer
St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen
Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users