From blanchet at abes.fr Mon Jun 4 11:03:59 2012 Content-Type: multipart/mixed; boundary="===============8227521437414492371==" MIME-Version: 1.0 From: =?utf-8?q?Nathana=C3=ABl_Blanchet_=3Cblanchet_at_abes=2Efr=3E?= To: users at ovirt.org Subject: [Users] modifying vmdisk hook Date: Mon, 04 Jun 2012 17:03:56 +0200 Message-ID: <4FCCCE5C.9090308@abes.fr> --===============8227521437414492371== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable This is a multi-part message in MIME format. --------------010501010600070107060506 Content-Type: text/plain; charset=3DISO-8859-1; format=3Dflowed Content-Transfer-Encoding: 8bit Hello, I'm testing hooks in vdsm and I need some help on modifying one of your = pyhton script : vmdisk = (http://gerrit.ovirt.org/gitweb?p=3Dvdsm.git;a=3Dblob;f=3Dvdsm_hooks/vmdisk= /before_vm_start.py;h=3D191d5c1af533e11d699b1d715d3c1ea60e28b787;hb=3D6817f= 1c6e3f5bc137d1f3bef45a2d0191465c7a3) the hook works great and I'm able now to attach a file device as a = second disk. But I want this disk to be the first bootable disk instead = of the block device one created into the engine. In order to change the = boot order of the disk, I added those lines: ... source =3D domxml.createElement('source') source.setAttribute('file', devpath) disk.appendChild(source) boot =3D domxml.createElement('boot') boot.setAttribute('order', 1) disk.appendChild(boot) # find a name for vdXXX ..... So the hook permit item = (http://libvirt.org/formatdomain.html#elementsDisks) But the vm refuses booting without any logs anywhere... What is wrong? Thanks for your help -- = Nathana=C3=ABl Blanchet Supervision r=C3=A9seau P=C3=B4le exploitation et maintenance D=C3=A9partement des syst=C3=A8mes d'information 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 = T=C3=A9l. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet(a)abes.fr --------------010501010600070107060506 Content-Type: text/html; charset=3DISO-8859-1 Content-Transfer-Encoding: 7bit Hello,

I'm testing hooks in vdsm and I need some help on modifying one of your pyhton script : vmdisk (http://gerrit.ovirt.org/gitweb?p=3Dvdsm.git;a=3Dblob;f=3Dvdsm_hooks/vm= disk/before_vm_start.py;h=3D191d5c1af533e11d699b1d715d3c1ea60e28b787;hb=3D6= 817f1c6e3f5bc137d1f3bef45a2d0191465c7a3)
the hook works great and I'm able now to attach a file device as a second disk. But I want this disk to be the first bootable disk instead of the block device one created into the engine. In order to change the boot order of the disk, I added those lines:

...
source =3D domxml.createElement('source')
source.setAttribute('file', devpath)
disk.appendChild(source)

boot =3D domxml.createElement('boot')
boot.setAttribute('order', 1)
disk.appendChild(boot)


 # find a name for vdXXX
.....

