libvirt0 unable to operate due to missing essential files

Bug #527875 reported by IAN DELANEY
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Invalid
Low
Unassigned

Bug Description

Binary package hint: libvirt0

libvirt is the lynch pin to running virtual environments. In karmic, it curiously fails to create the essential files
/var/run/libvirt/unix_sock_ro or something close to that, and /var/run/libvirt/unix_sock_rw.

 I've run libvirt in other distros and cannot figure what's going on here. By rights nothing should work. In a xen environment, it allows connection to xen and to test://default. It can't connect to qemu or kvm due to their absence. It causes failure in every other way that depends on their existance. namely connecting to vnc consoles.
When creating a vm from virt-manager. a difficult task in itself, it can't offer a console from which to perform an installation or to run the vm. Trying to use the standard virt-viewer or vncviewer just come to grief from looking for the files

idella@karmic:~$ sudo virt-viewer -c xen Squeeze
libvir: Xen Daemon error : internal error failed to connect to xend
libvir: Remote error : unable to connect to '/var/run/libvirt/libvirt-sock-ro': No such file or directory
libvir: warning : Failed to find the network: Is the daemon running ?
libvir: Remote error : unable to connect to '/var/run/libvirt/libvirt-sock-ro': No such file or directory
libvir: warning : Failed to find the interface: Is the daemon running ?
libvir: Remote error : unable to connect to '/var/run/libvirt/libvirt-sock-ro': No such file or directory
libvir: Remote error : unable to connect to '/var/run/libvirt/libvirt-sock-ro': No such file or directory
libvir: warning : Failed to find a node driver: Is the libvirtd daemon running ?

The curious thing about libvirt in xen in karmic is the choice in /etc/xen/xend-cofig.sxp.
In every other distro it's recommended to use the choice (xend-unix-server yes)

In karmic this choice is simply not there, so I'm running on

(xend-http-server yes)
(xend-port 8000)

The same error was is in place in lenny. Once creating a vm it fails in both debian distros to properly connect to a vnc console and display the vm. Totally useless. It lets virt-manager down and the lets theuser down who is trying to manage vms.

These packages need to be properly integrated to work together. Currently they are disintegrated.

Running in a regular kernel, these are created, and only then can you use qemu and kvm. ??? !!

There is an influence of xen somehow upon libvirt to change this operating mode.

libvirt0-0.7.0-1ubuntu13.1

idella@karmic:~$ lsb_release -rd
Description: Ubuntu 9.10
Release: 9.10

ProblemType: Bug
Architecture: i386
Date: Fri Feb 26 00:16:19 2010
DistroRelease: Ubuntu 9.10
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
Package: libvirt0 0.7.0-1ubuntu13.1
ProcEnviron:
 LANG=en_AU.UTF-8
 SHELL=/bin/bash
SourcePackage: libvirt
Uname: Linux 2.6.31-xen-r10 i686

Revision history for this message
IAN DELANEY (johneed) wrote :
Revision history for this message
Chuck Short (zulcss) wrote :

I am not able to reproduce. Can you give the output of /var/run/ibvirt?

Thanks
chuck

