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

Re: [libvirt] Problem with libvirt daemon

On 11/10/2011 09:39 AM, Wouter - Iamotor wrote:

My bad, I thought it said that it was running but it that the daemon wasn't doing anything.

Because when I try to run this php script:

Instead of that uri, try this one: "qemu:///system".

And if you want to connect to virsh on some other host "remotehost", use this uri:

   qemu+ssh://root remotehost/system

echo ("Connecting to libvirt (URI:$uri)\n");
if ($conn==false)
     echo ("Libvirt last error: ".libvirt_get_last_error()."\n");
     echo ("hostname:$hostname\n");
     echo ("Domain count: Active ".libvirt_get_active_domain_count($conn).",Inactive ".libvirt_get_inactive_domain_count($conn).", Total ".libvirt_get_domain_count($conn)."\n");

     foreach ($domains as $dom)
         echo ("Name:\t".libvirt_domain_get_name($dom)."\n");

The script can also be found on this link:

Then I get this error:
Connecting to libvirt (URI:qemu+tcp:///system) Libvirt last error: unable to connect to server at 'localhost:16509': Connection refused

The user team7 is added to the group libvirtd and kvm.

Which configuration is necessary so that the script could run on the server?

Thanks for your help so far.

With kind regards,

-----Oorspronkelijk bericht-----
Van: Daniel P. Berrange [mailto:berrange redhat com]
Verzonden: donderdag 10 november 2011 15:23
Aan: Wouter - Iamotor
CC: libvirt-list redhat com
Onderwerp: Re: [libvirt] Problem with libvirt daemon

On Thu, Nov 10, 2011 at 02:46:42PM +0100, Wouter - Iamotor wrote:

I have a problem with the libvirt daemon. I have a little php script
which should connect with libvirt, but it won't.

When I try to start the libvirt daemon I get this error (using the
command libvirtd --listen):

2011-11-09 19:35:18.095: 3560: info : libvirt version: 0.9.7

2011-11-09 19:35:18.095: 3560: error : virPidFileAcquirePath:345 :
Failed to acquire pid file '/var/run/libvirtd.pid': Resource
temporarily unavailable

So the daemon won't start and isn't started yet. If I check if the
service is running with ps -ef | grep libvirtd I get this output:

root      2865     1  0 15:50 ?        00:00:00 /usr/sbin/libvirtd -d

root      3149     1  0 19:17 ?        00:00:00 libvirtd -d

root      3206     1  0 19:17 ?        00:00:00 libvirtd -dl

root      3300     1  0 19:20 ?        00:00:00 libvirtd --listen --daemon

root      3356     1  0 19:21 ?        00:00:00 libvirtd --listen --daemon

root      3564  3077  0 19:36 pts/0    00:00:00 grep --color=auto libvirtd

Here you can see that the service isn't running.
Err, that shows precisely the opposite of what you say. It shows that you have libvirtd running *5* times, no doubt due to you deleting the pidfiles.


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