[libvirt] qemu hook is not starting

Csom Gyula csom at interface.hu
Thu Jul 8 20:32:57 UTC 2010


Thank you very much for your response! It was the version... you pointed at.

I was testing on my home coputer... that is on Ubuntu it has libvirt v.0.7. Fortunately our real environment (Debian) has libvirt v.0.8.

Feladó: Daniel Veillard [veillard at redhat.com]
Küldve: 2010. július 8. 22:01
Címzett: Csom Gyula
Másolatot kap: libvir-list at redhat.com
Tárgy: Re: [libvirt] qemu hook is not starting

On Thu, Jul 08, 2010 at 06:49:25PM +0000, Csom Gyula wrote:
> Hi there!
> Since our cloud system that is currently under development, might need it, I've tested libvirt
> domain hooks but unfortunately failed. I've tried the following scenario:
> 1. create the hook directory...
> # mkdir /etc/libvirt/hook
> # chmod 755 /etc/libvirt/hook
> 2. ... or maybe hooks?
> # ln -s hook hooks

  it's hooks and make it a directory !

> 3. create the hook script
> # vi /etc/libvirt/hook/qemu
> # cat /etc/libvirt/hook/qemu
> #!/bin/bash
> echo "*****************************************************" >> /tmp/libvirt.log
> echo "qemu-hook: $@" >> /tmp/libvirt.log
> echo "*****************************************************" >> /tmp/libvirt.log
> echo "test error" >&2
> exit 1
> # chmod 755 /etc/libvirt/hook/qemu
> 4. Then I restarted the libvirt daemon and created a domain through virsh. Unfortunately nothing
> happened. That is the vm started - although according to the documentation [1] it should not have
> to start: "a non-zero return value from the script will abort the domain startup operation, and if
> an error string is passed on stderr by the hook script, it will be provided back to the user
> at the libvirt API level". Also the messages echod by the script did not appear in the log.
> Could you please tell what I missed? What (else) should be done in order to run hooks?

  Can you double check libvirt daemon output ?
Also make sure your version is recent. It was added to libvirt in 0.8.0
so anything older won't have it and ignore yout scripts,


Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

More information about the libvir-list mailing list