Changed in libvirt (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
IAN DELANEY (johneed) wrote :

Thanks for answering so quickly. The output should be

idella@karmic:~/Documents$ ls /var/run/libvirt
qemu

It needs to list the sockets as listed above.

libvir: Remote error : unable to connect to '/var/run/libvirt/libvirt-sock-ro': No such file or directory
libvir: Remote error : unable to connect to '/var/run/libvirt/libvirt-sock-ro': No such file or

and '/var/run/libvirt/libvirt-sock-rw.

I can only say I've installed it and unistalled it a number of times, trying to get a workable state.
I've determined these are key components to libvirt.
In a regular kernel booted environment, they are made. It is sane
That's what so ridiculous about this. It's occuring in a xen environment, NOT a regular kernel. How can xend or such interfere?

I can't understand why libvirt actually connects to xen at all! There should be set of sockets under ~/.libvirt too, but bo.

idella@karmic:~$ ls .libvirt
qemu storage

Not there. Their absence is undermining every other thing that libvirt interacts with re virtinst and virt-manager, as I described above. It doesn't surprise me that it doesn't reproduce. I think something has gone haywire on my setup, but they are all standard packages installed in a standard way. I've just relied on re-installing to straighten it out, but no. Maybe can't be reproduced which is unfortunate on my part, since it still needs to be debugged.

Key points, occurs in a xen environment, wrecks most everything else. Nothing radical in /etc/libvirt/libvirtd.conf

Revision history for this message
IAN DELANEY (johneed) wrote :

Chuck Short, I hope to hear from you again, I can see you are a key participant in dealing with these bugs.
It's Saturday now so I suppose I can't expect you to reply before Monday, and you are busy I'm sure.
From what I've gleaned, you're not going to reproduce. The sockets are so fundamental that they surely would have been reported as a bug by someone else by now. So I suppose it follows that is is low priority at your end. But something has gone awry. I would hope for you to grant it some input so as to finally achieve a sane setup on my karmic.

I've pursued libvirt quite a bit, on lenny for extended periods, and gentoo. http://bugs.gentoo.org/show_bug.cgi?id=305401
This flaw leaves my completely puzzled, short of being fluent in python programming, there is nowhere to go with it. From what I've read, creating the sockets and assigning permissions is one of the first things executed by libvirtd. How can this sytem do anything without them? i.e. Why does virsh connect to xen in their absence?

The only link to xen I can trace that might bear some influence I've already mentioned. In xend-config.sxp, one of the fundamental choices to select is the type of server. The choice of

(xend-http-server yes)
(xend-port 8000)

finally allowed connectivity. The promoted selection is (xend-unix-server yes), which I have just tried. It is absent as a selection in the xend-config.sxp, so I had to manually add it. It also works, but leaves me wondering,
why is this selection absent?
what is a recommended standard setup for karmic with its standard packages?
It's too intricate for me.

Revision history for this message
IAN DELANEY (johneed) wrote :
Download full text (4.3 KiB)

I decided to up the level of input. Please persevere.

idella@karmic:~$ sudo rm /var/run/libvirtd.pid
idella@karmic:~$ sudo gdb libvirtd
GNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/sbin/libvirtd...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/sbin/libvirtd
[Thread debugging using libthread_db enabled]
20:11:17.815: warning : qemudStartup:521 : Unable to create cgroup for driver: No such device or address

Program received signal SIGSEGV, Segmentation fault.
virDomainEventCallbackListFree (list=0x0) at domain_event.c:41
41 domain_event.c: No such file or directory.
 in domain_event.c
(gdb) bt
#0 virDomainEventCallbackListFree (list=0x0) at domain_event.c:41
#1 0x0808bece in ?? ()
#2 0x0808f992 in ?? ()
#3 0xb7e8a915 in virStateInitialize (privileged=1) at libvirt.c:786
#4 0x0805b5eb in ?? ()
#5 0xb7a1bb56 in __libc_start_main () from /lib/tls/i686/nosegneg/libc.so.6
#6 0x08053d11 in ?? ()

comment: I suspect this relates to attempting to qemu /kvm, which it can't connect to in this xen environ.

idella@karmic:~$ gdb virsh
GNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/virsh...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/virsh
[Thread debugging using libthread_db enabled]
Connecting to uri: qemu:///session
              (Here it hangs, I interrupt)
^Z
Program received signal SIGTSTP, Stopped (user).
0xb7fe2416 in __kernel_vsyscall ()
(gdb) run -c qemu:///system
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/bin/virsh -c qemu:///system
[Thread debugging using libthread_db enabled]
Connecting to uri: qemu:///system
error: unable to connect to '/var/run/libvirt/libvirt-sock': No such file or directory
error: failed to connect to the hypervisor

Program exited with code 01.
(gdb) run -c xen
Starting program: /usr/bin/virsh -c xen
[Thread debugging using libthread_db enabled]
Connecting to uri: xen
error: unable to connect to '/var/run/libvirt/libvirt-sock': No such file or directory
error: failed to connect to the hypervisor

Program exited with code 01.

however

idella@karmic:~$ sudo gdb virsh
GNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This...

Read more...

Revision history for this message
IAN DELANEY (johneed) wrote :

ok, you're going to hate me for this, I know it. As if I've not input enough. I did do a separate install of karmic,
and I reproduced this state. I installed a 64 version.

I installed, prepared the kernel for karmic. Unless I missed it, Ubuntu didn't provide a xen kernel for karmic. I provided my own, and it's run lenny 64, karmic 32, now karmic 64, gentoo 32 and gentoo 64. It may not be perfect. Anyway, having booted into xen.

idella@karmic64:~$ sudo libvirtd
[sudo] password for idella:
22:58:12.769: error : qemudWritePidFile:457 : Failed to open pid file '/var/run/libvirtd.pid' : File exists
idella@karmic64:~$ ls /var/run/libvirt
qemu
idella@karmic64:~$ sudo rm /var/run/libvirtd.pid
idella@karmic64:~$ sudo libvirtd
libvir: Network Config error : cannot enable /proc/sys/net/ipv6/conf/virbr0/disable_ipv6: No such file or directory
23:00:47.610: warning : qemudStartup:521 : Unable to create cgroup for driver: No such device or address
Segmentation fault
idella@karmic64:~$ ls /var/run/libvirt
qemu
idella@karmic64:~$ uname -a
Linux karmic64 2.6.31-xen-r10-AMD-64 #19 SMP Sun Feb 28 21:28:33 WST 2010 x86_64 GNU/Linux

More of the same. Installed virt-manager, try connecting to xen by gui,

Unable to open connection to hypervisor URI 'xen:///':
<class 'libvirt.libvirtError'> unable to connect to '/var/run/libvirt/libvirt-sock': No such file or directory

I booted into the freshly installed server kernel, and

idella@karmic64:~$ sudo libvirtd
[sudo] password for idella:
Sorry, try again.
[sudo] password for idella:
22:39:18.849: error : qemudWritePidFile:457 : Failed to open pid file '/var/run/libvirtd.pid' : File exists
idella@karmic64:~$ sudo rm /var/run/libvirtd.pid
idella@karmic64:~$ sudo libvirtd
22:39:39.118: warning : qemudStartup:521 : Unable to create cgroup for driver: No such device or address
22:39:39.204: warning : lxcStartup:1460 : Unable to create cgroup for driver: No such device or address
WARNING: Unhandled message: interface=org.freedesktop.DBus.Introspectable, path=/, member=Introspect

^X^Z
[1]+ Stopped sudo libvirtd
idella@karmic64:~$ sudo libvirtd
22:40:21.411: error : qemudWritePidFile:457 : Failed to open pid file '/var/run/libvirtd.pid' : File exists
idella@karmic64:~$ ls /var/run/libvirt
libvirt-sock libvirt-sock-ro network qemu
idella@karmic64:~$ uname -a
Linux karmic64 2.6.31-19-server #56-Ubuntu SMP Thu Jan 28 03:40:48 UTC 2010 x86_64 GNU/Linux

Those elusive sockets libvirt-sock libvirt-sock-ro are there, in an environment absent of xen.

Yes well, I fear this may lead nowhere if you can't reproduce. What kernel would you use??

Revision history for this message
Soren Hansen (soren) wrote :

Are you running libvirt in a dom0 or domU?

Revision history for this message
IAN DELANEY (johneed) wrote :

libvirt is running in dom0.

idella@karmic64:~$ uname -a
 Linux karmic64 2.6.31-xen-r10-AMD-64 #19 SMP Sun Feb 28 21:28:33 WST 2010 x86_64 GNU/Linux

Host. libvirt is intended for a host environment. Wouldn't be inclined to install it into a guest.
It's all very well me confirming myself. Can someone confirm???

IAN DELANEY (johneed)
tags: added: verification-needed
Revision history for this message
Soren Hansen (soren) wrote :

Can you try running libvirtd through strace?

Revision history for this message
IAN DELANEY (johneed) wrote :

bounces@canonical, according to soren from my other bug,

Ubuntu has no support for running as a Xen dom0. This is no secret. When
you insist on doing so anyway, don't expect us to be all over it trying
to work out your bugs. ......

So I proceed with uncertainty. I've not applied strace before. However, I have done as requested.
Oh my, it is large. The first, trace1.txt is run and aborts due to the presence of the pid file, /var/run/libvirtd.pid.
So I remove it, and re-run. I stopped at recording over 4,000 lines, trace2.txt It's obviously repetitive.
Anyway,

Revision history for this message
Soren Hansen (soren) wrote : Re: [Bug 527875] Re: libvirt0 unable to operate due to missing essential files

On Wed, Mar 03, 2010 at 11:29:36AM -0000, IAN DELANEY wrote:
> Ubuntu has no support for running as a Xen dom0. This is no secret.
> When you insist on doing so anyway, don't expect us to be all over it
> trying to work out your bugs. ......
>
> So I proceed with uncertainty. I've not applied strace before. However, I have done as requested.
> Oh my, it is large. The first, trace1.txt is run and aborts due to the presence of the pid file, /var/run/libvirtd.pid.
> So I remove it, and re-run. I stopped at recording over 4,000 lines, trace2.txt It's obviously repetitive.

It looks like libvirt is unhappy with your kernels lack of namespace
support:

clone(child_stack=0x9b70fe4, flags=CLONE_NEWNS|0x2c000000|SIGCHLD) = -1 EINVAL (Invalid argument)

--
Soren Hansen
Ubuntu Developer
http://www.ubuntu.com/

Revision history for this message
IAN DELANEY (johneed) wrote :

yes, ok, well thanks for that. Good comment. I'll take note and add it.

IAN DELANEY (johneed)
tags: removed: verification-needed
Revision history for this message
IAN DELANEY (johneed) wrote :

Soren, or bounces, well, despite your position that you didn't have to, you did it. You were indeed right. I'm quite happy for that too.
I did do so anyway (dom0 in xen). That makes this not a bug and resolved and the deficit in my setup, perhaps an invalid status.
I could not have figured it.

idella@karmic:~$ uname -a
Linux karmic 2.6.31-xen-r10 #6 SMP Wed Mar 3 21:31:58 WST 2010 i686 GNU/Linux
idella@karmic:~$ ls /var/run/libvirt
libvirt-sock libvirt-sock-ro network qemu

and my kernel more refined. That gives karmic a real lift. Thanks

Mathias Gug (mathiaz)
Changed in libvirt (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.