So the hook permit <boot order=3D1> item (http://libvirt.org/formatdomain.html#elementsDisks= )

But the vm refuses booting without any logs anywhere...

What is wrong?

Thanks for your help
-- =

Nathanaël Blanchet

Supervision réseau
Pôle exploitation et maintenance
Département des systèmes d'information
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
bl=
anchet(a)abes.fr 
--------------010501010600070107060506-- --===============8227521437414492371== Content-Type: multipart/alternative MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.bin" VGhpcyBpcyBhIG11bHRpLXBhcnQgbWVzc2FnZSBpbiBNSU1FIGZvcm1hdC4KLS0tLS0tLS0tLS0t LS0wMTA1MDEwMTA2MDAwNzAxMDcwNjA1MDYKQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluOyBjaGFy c2V0PUlTTy04ODU5LTE7IGZvcm1hdD1mbG93ZWQKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzog OGJpdAoKSGVsbG8sCgpJJ20gdGVzdGluZyBob29rcyBpbiB2ZHNtIGFuZCBJIG5lZWQgc29tZSBo ZWxwIG9uIG1vZGlmeWluZyBvbmUgb2YgeW91ciAKcHlodG9uIHNjcmlwdCA6IHZtZGlzayAKKGh0 dHA6Ly9nZXJyaXQub3ZpcnQub3JnL2dpdHdlYj9wP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3IDU0IDg0IDE0CjxhIGNsYXNzPSJtb3otdHh0LWxpbmstYWJicmV2aWF0 ZWQiIGhyZWY9Im1haWx0bzpibGFuY2hldEBhYmVzLmZyIj5ibGFuY2hldEBhYmVzLmZyPC9hPiA8 L3ByZT4KICA8L2JvZHk+CjwvaHRtbD4KCi0tLS0tLS0tLS0tLS0tMDEwNTAxMDEwNjAwMDcwMTA3 MDYwNTA2LS0K --===============8227521437414492371==-- From shaharh at redhat.com Mon Jun 4 11:16:22 2012 Content-Type: multipart/mixed; boundary="===============4770399968701736987==" MIME-Version: 1.0 From: Shahar Havivi To: users at ovirt.org Subject: Re: [Users] modifying vmdisk hook Date: Mon, 04 Jun 2012 18:16:17 +0300 Message-ID: <20120604151617.GD1797@redhat.com> In-Reply-To: 4FCCCE5C.9090308@abes.fr --===============4770399968701736987== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 04.06.12 17:03, Nathana=C3=ABl Blanchet wrote: > Hello, > = > I'm testing hooks in vdsm and I need some help on modifying one of > your pyhton script : vmdisk (http://gerrit.ovirt.org/gitweb?p=3Dvdsm.git;= a=3Dblob;f=3Dvdsm_hooks/vmdisk/before_vm_start.py;h=3D191d5c1af533e11d699b1= d715d3c1ea60e28b787;hb=3D6817f1c6e3f5bc137d1f3bef45a2d0191465c7a3) > the hook works great and I'm able now to attach a file device as a > second disk. But I want this disk to be the first bootable disk > instead of the block device one created into the engine. In order to > change the boot order of the disk, I added those lines: > = > ... > source =3D domxml.createElement('source') > source.setAttribute('file', devpath) > disk.appendChild(source) > = > boot =3D domxml.createElement('boot') > boot.setAttribute('order', 1) > disk.appendChild(boot) > = > # find a name for vdXXX > ..... > = > So the hook permit item > (http://libvirt.org/formatdomain.html#elementsDisks) > = > But the vm refuses booting without any logs anywhere... > = > What is wrong? > = > Thanks for your help Hi, 1. try to change the number to string: boot.setAttribute('order', '1') 2. you have a libvirt log at /var/log/libvirt/qemu/youvmname.log 3. when the script enumerate all the disks you need to change the other disk boot order: for d in xmldisks: # here look in each disk for boot element and change its order attribu= te # to other number, ie 2, 3 ... > = > -- = > Nathana=C3=ABl Blanchet > = > Supervision r=C3=A9seau > P=C3=B4le exploitation et maintenance > D=C3=A9partement des syst=C3=A8mes d'information > 227 avenue Professeur-Jean-Louis-Viala > 34193 MONTPELLIER CEDEX 5 = > T=C3=A9l. 33 (0)4 67 54 84 55 > Fax 33 (0)4 67 54 84 14 > blanchet(a)abes.fr >=20 --===============4770399968701736987==-- From blanchet at abes.fr Tue Jun 5 10:21:47 2012 Content-Type: multipart/mixed; boundary="===============4850231879519324112==" MIME-Version: 1.0 From: =?utf-8?q?Nathana=C3=ABl_Blanchet_=3Cblanchet_at_abes=2Efr=3E?= To: users at ovirt.org Subject: Re: [Users] modifying vmdisk hook Date: Tue, 05 Jun 2012 16:21:43 +0200 Message-ID: <4FCE15F7.5090802@abes.fr> In-Reply-To: 20120604151617.GD1797@redhat.com --===============4850231879519324112== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi, when executing several hook, I always have this issue in the vdsm logs : File "/usr/libexec/vdsm/hooks/before_vm_start/40_directlun", line 9, in = from vdsm import utils ImportError: No module named vdsm and the vm refuses to boot how to correct this ? Le 04/06/2012 17:16, Shahar Havivi a =C3=A9crit : > On 04.06.12 17:03, Nathana=C3=ABl Blanchet wrote: >> Hello, >> >> I'm testing hooks in vdsm and I need some help on modifying one of >> your pyhton script : vmdisk (http://gerrit.ovirt.org/gitweb?p=3Dvdsm.git= ;a=3Dblob;f=3Dvdsm_hooks/vmdisk/before_vm_start.py;h=3D191d5c1af533e11d699b= 1d715d3c1ea60e28b787;hb=3D6817f1c6e3f5bc137d1f3bef45a2d0191465c7a3) >> the hook works great and I'm able now to attach a file device as a >> second disk. But I want this disk to be the first bootable disk >> instead of the block device one created into the engine. In order to >> change the boot order of the disk, I added those lines: >> >> ... >> source =3D domxml.createElement('source') >> source.setAttribute('file', devpath) >> disk.appendChild(source) >> >> boot =3D domxml.createElement('boot') >> boot.setAttribute('order', 1) >> disk.appendChild(boot) >> >> # find a name for vdXXX >> ..... >> >> So the hook permit item >> (http://libvirt.org/formatdomain.html#elementsDisks) >> >> But the vm refuses booting without any logs anywhere... >> >> What is wrong? >> >> Thanks for your help > Hi, > 1. try to change the number to string: > boot.setAttribute('order', '1') > 2. you have a libvirt log at /var/log/libvirt/qemu/youvmname.log > 3. when the script enumerate all the disks you need to change the other d= isk > boot order: > for d in xmldisks: > # here look in each disk for boot element and change its order attr= ibute > # to other number, ie 2, 3 ... > > >> -- = >> Nathana=C3=ABl Blanchet >> >> Supervision r=C3=A9seau >> P=C3=B4le exploitation et maintenance >> D=C3=A9partement des syst=C3=A8mes d'information >> 227 avenue Professeur-Jean-Louis-Viala >> 34193 MONTPELLIER CEDEX 5 = >> T=C3=A9l. 33 (0)4 67 54 84 55 >> Fax 33 (0)4 67 54 84 14 >> blanchet(a)abes.fr >> -- = Nathana=C3=ABl Blanchet Supervision r=C3=A9seau P=C3=B4le exploitation et maintenance D=C3=A9partement des syst=C3=A8mes d'information 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 = T=C3=A9l. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet(a)abes.fr --===============4850231879519324112==-- From shaharh at redhat.com Tue Jun 5 10:28:00 2012 Content-Type: multipart/mixed; boundary="===============1431287326254882424==" MIME-Version: 1.0 From: Shahar Havivi To: users at ovirt.org Subject: Re: [Users] modifying vmdisk hook Date: Tue, 05 Jun 2012 17:27:56 +0300 Message-ID: <20120605142755.GB13052@redhat.com> In-Reply-To: 4FCE15F7.5090802@abes.fr --===============1431287326254882424== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 05.06.12 16:21, Nathana=C3=ABl Blanchet wrote: > Hi, > = > when executing several hook, I always have this issue in the vdsm logs : > File "/usr/libexec/vdsm/hooks/before_vm_start/40_directlun", line 9, > in > from vdsm import utils > ImportError: No module named vdsm > = > and the vm refuses to boot > = > how to correct this ? how did you install this? > = > = > Le 04/06/2012 17:16, Shahar Havivi a =C3=A9crit : > >On 04.06.12 17:03, Nathana=C3=ABl Blanchet wrote: > >>Hello, > >> > >>I'm testing hooks in vdsm and I need some help on modifying one of > >>your pyhton script : vmdisk (http://gerrit.ovirt.org/gitweb?p=3Dvdsm.gi= t;a=3Dblob;f=3Dvdsm_hooks/vmdisk/before_vm_start.py;h=3D191d5c1af533e11d699= b1d715d3c1ea60e28b787;hb=3D6817f1c6e3f5bc137d1f3bef45a2d0191465c7a3) > >>the hook works great and I'm able now to attach a file device as a > >>second disk. But I want this disk to be the first bootable disk > >>instead of the block device one created into the engine. In order to > >>change the boot order of the disk, I added those lines: > >> > >>... > >>source =3D domxml.createElement('source') > >>source.setAttribute('file', devpath) > >>disk.appendChild(source) > >> > >>boot =3D domxml.createElement('boot') > >>boot.setAttribute('order', 1) > >>disk.appendChild(boot) > >> > >> # find a name for vdXXX > >>..... > >> > >>So the hook permit item > >>(http://libvirt.org/formatdomain.html#elementsDisks) > >> > >>But the vm refuses booting without any logs anywhere... > >> > >>What is wrong? > >> > >>Thanks for your help > >Hi, > >1. try to change the number to string: > > boot.setAttribute('order', '1') > >2. you have a libvirt log at /var/log/libvirt/qemu/youvmname.log > >3. when the script enumerate all the disks you need to change the other = disk > > boot order: > > for d in xmldisks: > > # here look in each disk for boot element and change its order att= ribute > > # to other number, ie 2, 3 ... > > > > > >>-- = > >>Nathana=C3=ABl Blanchet > >> > >>Supervision r=C3=A9seau > >>P=C3=B4le exploitation et maintenance > >>D=C3=A9partement des syst=C3=A8mes d'information > >>227 avenue Professeur-Jean-Louis-Viala > >>34193 MONTPELLIER CEDEX 5 = > >>T=C3=A9l. 33 (0)4 67 54 84 55 > >>Fax 33 (0)4 67 54 84 14 > >>blanchet(a)abes.fr > >> > = > -- = > Nathana=C3=ABl Blanchet > = > Supervision r=C3=A9seau > P=C3=B4le exploitation et maintenance > D=C3=A9partement des syst=C3=A8mes d'information > 227 avenue Professeur-Jean-Louis-Viala > 34193 MONTPELLIER CEDEX 5 = > T=C3=A9l. 33 (0)4 67 54 84 55 > Fax 33 (0)4 67 54 84 14 > blanchet(a)abes.fr >=20 --===============1431287326254882424==-- From blanchet at abes.fr Tue Jun 5 10:57:32 2012 Content-Type: multipart/mixed; boundary="===============6356336809928618678==" MIME-Version: 1.0 From: =?utf-8?q?Nathana=C3=ABl_Blanchet_=3Cblanchet_at_abes=2Efr=3E?= To: users at ovirt.org Subject: Re: [Users] modifying vmdisk hook Date: Tue, 05 Jun 2012 16:57:28 +0200 Message-ID: <4FCE1E58.5030105@abes.fr> In-Reply-To: 20120605142755.GB13052@redhat.com --===============6356336809928618678== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable I cloned the git tree and copied the script in = /usr/libexec/vdsm/hooks/before_vm_start/ Le 05/06/2012 16:27, Shahar Havivi a =C3=A9crit : > On 05.06.12 16:21, Nathana=C3=ABl Blanchet wrote: >> Hi, >> >> when executing several hook, I always have this issue in the vdsm logs : >> File "/usr/libexec/vdsm/hooks/before_vm_start/40_directlun", line 9, >> in >> from vdsm import utils >> ImportError: No module named vdsm >> >> and the vm refuses to boot >> >> how to correct this ? > how did you install this? >> >> Le 04/06/2012 17:16, Shahar Havivi a =C3=A9crit : >>> On 04.06.12 17:03, Nathana=C3=ABl Blanchet wrote: >>>> Hello, >>>> >>>> I'm testing hooks in vdsm and I need some help on modifying one of >>>> your pyhton script : vmdisk (http://gerrit.ovirt.org/gitweb?p=3Dvdsm.g= it;a=3Dblob;f=3Dvdsm_hooks/vmdisk/before_vm_start.py;h=3D191d5c1af533e11d69= 9b1d715d3c1ea60e28b787;hb=3D6817f1c6e3f5bc137d1f3bef45a2d0191465c7a3) >>>> the hook works great and I'm able now to attach a file device as a >>>> second disk. But I want this disk to be the first bootable disk >>>> instead of the block device one created into the engine. In order to >>>> change the boot order of the disk, I added those lines: >>>> >>>> ... >>>> source =3D domxml.createElement('source') >>>> source.setAttribute('file', devpath) >>>> disk.appendChild(source) >>>> >>>> boot =3D domxml.createElement('boot') >>>> boot.setAttribute('order', 1) >>>> disk.appendChild(boot) >>>> >>>> # find a name for vdXXX >>>> ..... >>>> >>>> So the hook permit item >>>> (http://libvirt.org/formatdomain.html#elementsDisks) >>>> >>>> But the vm refuses booting without any logs anywhere... >>>> >>>> What is wrong? >>>> >>>> Thanks for your help >>> Hi, >>> 1. try to change the number to string: >>> boot.setAttribute('order', '1') >>> 2. you have a libvirt log at /var/log/libvirt/qemu/youvmname.log >>> 3. when the script enumerate all the disks you need to change the other= disk >>> boot order: >>> for d in xmldisks: >>> # here look in each disk for boot element and change its order at= tribute >>> # to other number, ie 2, 3 ... >>> >>> >>>> -- = >>>> Nathana=C3=ABl Blanchet >>>> >>>> Supervision r=C3=A9seau >>>> P=C3=B4le exploitation et maintenance >>>> D=C3=A9partement des syst=C3=A8mes d'information >>>> 227 avenue Professeur-Jean-Louis-Viala >>>> 34193 MONTPELLIER CEDEX 5 = >>>> T=C3=A9l. 33 (0)4 67 54 84 55 >>>> Fax 33 (0)4 67 54 84 14 >>>> blanchet(a)abes.fr >>>> >> -- = >> Nathana=C3=ABl Blanchet >> >> Supervision r=C3=A9seau >> P=C3=B4le exploitation et maintenance >> D=C3=A9partement des syst=C3=A8mes d'information >> 227 avenue Professeur-Jean-Louis-Viala >> 34193 MONTPELLIER CEDEX 5 = >> T=C3=A9l. 33 (0)4 67 54 84 55 >> Fax 33 (0)4 67 54 84 14 >> blanchet(a)abes.fr >> -- = Nathana=C3=ABl Blanchet Supervision r=C3=A9seau P=C3=B4le exploitation et maintenance D=C3=A9partement des syst=C3=A8mes d'information 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 = T=C3=A9l. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet(a)abes.fr --===============6356336809928618678==-- From shaharh at redhat.com Tue Jun 5 11:06:08 2012 Content-Type: multipart/mixed; boundary="===============5685306531167167515==" MIME-Version: 1.0 From: Shahar Havivi To: users at ovirt.org Subject: Re: [Users] modifying vmdisk hook Date: Tue, 05 Jun 2012 18:06:05 +0300 Message-ID: <20120605150604.GC13052@redhat.com> In-Reply-To: 4FCE1E58.5030105@abes.fr --===============5685306531167167515== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 05.06.12 16:57, Nathana=C3=ABl Blanchet wrote: > I cloned the git tree and copied the script in > /usr/libexec/vdsm/hooks/before_vm_start/ you need to make rpm that will install the scripts properly with the right permissions and other files. like that: $ ./autogen.sh --system --enable-hooks $ make rpm > = > Le 05/06/2012 16:27, Shahar Havivi a =C3=A9crit : > >On 05.06.12 16:21, Nathana=C3=ABl Blanchet wrote: > >>Hi, > >> > >>when executing several hook, I always have this issue in the vdsm logs : > >>File "/usr/libexec/vdsm/hooks/before_vm_start/40_directlun", line 9, > >>in > >>from vdsm import utils > >>ImportError: No module named vdsm > >> > >>and the vm refuses to boot > >> > >>how to correct this ? > >how did you install this? > >> > >>Le 04/06/2012 17:16, Shahar Havivi a =C3=A9crit : > >>>On 04.06.12 17:03, Nathana=C3=ABl Blanchet wrote: > >>>>Hello, > >>>> > >>>>I'm testing hooks in vdsm and I need some help on modifying one of > >>>>your pyhton script : vmdisk (http://gerrit.ovirt.org/gitweb?p=3Dvdsm.= git;a=3Dblob;f=3Dvdsm_hooks/vmdisk/before_vm_start.py;h=3D191d5c1af533e11d6= 99b1d715d3c1ea60e28b787;hb=3D6817f1c6e3f5bc137d1f3bef45a2d0191465c7a3) > >>>>the hook works great and I'm able now to attach a file device as a > >>>>second disk. But I want this disk to be the first bootable disk > >>>>instead of the block device one created into the engine. In order to > >>>>change the boot order of the disk, I added those lines: > >>>> > >>>>... > >>>>source =3D domxml.createElement('source') > >>>>source.setAttribute('file', devpath) > >>>>disk.appendChild(source) > >>>> > >>>>boot =3D domxml.createElement('boot') > >>>>boot.setAttribute('order', 1) > >>>>disk.appendChild(boot) > >>>> > >>>> # find a name for vdXXX > >>>>..... > >>>> > >>>>So the hook permit item > >>>>(http://libvirt.org/formatdomain.html#elementsDisks) > >>>> > >>>>But the vm refuses booting without any logs anywhere... > >>>> > >>>>What is wrong? > >>>> > >>>>Thanks for your help > >>>Hi, > >>>1. try to change the number to string: > >>> boot.setAttribute('order', '1') > >>>2. you have a libvirt log at /var/log/libvirt/qemu/youvmname.log > >>>3. when the script enumerate all the disks you need to change the othe= r disk > >>> boot order: > >>> for d in xmldisks: > >>> # here look in each disk for boot element and change its order a= ttribute > >>> # to other number, ie 2, 3 ... > >>> > >>> > >>>>-- = > >>>>Nathana=C3=ABl Blanchet > >>>> > >>>>Supervision r=C3=A9seau > >>>>P=C3=B4le exploitation et maintenance > >>>>D=C3=A9partement des syst=C3=A8mes d'information > >>>>227 avenue Professeur-Jean-Louis-Viala > >>>>34193 MONTPELLIER CEDEX 5 = > >>>>T=C3=A9l. 33 (0)4 67 54 84 55 > >>>>Fax 33 (0)4 67 54 84 14 > >>>>blanchet(a)abes.fr > >>>> > >>-- = > >>Nathana=C3=ABl Blanchet > >> > >>Supervision r=C3=A9seau > >>P=C3=B4le exploitation et maintenance > >>D=C3=A9partement des syst=C3=A8mes d'information > >>227 avenue Professeur-Jean-Louis-Viala > >>34193 MONTPELLIER CEDEX 5 = > >>T=C3=A9l. 33 (0)4 67 54 84 55 > >>Fax 33 (0)4 67 54 84 14 > >>blanchet(a)abes.fr > >> > = > -- = > Nathana=C3=ABl Blanchet > = > Supervision r=C3=A9seau > P=C3=B4le exploitation et maintenance > D=C3=A9partement des syst=C3=A8mes d'information > 227 avenue Professeur-Jean-Louis-Viala > 34193 MONTPELLIER CEDEX 5 = > T=C3=A9l. 33 (0)4 67 54 84 55 > Fax 33 (0)4 67 54 84 14 > blanchet(a)abes.fr >=20 --===============5685306531167167515==-- From blanchet at abes.fr Tue Jun 5 12:12:41 2012 Content-Type: multipart/mixed; boundary="===============5177027685862148041==" MIME-Version: 1.0 From: =?utf-8?q?Nathana=C3=ABl_Blanchet_=3Cblanchet_at_abes=2Efr=3E?= To: users at ovirt.org Subject: Re: [Users] modifying vmdisk hook Date: Tue, 05 Jun 2012 18:12:37 +0200 Message-ID: <4FCE2FF5.5090605@abes.fr> In-Reply-To: 20120605150604.GC13052@redhat.com --===============5177027685862148041== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable okay, but I was running vdsm 4.9.3.2 from the ovirt 3.0 stable = repository and I'm not sure 4.9.6.x is compatible with engine 3.0. So I built rpm on a F17 host and then installed the rpm = vdsm-hook-directlun-4.9.6-0.268.gitfc9e104.fc17.noarch.rpm to the host = with vdsm 4.9.3.2. According to the logs, issues about "from vdsm import = utils" are the same. I guess it must exist a way to make those scripts work with 4.9.3.2 = because those scripts have been written before this first ovirt release = had been available. Plus, vmdisk works fine but scripts invoking "from vdsm import utils" don't. Do you have any idea? Le 05/06/2012 17:06, Shahar Havivi a =C3=A9crit : > On 05.06.12 16:57, Nathana=C3=ABl Blanchet wrote: >> I cloned the git tree and copied the script in >> /usr/libexec/vdsm/hooks/before_vm_start/ > you need to make rpm that will install the scripts properly with the right > permissions and other files. > like that: > $ ./autogen.sh --system --enable-hooks > $ make rpm > >> Le 05/06/2012 16:27, Shahar Havivi a =C3=A9crit : >>> On 05.06.12 16:21, Nathana=C3=ABl Blanchet wrote: >>>> Hi, >>>> >>>> when executing several hook, I always have this issue in the vdsm logs= : >>>> File "/usr/libexec/vdsm/hooks/before_vm_start/40_directlun", line 9, >>>> in >>> >from vdsm import utils >>>> ImportError: No module named vdsm >>>> >>>> and the vm refuses to boot >>>> >>>> how to correct this ? >>> how did you install this? >>>> Le 04/06/2012 17:16, Shahar Havivi a =C3=A9crit : >>>>> On 04.06.12 17:03, Nathana=C3=ABl Blanchet wrote: >>>>>> Hello, >>>>>> >>>>>> I'm testing hooks in vdsm and I need some help on modifying one of >>>>>> your pyhton script : vmdisk (http://gerrit.ovirt.org/gitweb?p=3Dvdsm= .git;a=3Dblob;f=3Dvdsm_hooks/vmdisk/before_vm_start.py;h=3D191d5c1af533e11d= 699b1d715d3c1ea60e28b787;hb=3D6817f1c6e3f5bc137d1f3bef45a2d0191465c7a3) >>>>>> the hook works great and I'm able now to attach a file device as a >>>>>> second disk. But I want this disk to be the first bootable disk >>>>>> instead of the block device one created into the engine. In order to >>>>>> change the boot order of the disk, I added those lines: >>>>>> >>>>>> ... >>>>>> source =3D domxml.createElement('source') >>>>>> source.setAttribute('file', devpath) >>>>>> disk.appendChild(source) >>>>>> >>>>>> boot =3D domxml.createElement('boot') >>>>>> boot.setAttribute('order', 1) >>>>>> disk.appendChild(boot) >>>>>> >>>>>> # find a name for vdXXX >>>>>> ..... >>>>>> >>>>>> So the hook permit item >>>>>> (http://libvirt.org/formatdomain.html#elementsDisks) >>>>>> >>>>>> But the vm refuses booting without any logs anywhere... >>>>>> >>>>>> What is wrong? >>>>>> >>>>>> Thanks for your help >>>>> Hi, >>>>> 1. try to change the number to string: >>>>> boot.setAttribute('order', '1') >>>>> 2. you have a libvirt log at /var/log/libvirt/qemu/youvmname.log >>>>> 3. when the script enumerate all the disks you need to change the oth= er disk >>>>> boot order: >>>>> for d in xmldisks: >>>>> # here look in each disk for boot element and change its order = attribute >>>>> # to other number, ie 2, 3 ... >>>>> >>>>> >>>>>> -- = >>>>>> Nathana=C3=ABl Blanchet >>>>>> >>>>>> Supervision r=C3=A9seau >>>>>> P=C3=B4le exploitation et maintenance >>>>>> D=C3=A9partement des syst=C3=A8mes d'information >>>>>> 227 avenue Professeur-Jean-Louis-Viala >>>>>> 34193 MONTPELLIER CEDEX 5 = >>>>>> T=C3=A9l. 33 (0)4 67 54 84 55 >>>>>> Fax 33 (0)4 67 54 84 14 >>>>>> blanchet(a)abes.fr >>>>>> >>>> -- = >>>> Nathana=C3=ABl Blanchet >>>> >>>> Supervision r=C3=A9seau >>>> P=C3=B4le exploitation et maintenance >>>> D=C3=A9partement des syst=C3=A8mes d'information >>>> 227 avenue Professeur-Jean-Louis-Viala >>>> 34193 MONTPELLIER CEDEX 5 = >>>> T=C3=A9l. 33 (0)4 67 54 84 55 >>>> Fax 33 (0)4 67 54 84 14 >>>> blanchet(a)abes.fr >>>> >> -- = >> Nathana=C3=ABl Blanchet >> >> Supervision r=C3=A9seau >> P=C3=B4le exploitation et maintenance >> D=C3=A9partement des syst=C3=A8mes d'information >> 227 avenue Professeur-Jean-Louis-Viala >> 34193 MONTPELLIER CEDEX 5 = >> T=C3=A9l. 33 (0)4 67 54 84 55 >> Fax 33 (0)4 67 54 84 14 >> blanchet(a)abes.fr >> -- = Nathana=C3=ABl Blanchet Supervision r=C3=A9seau P=C3=B4le exploitation et maintenance D=C3=A9partement des syst=C3=A8mes d'information 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 = T=C3=A9l. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet(a)abes.fr --===============5177027685862148041==-- From shaharh at redhat.com Wed Jun 6 03:31:05 2012 Content-Type: multipart/mixed; boundary="===============8044515843567221741==" MIME-Version: 1.0 From: Shahar Havivi To: users at ovirt.org Subject: Re: [Users] modifying vmdisk hook Date: Wed, 06 Jun 2012 10:30:57 +0300 Message-ID: <20120606073056.GA20527@redhat.com> In-Reply-To: 4FCE2FF5.5090605@abes.fr --===============8044515843567221741== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 05.06.12 18:12, Nathana=C3=ABl Blanchet wrote: > okay, but I was running vdsm 4.9.3.2 from the ovirt 3.0 stable > repository and I'm not sure 4.9.6.x is compatible with engine 3.0. > So I built rpm on a F17 host and then installed the rpm > vdsm-hook-directlun-4.9.6-0.268.gitfc9e104.fc17.noarch.rpm to the > host with vdsm 4.9.3.2. According to the logs, issues about "from > vdsm import utils" are the same. > I guess it must exist a way to make those scripts work with 4.9.3.2 > because those scripts have been written before this first ovirt > release had been available. > Plus, vmdisk works fine but scripts invoking "from vdsm import utils" don= 't. > = > Do you have any idea? No, You can try asking in vdsm mailing list: vdsm-devel(a)ovirt.org > = > Le 05/06/2012 17:06, Shahar Havivi a =C3=A9crit : > >On 05.06.12 16:57, Nathana=C3=ABl Blanchet wrote: > >>I cloned the git tree and copied the script in > >>/usr/libexec/vdsm/hooks/before_vm_start/ > >you need to make rpm that will install the scripts properly with the rig= ht > >permissions and other files. > >like that: > >$ ./autogen.sh --system --enable-hooks > >$ make rpm > > > >>Le 05/06/2012 16:27, Shahar Havivi a =C3=A9crit : > >>>On 05.06.12 16:21, Nathana=C3=ABl Blanchet wrote: > >>>>Hi, > >>>> > >>>>when executing several hook, I always have this issue in the vdsm log= s : > >>>>File "/usr/libexec/vdsm/hooks/before_vm_start/40_directlun", line 9, > >>>>in > >>>>from vdsm import utils > >>>>ImportError: No module named vdsm > >>>> > >>>>and the vm refuses to boot > >>>> > >>>>how to correct this ? > >>>how did you install this? > >>>>Le 04/06/2012 17:16, Shahar Havivi a =C3=A9crit : > >>>>>On 04.06.12 17:03, Nathana=C3=ABl Blanchet wrote: > >>>>>>Hello, > >>>>>> > >>>>>>I'm testing hooks in vdsm and I need some help on modifying one of > >>>>>>your pyhton script : vmdisk (http://gerrit.ovirt.org/gitweb?p=3Dvds= m.git;a=3Dblob;f=3Dvdsm_hooks/vmdisk/before_vm_start.py;h=3D191d5c1af533e11= d699b1d715d3c1ea60e28b787;hb=3D6817f1c6e3f5bc137d1f3bef45a2d0191465c7a3) > >>>>>>the hook works great and I'm able now to attach a file device as a > >>>>>>second disk. But I want this disk to be the first bootable disk > >>>>>>instead of the block device one created into the engine. In order to > >>>>>>change the boot order of the disk, I added those lines: > >>>>>> > >>>>>>... > >>>>>>source =3D domxml.createElement('source') > >>>>>>source.setAttribute('file', devpath) > >>>>>>disk.appendChild(source) > >>>>>> > >>>>>>boot =3D domxml.createElement('boot') > >>>>>>boot.setAttribute('order', 1) > >>>>>>disk.appendChild(boot) > >>>>>> > >>>>>> # find a name for vdXXX > >>>>>>..... > >>>>>> > >>>>>>So the hook permit item > >>>>>>(http://libvirt.org/formatdomain.html#elementsDisks) > >>>>>> > >>>>>>But the vm refuses booting without any logs anywhere... > >>>>>> > >>>>>>What is wrong? > >>>>>> > >>>>>>Thanks for your help > >>>>>Hi, > >>>>>1. try to change the number to string: > >>>>> boot.setAttribute('order', '1') > >>>>>2. you have a libvirt log at /var/log/libvirt/qemu/youvmname.log > >>>>>3. when the script enumerate all the disks you need to change the ot= her disk > >>>>> boot order: > >>>>> for d in xmldisks: > >>>>> # here look in each disk for boot element and change its order= attribute > >>>>> # to other number, ie 2, 3 ... > >>>>> > >>>>> > >>>>>>-- = > >>>>>>Nathana=C3=ABl Blanchet > >>>>>> > >>>>>>Supervision r=C3=A9seau > >>>>>>P=C3=B4le exploitation et maintenance > >>>>>>D=C3=A9partement des syst=C3=A8mes d'information > >>>>>>227 avenue Professeur-Jean-Louis-Viala > >>>>>>34193 MONTPELLIER CEDEX 5 = > >>>>>>T=C3=A9l. 33 (0)4 67 54 84 55 > >>>>>>Fax 33 (0)4 67 54 84 14 > >>>>>>blanchet(a)abes.fr > >>>>>> > >>>>-- = > >>>>Nathana=C3=ABl Blanchet > >>>> > >>>>Supervision r=C3=A9seau > >>>>P=C3=B4le exploitation et maintenance > >>>>D=C3=A9partement des syst=C3=A8mes d'information > >>>>227 avenue Professeur-Jean-Louis-Viala > >>>>34193 MONTPELLIER CEDEX 5 = > >>>>T=C3=A9l. 33 (0)4 67 54 84 55 > >>>>Fax 33 (0)4 67 54 84 14 > >>>>blanchet(a)abes.fr > >>>> > >>-- = > >>Nathana=C3=ABl Blanchet > >> > >>Supervision r=C3=A9seau > >>P=C3=B4le exploitation et maintenance > >>D=C3=A9partement des syst=C3=A8mes d'information > >>227 avenue Professeur-Jean-Louis-Viala > >>34193 MONTPELLIER CEDEX 5 = > >>T=C3=A9l. 33 (0)4 67 54 84 55 > >>Fax 33 (0)4 67 54 84 14 > >>blanchet(a)abes.fr > >> > = > -- = > Nathana=C3=ABl Blanchet > = > Supervision r=C3=A9seau > P=C3=B4le exploitation et maintenance > D=C3=A9partement des syst=C3=A8mes d'information > 227 avenue Professeur-Jean-Louis-Viala > 34193 MONTPELLIER CEDEX 5 = > T=C3=A9l. 33 (0)4 67 54 84 55 > Fax 33 (0)4 67 54 84 14 > blanchet(a)abes.fr >=20 --===============8044515843567221741==-- From danken at redhat.com Wed Jun 6 03:43:55 2012 Content-Type: multipart/mixed; boundary="===============5753888274077119321==" MIME-Version: 1.0 From: Dan Kenigsberg To: users at ovirt.org Subject: Re: [Users] modifying vmdisk hook Date: Wed, 06 Jun 2012 10:43:51 +0300 Message-ID: <20120606074351.GE5797@redhat.com> In-Reply-To: 4FCE2FF5.5090605@abes.fr --===============5753888274077119321== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Tue, Jun 05, 2012 at 06:12:37PM +0200, Nathana=C3=ABl Blanchet wrote: > okay, but I was running vdsm 4.9.3.2 from the ovirt 3.0 stable > repository and I'm not sure 4.9.6.x is compatible with engine 3.0. > So I built rpm on a F17 host and then installed the rpm > vdsm-hook-directlun-4.9.6-0.268.gitfc9e104.fc17.noarch.rpm to the > host with vdsm 4.9.3.2. According to the logs, issues about "from > vdsm import utils" are the same. > I guess it must exist a way to make those scripts work with 4.9.3.2 > because those scripts have been written before this first ovirt > release had been available. > Plus, vmdisk works fine but scripts invoking "from vdsm import utils" don= 't. > = > Do you have any idea? The vdsm package you are importing from is rather new and did not exist in vdsm-4.9.3.2. You should probably use the hooks from http://gerrit.ovirt.org/gitweb?p=3Dvdsm.git;a=3Dtree;f=3Dvdsm_hooks;hb=3Dv4= .9.3.2 when vdsm-4.9.3.2 is installed. Dan. --===============5753888274077119321==-- From blanchet at abes.fr Wed Jun 6 03:49:26 2012 Content-Type: multipart/mixed; boundary="===============1006813602554018049==" MIME-Version: 1.0 From: =?utf-8?q?Nathana=C3=ABl_Blanchet_=3Cblanchet_at_abes=2Efr=3E?= To: users at ovirt.org Subject: Re: [Users] modifying vmdisk hook Date: Wed, 06 Jun 2012 09:49:24 +0200 Message-ID: <4FCF0B84.80703@abes.fr> In-Reply-To: 20120606073056.GA20527@redhat.com --===============1006813602554018049== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable hello, I found the origin of the issue: the repository = /usr/lib/python2.7/site-packages/vdsm(/utils.py) is not installed by the = stable release. I created rpm from the git repository on a f17 host and = copied manually it to the f16 host and it works fine now. I'll ask to the vdsm team which package must provides this directory. Thanks for your help. Le 06/06/2012 09:30, Shahar Havivi a =C3=A9crit : > On 05.06.12 18:12, Nathana=C3=ABl Blanchet wrote: >> okay, but I was running vdsm 4.9.3.2 from the ovirt 3.0 stable >> repository and I'm not sure 4.9.6.x is compatible with engine 3.0. >> So I built rpm on a F17 host and then installed the rpm >> vdsm-hook-directlun-4.9.6-0.268.gitfc9e104.fc17.noarch.rpm to the >> host with vdsm 4.9.3.2. According to the logs, issues about "from >> vdsm import utils" are the same. >> I guess it must exist a way to make those scripts work with 4.9.3.2 >> because those scripts have been written before this first ovirt >> release had been available. >> Plus, vmdisk works fine but scripts invoking "from vdsm import utils" do= n't. >> >> Do you have any idea? > No, > You can try asking in vdsm mailing list: vdsm-devel(a)ovirt.org > >> Le 05/06/2012 17:06, Shahar Havivi a =C3=A9crit : >>> On 05.06.12 16:57, Nathana=C3=ABl Blanchet wrote: >>>> I cloned the git tree and copied the script in >>>> /usr/libexec/vdsm/hooks/before_vm_start/ >>> you need to make rpm that will install the scripts properly with the ri= ght >>> permissions and other files. >>> like that: >>> $ ./autogen.sh --system --enable-hooks >>> $ make rpm >>> >>>> Le 05/06/2012 16:27, Shahar Havivi a =C3=A9crit : >>>>> On 05.06.12 16:21, Nathana=C3=ABl Blanchet wrote: >>>>>> Hi, >>>>>> >>>>>> when executing several hook, I always have this issue in the vdsm lo= gs : >>>>>> File "/usr/libexec/vdsm/hooks/before_vm_start/40_directlun", line 9, >>>>>> in >>>>> >from vdsm import utils >>>>>> ImportError: No module named vdsm >>>>>> >>>>>> and the vm refuses to boot >>>>>> >>>>>> how to correct this ? >>>>> how did you install this? >>>>>> Le 04/06/2012 17:16, Shahar Havivi a =C3=A9crit : >>>>>>> On 04.06.12 17:03, Nathana=C3=ABl Blanchet wrote: >>>>>>>> Hello, >>>>>>>> >>>>>>>> I'm testing hooks in vdsm and I need some help on modifying one of >>>>>>>> your pyhton script : vmdisk (http://gerrit.ovirt.org/gitweb?p=3Dvd= sm.git;a=3Dblob;f=3Dvdsm_hooks/vmdisk/before_vm_start.py;h=3D191d5c1af533e1= 1d699b1d715d3c1ea60e28b787;hb=3D6817f1c6e3f5bc137d1f3bef45a2d0191465c7a3) >>>>>>>> the hook works great and I'm able now to attach a file device as a >>>>>>>> second disk. But I want this disk to be the first bootable disk >>>>>>>> instead of the block device one created into the engine. In order = to >>>>>>>> change the boot order of the disk, I added those lines: >>>>>>>> >>>>>>>> ... >>>>>>>> source =3D domxml.createElement('source') >>>>>>>> source.setAttribute('file', devpath) >>>>>>>> disk.appendChild(source) >>>>>>>> >>>>>>>> boot =3D domxml.createElement('boot') >>>>>>>> boot.setAttribute('order', 1) >>>>>>>> disk.appendChild(boot) >>>>>>>> >>>>>>>> # find a name for vdXXX >>>>>>>> ..... >>>>>>>> >>>>>>>> So the hook permit item >>>>>>>> (http://libvirt.org/formatdomain.html#elementsDisks) >>>>>>>> >>>>>>>> But the vm refuses booting without any logs anywhere... >>>>>>>> >>>>>>>> What is wrong? >>>>>>>> >>>>>>>> Thanks for your help >>>>>>> Hi, >>>>>>> 1. try to change the number to string: >>>>>>> boot.setAttribute('order', '1') >>>>>>> 2. you have a libvirt log at /var/log/libvirt/qemu/youvmname.log >>>>>>> 3. when the script enumerate all the disks you need to change the o= ther disk >>>>>>> boot order: >>>>>>> for d in xmldisks: >>>>>>> # here look in each disk for boot element and change its orde= r attribute >>>>>>> # to other number, ie 2, 3 ... >>>>>>> >>>>>>> >>>>>>>> -- = >>>>>>>> Nathana=C3=ABl Blanchet >>>>>>>> >>>>>>>> Supervision r=C3=A9seau >>>>>>>> P=C3=B4le exploitation et maintenance >>>>>>>> D=C3=A9partement des syst=C3=A8mes d'information >>>>>>>> 227 avenue Professeur-Jean-Louis-Viala >>>>>>>> 34193 MONTPELLIER CEDEX 5 = >>>>>>>> T=C3=A9l. 33 (0)4 67 54 84 55 >>>>>>>> Fax 33 (0)4 67 54 84 14 >>>>>>>> blanchet(a)abes.fr >>>>>>>> >>>>>> -- = >>>>>> Nathana=C3=ABl Blanchet >>>>>> >>>>>> Supervision r=C3=A9seau >>>>>> P=C3=B4le exploitation et maintenance >>>>>> D=C3=A9partement des syst=C3=A8mes d'information >>>>>> 227 avenue Professeur-Jean-Louis-Viala >>>>>> 34193 MONTPELLIER CEDEX 5 = >>>>>> T=C3=A9l. 33 (0)4 67 54 84 55 >>>>>> Fax 33 (0)4 67 54 84 14 >>>>>> blanchet(a)abes.fr >>>>>> >>>> -- = >>>> Nathana=C3=ABl Blanchet >>>> >>>> Supervision r=C3=A9seau >>>> P=C3=B4le exploitation et maintenance >>>> D=C3=A9partement des syst=C3=A8mes d'information >>>> 227 avenue Professeur-Jean-Louis-Viala >>>> 34193 MONTPELLIER CEDEX 5 = >>>> T=C3=A9l. 33 (0)4 67 54 84 55 >>>> Fax 33 (0)4 67 54 84 14 >>>> blanchet(a)abes.fr >>>> >> -- = >> Nathana=C3=ABl Blanchet >> >> Supervision r=C3=A9seau >> P=C3=B4le exploitation et maintenance >> D=C3=A9partement des syst=C3=A8mes d'information >> 227 avenue Professeur-Jean-Louis-Viala >> 34193 MONTPELLIER CEDEX 5 = >> T=C3=A9l. 33 (0)4 67 54 84 55 >> Fax 33 (0)4 67 54 84 14 >> blanchet(a)abes.fr >> -- = Nathana=C3=ABl Blanchet Supervision r=C3=A9seau P=C3=B4le exploitation et maintenance D=C3=A9partement des syst=C3=A8mes d'information 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 = T=C3=A9l. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet(a)abes.fr --===============1006813602554018049==-- From blanchet at abes.fr Wed Jun 6 05:38:32 2012 Content-Type: multipart/mixed; boundary="===============5129605516780882568==" MIME-Version: 1.0 From: =?utf-8?q?Nathana=C3=ABl_Blanchet_=3Cblanchet_at_abes=2Efr=3E?= To: users at ovirt.org Subject: Re: [Users] modifying vmdisk hook Date: Wed, 06 Jun 2012 11:38:29 +0200 Message-ID: <4FCF2515.9060702@abes.fr> In-Reply-To: 20120606074351.GE5797@redhat.com --===============5129605516780882568== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Thanks for answering, all is logical now we found the reason. I think = there is a lack of documentation about the hook scripts while there are = very useful in my case, waiting for engine implementation in ovirt 3.1. = I would have never found the good gerrit link without your help. How can I get a tree of an old version except by directly adding = hb=3Dv4.9.3.2 instead of hb=3DHEAD in the url? Le 06/06/2012 09:43, Dan Kenigsberg a =C3=A9crit : > On Tue, Jun 05, 2012 at 06:12:37PM +0200, Nathana=C3=ABl Blanchet wrote: >> okay, but I was running vdsm 4.9.3.2 from the ovirt 3.0 stable >> repository and I'm not sure 4.9.6.x is compatible with engine 3.0. >> So I built rpm on a F17 host and then installed the rpm >> vdsm-hook-directlun-4.9.6-0.268.gitfc9e104.fc17.noarch.rpm to the >> host with vdsm 4.9.3.2. According to the logs, issues about "from >> vdsm import utils" are the same. >> I guess it must exist a way to make those scripts work with 4.9.3.2 >> because those scripts have been written before this first ovirt >> release had been available. >> Plus, vmdisk works fine but scripts invoking "from vdsm import utils" do= n't. >> >> Do you have any idea? > The vdsm package you are importing from is rather new and did not exist > in vdsm-4.9.3.2. You should probably use the hooks from > http://gerrit.ovirt.org/gitweb?p=3Dvdsm.git;a=3Dtree;f=3Dvdsm_hooks;hb=3D= v4.9.3.2 > when vdsm-4.9.3.2 is installed. > > Dan. -- = Nathana=C3=ABl Blanchet Supervision r=C3=A9seau P=C3=B4le exploitation et maintenance D=C3=A9partement des syst=C3=A8mes d'information 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 = T=C3=A9l. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet(a)abes.fr --===============5129605516780882568==-- From danken at redhat.com Wed Jun 6 06:58:50 2012 Content-Type: multipart/mixed; boundary="===============0941669643912633986==" MIME-Version: 1.0 From: Dan Kenigsberg To: users at ovirt.org Subject: Re: [Users] modifying vmdisk hook Date: Wed, 06 Jun 2012 13:58:46 +0300 Message-ID: <20120606105845.GN5797@redhat.com> In-Reply-To: 4FCF2515.9060702@abes.fr --===============0941669643912633986== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Wed, Jun 06, 2012 at 11:38:29AM +0200, Nathana=C3=ABl Blanchet wrote: > Thanks for answering, all is logical now we found the reason. I > think there is a lack of documentation about the hook scripts while Unfortunately this is true for every aspect of ovirt... > there are very useful in my case, waiting for engine implementation > in ovirt 3.1. I would have never found the good gerrit link without > your help. > How can I get a tree of an old version except by directly adding > hb=3Dv4.9.3.2 instead of hb=3DHEAD in the url? in you local git-clone, you can git-checkout v4.9.3.2 and see history recreated. --===============0941669643912633986==--