Pasquale Dir
2014-Mar-07 09:26 UTC
[libvirt-users] "connection refused", but server is listening
netstat -lptu gives me tcp6 0 0 [::]:16514 [::]:* LISTEN 1314/libvirtd so the server is correctly listening on interfaces. My /etc/libvirt/libvirtd settings are defaulted. My /etc/default/libvirt-bin has "-d -l" options so server is listening. If I do virsh -c qemu://143.225.229.190/system (that is my ip or an ip belonging to my network) I get "connection refused". How come? And note that if I put my address, 143.225.229.190, as listening address in the libvirtd conf file, I get "this address class is not supported".
Pasquale Dir
2014-Mar-07 20:53 UTC
Re: [libvirt-users] "connection refused", but server is listening
Another strange thing. I tried, in order to solve this, to put my hostname as listening address. I started with the ip, 192.168.2.2, and it works. I then decided to use the domain name, pasquale-Dell, but the socket is not created. Looking into logs it seems it tries to resolve the name, without success. After a lot of tries it just decides to give up. However, in file /etc/hosts the resolution is correctly set and I can just think that libvirt starts before the name discovery system is actually up. The fact the daemon is not started at all confirms this. But now here's the moment I begin to HATE libvirt. You would expect that executing service libvirt-bin start (or restart) would solve this, right? Well, if I do that the deamon correctly starts...but libvirt hangs!! Every connect I try with virsh, let it be local or remote, just hangs indefinitely. The is no *censored* way to restart the libvirt daemon: it just leads to hang. The only *censored* way to restart it is to restart the whole system and pray libvirt starts after the name resolution. 2014-03-07 10:26 GMT+01:00 Pasquale Dir <phate867@gmail.com>:> netstat -lptu > gives me > tcp6 0 0 [::]:16514 [::]:* LISTEN > 1314/libvirtd > > so the server is correctly listening on interfaces. > > My /etc/libvirt/libvirtd settings are defaulted. > My /etc/default/libvirt-bin has "-d -l" options so server is listening. > > If I do virsh -c qemu://143.225.229.190/system (that is my ip or an ip > belonging to my network) I get "connection refused". > > How come? > And note that if I put my address, 143.225.229.190, as listening address > in the libvirtd conf file, I get "this address class is not supported". > > >
Brian Rak
2014-Mar-07 21:02 UTC
Re: [libvirt-users] "connection refused", but server is listening
On 3/7/2014 3:53 PM, Pasquale Dir wrote:> > The is no *censored* way to restart the libvirt daemon: it just leads > to hang.This is probably caused by udev... After you restart libvirt, do: pstree -p `cat /var/run/libvirtd.pid` You'll probably see a udev process. Kill it, and libvirt should resume working normally. This patch will "fix" it, if you feel like rebuilding libvirt: *** src_clean/src/util/virutil.c 2013-07-30 03:21:31.000000000 -0400 --- src/src/util/virutil.c 2013-09-12 17:06:58.462540659 -0400 *************** virSetUIDGIDWithCaps(uid_t uid, gid_t gi *** 1398,1404 **** void virFileWaitForDevices(void) { # ifdef UDEVADM ! const char *const settleprog[] = { UDEVADM, "settle", NULL }; # else const char *const settleprog[] = { UDEVSETTLE, NULL }; # endif --- 1398,1404 ---- void virFileWaitForDevices(void) { # ifdef UDEVADM ! const char *const settleprog[] = { UDEVADM, "settle", "--timeout=10", NULL }; # else const char *const settleprog[] = { UDEVSETTLE, NULL }; # endif
Pasquale Dir
2014-Mar-09 11:51 UTC
Re: [libvirt-users] "connection refused", but server is listening
Ok I think I figured out where the real problem is, but I can't solve it. Problem is related to the connection to the iscsi disks. Looking into logs I get: internal error: Child process (/usr/bin/iscsiadm --mode session) unexpected exit status 21 this leads to whole virsh hang! Indeed, I tried to remove the "storage" directory from /etc/libvirt and restarted the service: everything worked! And if I added manually the iscsi targets everything keeps working. But, if I restart the service once again, virsh hangs! And that error shows up! 2014-03-07 10:26 GMT+01:00 Pasquale Dir <phate867@gmail.com>:> netstat -lptu > gives me > tcp6 0 0 [::]:16514 [::]:* LISTEN > 1314/libvirtd > > so the server is correctly listening on interfaces. > > My /etc/libvirt/libvirtd settings are defaulted. > My /etc/default/libvirt-bin has "-d -l" options so server is listening. > > If I do virsh -c qemu://143.225.229.190/system (that is my ip or an ip > belonging to my network) I get "connection refused". > > How come? > And note that if I put my address, 143.225.229.190, as listening address > in the libvirtd conf file, I get "this address class is not supported". > > >
Possibly Parallel Threads
- Re: "connection refused", but server is listening
- Problem in getting memory statistics
- Re: Programmatically force shutdown a guest: possible?
- Problems with tls connection when ran with user privileges
- Problems Windows 7 64 Bit joining a Samba + Ldap domain