title: Randomly can't connect to guest vm in libvirt
body: <p>I cannot reliably trigger this, although if I spin up many vms at a time and then attempt to connect to some of them, I run into this condition:</p>
  
  <pre><code>$ ping 192.168.122.135
  PING 192.168.122.135 (192.168.122.135) 56(84) bytes of data.
  From 192.168.122.1 icmp_seq=1 Destination Host Unreachable
  From 192.168.122.1 icmp_seq=2 Destination Host Unreachable
  From 192.168.122.1 icmp_seq=3 Destination Host Unreachable
  </code></pre>
  
  <p>Note that this does not happen for all VMs that I create and start, only a handful of them (randomly).</p>
  
  <p>The vm that has obtained the ip <code>192.168.122.135</code> has the following for its network in its domain xml:</p>
  
  <pre><code>&lt;interface type='network'&gt;
    &lt;mac address='52:54:00:3d:72:ab'/&gt;
    &lt;source network='default'/&gt;
    &lt;target dev='vnet0'/&gt;
    &lt;model type='virtio'/&gt;
    &lt;alias name='net0'/&gt;
    &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/&gt;
  &lt;/interface&gt;
  </code></pre>
  
  <p>And the default network is defined as (and yes, 22 vms are currently running):</p>
  
  <pre><code>&lt;network connections='22'&gt;
    &lt;name&gt;default&lt;/name&gt;
    &lt;uuid&gt;69674b8b-f067-4513-b594-3e52360f391b&lt;/uuid&gt;
    &lt;forward mode='nat'&gt;
      &lt;nat&gt;
        &lt;port start='1024' end='65535'/&gt;
      &lt;/nat&gt;
    &lt;/forward&gt;
    &lt;bridge name='virbr0' stp='on' delay='0'/&gt;
    &lt;ip address='192.168.122.1' netmask='255.255.255.0'&gt;
      &lt;dhcp&gt;
        &lt;range start='192.168.122.2' end='192.168.122.254'/&gt;
      &lt;/dhcp&gt;
    &lt;/ip&gt;
  &lt;/network&gt;
  </code></pre>
  
  <p>The output from ifconfig for <code>vnet0</code> (referenced by the VM's network domain xml) and <code>virbr0</code> (used by the <code>default</code> network as shown above):</p>
  
  <pre><code>$ sudo ifconfig vnet0
  vnet0     Link encap:Ethernet  HWaddr fe:54:00:3d:72:ab
            inet6 addr: fe80::fc54:ff:fe3d:72ab/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:425 errors:0 dropped:0 overruns:0 frame:0
            TX packets:1304 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:500
            RX bytes:57503 (57.5 KB)  TX bytes:67257 (67.2 KB)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$ sudo ifconfig virbr0
  virbr0    Link encap:Ethernet  HWaddr fe:54:00:08:e9:a4
            inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:882508 errors:0 dropped:0 overruns:0 frame:0
            TX packets:2527165 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:0
            RX bytes:93980992 (93.9 MB)  TX bytes:3047773583 (3.0 GB)
  </code></pre>
  
  <p>Below is the partial output from <code>ip route list</code>:</p>
  
  <pre><code>192.168.122.0/24 dev virbr0  proto kernel  scope link  src 192.168.122.1
  </code></pre>
  
  <p>The route output above makes me think that it <em>should</em> be working. BUT ITS NOT. and it only fails sometimes, and works most of the time.</p>
  
  <p>Why can't I connect to the guest (<code>192.168.122.135</code>) from the host??</p>
  
  <p>I was originally using filters, but removing the filters from the VM's domain xml has no effect on this condition randomly showing up. If I spin up many VMs at the same time I can get it to happen to a lot of them. Some of the VMs work just fine though and allow me to connect.</p>
  
  <p>Also, I am using ubuntu 14.04.3:</p>
  
  <pre><code>$ lsb_release -a
  No LSB modules are available.
  Distributor ID: Ubuntu
  Description:    Ubuntu 14.04.3 LTS
  Release:        14.04
  Codename:       trusty
  </code></pre>
  
  <p>With kernel <code>3.19.0-30-generic</code>.</p>
  
  <p>More info - virsh version:</p>
  
  <pre><code>$ virsh --version
  1.2.2
  </code></pre>
  
  <p>libvirtd version:</p>
  
  <pre><code>$ libvirtd --version
  libvirtd (libvirt) 1.2.2
  </code></pre>