Re: [libvirt] Using libvirt from PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Sorry, I fail email 101, third attempt to make this go to the list *

Radek,

Not to advertise blatantly, but how attached are you to PHP? I'm
currently working on a Django (python) WebApp that (although its *very*
pre-release) could probably be adapted to what you're doing. If you are
interested in assisting in development you'd be welcome to, or if you
just wanted to fork off the code into your own thing you could do that
too. My system consists of a python daemon used for actual libvirt
interaction and a separate django web interface that interacts with the
daemon via AMF over https.

If you want to stick with what you have now, you could try doing
something similar with a python daemon (you really need something like
that for the sake of efficiency anyway, unless you can come up with a
better way of maintaining libvirt connections from a stateless webapp)
that your PHP frontend connects to. Or you could just steal my daemon
code, although at the moment all it really does is monitoring and (as of
yesterday) live migrations.

What I have so far: http://trac.osuosl.org/trac/virtadmin

On Wed, Mar 25, 2009 at 2:01 PM, Radek Hladik <radek@xxxxxxxxxx> wrote:
> Hi,
>        I am developing wimple web application in PHP to monitor and control
> VMs using libvirt. I hope it could become simple library for doing basic
> things with VMs. And I would like to ask for your opinion about different
> possibilities of calling libvirt.
>
> Option 1) I am calling virsh via exec command now (one virsh for every
> libvirt command). This can be used for local libvirt but it is very
> inefficient. The overhead for remote libvirt would be unbearable. I could
> run one virsh per page and use it "interactively" so the overhead gets
> lower.
> Option 2) The other option is to create Zend extension which should be able
> to call libvirt directly from C. However I've never done anything like that
> so I do not know, whether it is reasonable or not.
> Option 3) I could also create some "wrapper daemon" in C or other language
> with libvirt binding. But I think that this is an ugly way :-)
> Option 4) I could "talk" directly to the libvirt socket. But I am not sure
> how the communication goes there and whether it is stable or changes with
> every version. And I consider the socket to be internal thing of libvirt...
>
> Is there any other option I missed? And which one would you suggest?
>
> Radek
>
> --
> Libvir-list mailing list
> Libvir-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list
>

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]