<div dir="ltr">Hello all,<br><br>    I have two issues:<br><br>1) I am unable to start a seemingly correct LXC domain (I cloned it from a working domain).<br><br>2) I am able to crash "libvirtd" by attempting to start the cloned domain, but starting the original works just fine.<br>
<br>    I humbly submit that item #2 is a bug - the "libvirtd" daemon should never crash due to anything the "libvirt" client throws at it.  As for item  #1, I'm not sure where I went wrong.  A full walk-through is below (ending with a DIFF of the XML from the two domains).<br>
<br>    I created by original domain ("dwj-lnx-dev") a long time ago.  Today I created the new domain ("dwj-hfax-dev") as follows:<br><br>1) Shutdown "dwj-lnx-dev"<br>2) Clone the root file system: "cd /vm/lxc/; cp -a dwj-lnx-dev dwj-hfax-dev"  (2.5GB, ~5 min)<br>
3) "libvirt -c lxc:/// dumpxml dwj-lnx-dev > a.xml"<br>4) ${EDITOR} a.xml<br>  a) changed MAC address, name, memory, source directory for "/"<br>5) "libvirt -c lxc:/// define a.xml"<br>6) Edit "/etc/bind/pri/*" and "/etc/dhcp/dhcpd.conf" on my host.<br>
<br><br>    It does not matter is "dwj-lnx-dev" is running or not.  Any attempt to start "dwj-hfax-dev" will crash libvirtd.<br><br><br>    In the past I was asked to turn on some debugging and capture a detailed log (<a href="https://www.redhat.com/archives/libvirt-users/2013-May/msg00076.html">https://www.redhat.com/archives/libvirt-users/2013-May/msg00076.html</a>).  I will do this soon and post my results as a follow up.<br>
<br><br><br>ostara ~ # uname -a<br>Linux ostara 3.8.13-gentoo #1 SMP PREEMPT Mon Jun 3 17:10:56 CDT 2013 x86_64 Intel(R) Core(TM) i5 CPU 760 @ 2.80GHz GenuineIntel GNU/Linux<br><br><br>ostara ~ # equery l libvirt<br> * Searching for libvirt ...<br>
[IP-] [  ] app-emulation/libvirt-1.1.0-r1:0<br><br><br>ostara ~ # virsh -c lxc:/// version<br>Compiled against library: libvirt 1.1.0<br>Using library: libvirt 1.1.0<br>Using API: LXC 1.1.0<br>Running hypervisor: LXC 3.8.13<br>
<br><br>ostara ~ # /etc/init.d/libvirtd restart<br> * Caching service dependencies ...                                                                                            [ ok ]<br> * Stopping libvirtd ...<br> *  Shutting down network(s):<br>
 *    default                                                                                                                  [ ok ]<br> * Starting libvirtd ...                                                                                                       [ ok ]<br>
<br><br>ostara ~ # virsh -c lxc:/// list --all<br> Id    Name                           State<br>----------------------------------------------------<br> -     dwj-hfax-dev                   shut off<br> -     dwj-lnx-dev                    shut off<br>
 -     vm1                            shut off<br><br>ostara ~ # virsh -c lxc:/// start dwj-lnx-dev<br>Domain dwj-lnx-dev started<br><br><br>ostara ~ # virsh -c lxc:/// list --all<br> Id    Name                           State<br>
----------------------------------------------------<br> 9441  dwj-lnx-dev                    running<br> -     dwj-hfax-dev                   shut off<br> -     vm1                            shut off<br><br><br>ostara ~ # virsh -c lxc:/// start dwj-hfax-dev<br>
error: Failed to start domain dwj-hfax-dev<br>error: End of file while reading data: Input/output error<br>error: One or more references were leaked after disconnect from the hypervisor<br>error: Failed to reconnect to the hypervisor<br>
<br><br>ostara ~ # virsh -c lxc:/// list --all<br>error: failed to connect to the hypervisor<br>error: no valid connection<br>error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused<br>
<br><br>ostara ~ # ls -l /var/run/libvirt/libvirt-sock<br>srwx------ 1 root root 0 Jul 12 11:21 /var/run/libvirt/libvirt-sock<br><br><br>ostara ~ # ps axfw | grep libvirt<br> 9997 pts/2    S+     0:00                      \_ grep --colour=auto libvirt<br>
 8446 ?        S      0:00 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf<br> 9441 ?        Ss     0:00 /usr/libexec/libvirt_lxc --name dwj-lnx-dev --console 19 --security=none --handshake 23 --background --veth veth1<br>
<br><br>ostara ~ # /etc/init.d/libvirtd restart<br> * Stopping libvirtd ...<br> * start-stop-daemon: no matching processes found                                                                              [ ok ]<br> * Starting libvirtd ...                                                                                                       [ ok ]<br>
<br><br>ostara ~ # ps axfw | grep libvirt<br>10130 pts/2    S+     0:00                      \_ grep --colour=auto libvirt<br> 8446 ?        S      0:00 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf<br>
 9441 ?        Ss     0:00 /usr/libexec/libvirt_lxc --name dwj-lnx-dev --console 19 --security=none --handshake 23 --background --veth veth1<br>10033 ?        Sl     0:00 /usr/sbin/libvirtd -d --listen<br><br><br>ostara ~ # virsh -c lxc:/// list --all<br>
 Id    Name                           State<br>----------------------------------------------------<br> 9441  dwj-lnx-dev                    running<br> -     dwj-hfax-dev                   shut off<br> -     vm1                            shut off<br>
<br><br>ostara ~ # virsh -c lxc:/// dumpxml dwj-hfax-dev<br><domain type='lxc'><br>  <name>dwj-hfax-dev</name><br>  <uuid>681410de-7b56-41bd-b38d-3c66ce97e7b3</uuid><br>  <memory unit='KiB'>4194304</memory><br>
  <currentMemory unit='KiB'>4194304</currentMemory><br>  <vcpu placement='static'>4</vcpu><br>  <resource><br>    <partition>/machine</partition><br>  </resource><br>
  <os><br>    <type arch='x86_64'>exe</type><br>    <init>/sbin/init</init><br>  </os><br>  <clock offset='utc'/><br>  <on_poweroff>destroy</on_poweroff><br>
  <on_reboot>restart</on_reboot><br>  <on_crash>destroy</on_crash><br>  <devices><br>    <emulator>/usr/libexec/libvirt_lxc</emulator><br>    <filesystem type='mount' accessmode='passthrough'><br>
      <source dir='/vm/lxc/dwj-hfax-dev'/><br>      <target dir='/'/><br>    </filesystem><br>    <filesystem type='mount' accessmode='passthrough'><br>      <source dir='/usr/portage'/><br>
      <target dir='/usr/portage'/><br>    </filesystem><br>    <filesystem type='mount' accessmode='passthrough'><br>      <source dir='/usr/src'/><br>      <target dir='/usr/src'/><br>
    </filesystem><br>    <filesystem type='mount' accessmode='passthrough'><br>      <source dir='/home'/><br>      <target dir='/home'/><br>    </filesystem><br>
    <interface type='bridge'><br>      <mac address='82:00:00:00:01:01'/><br>      <source bridge='br0'/><br>      <target dev='veth0'/><br>    </interface><br>
    <console type='pty'><br>      <target type='lxc' port='0'/><br>    </console><br>  </devices><br>  <seclabel type='none'/><br></domain><br><br><br>ostara ~ # virsh -c lxc:/// dumpxml dwj-lnx-dev<br>
<domain type='lxc' id='9441'><br>  <name>dwj-lnx-dev</name><br>  <uuid>fbcd8c3a-9939-12b4-727d-5d3526bc448f</uuid><br>  <memory unit='KiB'>500000</memory><br>
  <currentMemory unit='KiB'>500000</currentMemory><br>  <vcpu placement='static'>2</vcpu><br>  <resource><br>    <partition>/machine</partition><br>  </resource><br>
  <os><br>    <type arch='x86_64'>exe</type><br>    <init>/sbin/init</init><br>  </os><br>  <clock offset='utc'/><br>  <on_poweroff>destroy</on_poweroff><br>
  <on_reboot>restart</on_reboot><br>  <on_crash>destroy</on_crash><br>  <devices><br>    <emulator>/usr/libexec/libvirt_lxc</emulator><br>    <filesystem type='mount' accessmode='passthrough'><br>
      <source dir='/vm/lxc/dwj-lnx-dev'/><br>      <target dir='/'/><br>    </filesystem><br>    <filesystem type='mount' accessmode='passthrough'><br>      <source dir='/usr/portage'/><br>
      <target dir='/usr/portage'/><br>    </filesystem><br>    <filesystem type='mount' accessmode='passthrough'><br>      <source dir='/usr/src'/><br>      <target dir='/usr/src'/><br>
    </filesystem><br>    <filesystem type='mount' accessmode='passthrough'><br>      <source dir='/home'/><br>      <target dir='/home'/><br>    </filesystem><br>
    <interface type='bridge'><br>      <mac address='82:00:00:00:01:00'/><br>      <source bridge='br0'/><br>      <target dev='veth0'/><br>    </interface><br>
    <console type='pty' tty='/dev/pts/3'><br>      <source path='/dev/pts/3'/><br>      <target type='lxc' port='0'/><br>      <alias name='console0'/><br>
    </console><br>  </devices><br>  <seclabel type='none'/><br></domain><br><br><br>ostara ~ # virsh -c lxc:/// dumpxml dwj-lnx-dev > lnx.xml<br><br><br>ostara ~ # virsh -c lxc:/// dumpxml dwj-hfax-dev > hfax.xml<br>
<br><br>ostara ~ # diff lnx.xml hfax.xml<br>1,6c1,6<br>< <domain type='lxc' id='9441'><br><   <name>dwj-lnx-dev</name><br><   <uuid>fbcd8c3a-9939-12b4-727d-5d3526bc448f</uuid><br>
<   <memory unit='KiB'>500000</memory><br><   <currentMemory unit='KiB'>500000</currentMemory><br><   <vcpu placement='static'>2</vcpu><br>---<br>> <domain type='lxc'><br>
>   <name>dwj-hfax-dev</name><br>>   <uuid>681410de-7b56-41bd-b38d-3c66ce97e7b3</uuid><br>>   <memory unit='KiB'>4194304</memory><br>>   <currentMemory unit='KiB'>4194304</currentMemory><br>
>   <vcpu placement='static'>4</vcpu><br>21c21<br><       <source dir='/vm/lxc/dwj-lnx-dev'/><br>---<br>>       <source dir='/vm/lxc/dwj-hfax-dev'/><br>37c37<br><       <mac address='82:00:00:00:01:00'/><br>
---<br>>       <mac address='82:00:00:00:01:01'/><br>41,42c41<br><     <console type='pty' tty='/dev/pts/3'><br><       <source path='/dev/pts/3'/><br>---<br>>     <console type='pty'><br>
44d42<br><       <alias name='console0'/><br><br><br>(After reseting everything, and attempting to boot hfax with dev offline, libvirtd still crashes)<br><br>ostara ~ # virsh -c lxc:/// list --all<br> Id    Name                           State<br>
----------------------------------------------------<br> -     dwj-hfax-dev                   shut off<br> -     dwj-lnx-dev                    shut off<br> -     vm1                            shut off<br><br><br><br>ostara ~ # virsh -c lxc:/// start dwj-hfax-dev<br>
error: Failed to start domain dwj-hfax-dev<br>error: End of file while reading data: Input/output error<br>error: One or more references were leaked after disconnect from the hypervisor<br>error: Failed to reconnect to the hypervisor<br>
<br></div>