[Users] modifying vmdisk hook

Shahar Havivi shaharh at redhat.com
Tue Jun 5 14:27:56 UTC 2012


On 05.06.12 16:21, Nathanaël 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 <module>
> 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 écrit :
> >On 04.06.12 17:03, Nathanaël 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=vdsm.git;a=blob;f=vdsm_hooks/vmdisk/before_vm_start.py;h=191d5c1af533e11d699b1d715d3c1ea60e28b787;hb=6817f1c6e3f5bc137d1f3bef45a2d0191465c7a3)
> >>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 = domxml.createElement('source')
> >>source.setAttribute('file', devpath)
> >>disk.appendChild(source)
> >>
> >>boot = domxml.createElement('boot')
> >>boot.setAttribute('order', 1)
> >>disk.appendChild(boot)
> >>
> >>  # find a name for vdXXX
> >>.....
> >>
> >>So the hook permit<boot order=1>  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 attribute
> >      # to other number, ie 2, 3 ...
> >
> >
> >>-- 
> >>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
> >>blanchet at abes.fr
> >>
> 
> -- 
> 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
> blanchet at abes.fr
> 



More information about the Users mailing list