S
S
shadowalone2012-02-12 09:08:44
PHP
shadowalone, 2012-02-12 09:08:44

libvirt via web

Can anyone suggest a solution.
What you need is not fancy shells with the creation of virtual machines, etc., but a completely simple option.
There are 3 buttons (links) on the web - Shutdown, Destroy, Start
so that you can execute commands like
# virsh destroy domainname

Absolutely simple option. The search did not find anything, except for heaped shells. And they are useless.
You just need to give access to the ability to Hard Reset the virtual machine. Separately, each to his own virtual machine.

I myself leaned towards writing a simple php script that would create a file in a certain directory, and the cron from root would check for the presence of this file, and accordingly, if it was found, it would delete the file and reboot the virtual machine with two commands : the thread is a ready-made solution so as not to create a bicycle?
# virsh destroy domain
# sleep 5
# virsh start domain



UPD: described in detail here .

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivan Komarov, 2012-02-12
@shadowalone

Unfortunately, I am not familiar with libvirt. But I solved this problem for xen and vmware through native api. There are a lot of bindings for libvirt: libvirt.org/bindings.html - there are both php and perl. What's stopping you from using them?

R
retspen, 2012-05-02
@retspen

webvirtmgr.net

D
DmZ, 2012-02-12
@DmZ

There is an API for Python that comes out of the box. You can write a simple service.
But there is already virttool . Although not as simple as it should be (see screenshots ), it does the job of managing libvirt domains via the web.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question