On Sun, Mar 3, 2013 at 5:24 PM, Doug Goldstein
<cardoe(a)gentoo.org> wrote:
> On Fri, Dec 21, 2012 at 10:15 PM, Lars Kellogg-Stedman <lars(a)oddbit.com>
wrote:
>> Using libvirt 1.0.1, I'm trying to start an LXC container using the
>> '<filesytem type="block">' syntax, like this:
>>
>> <filesystem type="block" accessmode="passthrough">
>> <source dev="/dev/vg_files/vm-foobar-root" />
>> <target dir="/" />
>> </filesystem>
>>
>> The specified block device exists:
>>
>> # ls -lL /dev/vg_files/vm-foobar-root
>> brw-rw---- 1 root disk 253, 19 Dec 21 22:23 /dev/vg_files/vm-foobar-root
>>
>> If I start the domain, it appears to start without any errors...
>>
>> # virsh start foobar
>> Domain foobar started
>>
>> ...but it's not actually running. The log files (with loglevel=2)
>> don't seem to be very interesting; this is everything from the
>> instance log file:
>>
>> 2012-12-22 04:10:57.862+0000: starting up
>> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin LIBVIRT_DEBUG=2
LIBVIRT_LOG_OUTPUTS=2:stderr /usr/lib/libvirt/libvirt_lxc --name foobar --console 22
--security=none --handshake 25 --background --veth veth1
>> 2012-12-22 04:10:57.967+0000: 1468: info : libvirt version: 1.0.1
>> 2012-12-22 04:10:57.967+0000: 1468: info : lxcCapsInit:151 : No driver, not
initializing security driver
>> PATH=/bin:/sbin TERM=linux container=lxc-libvirt
container_uuid=9041e32e-1df2-00c2-4660-dfa5b41510b7
LIBVIRT_LXC_UUID=9041e32e-1df2-00c2-4660-dfa5b41510b7 LIBVIRT_LXC_NAME=foobar /sbin/init
>> 2012-12-22 04:10:58.198+0000: 1: warning : lxcContainerDropCapabilities:1788 :
libcap-ng support not compiled in, unable to clear capabilities
>> 2012-12-22 04:10:58.198+0000: 1493: warning : lxcControllerClearCapabilities:679
: libcap-ng support not compiled in, unable to clear capabilities
>>
>> Running an "strace" on the libvirtd process (strace -p
<libvirtd_pid>
>> -f ...), it doesn't look like libvirt is ever trying to mount the
>> referenced filesystem.
>>
>> Is this supposed to work? It seems like the support for having
>> libvirt mount the block device is relatively recent, and I haven't had
>> much luck finding examples of other folks using this capability.
>>
>> Thanks,
>>
>> -- Lars
>
> Lars,
>
> I just gave it a whirl. And I'm able to reproduce the same issue you
> are seeing. The issue appears to be that
> lxcContainerMountFsBlockAuto() is never being called. It was added in
>
http://www.redhat.com/archives/libvir-list/2011-August/msg00201.html
> Hopefully I'll have more info soon.
>
> --
> Doug Goldstein
It appears in the case of filesystem type=block the libvirt_lxc helper
just gets wedged right away from first execution.
2013-03-04 04:17:55.443+0000: 7197: debug : virFileMakePathHelper:1272 : path=/v
ar/run/libvirt/lxc mode=0777
2013-03-04 04:17:55.443+0000: 7197: debug : virFileClose:72 : Closed fd 18
2013-03-04 04:17:55.443+0000: 7197: debug : virCommandRunAsync:2200 : About to r
un PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/u
sr/x86_64-pc-linux-gnu/gcc-bin/4.6.3 LIBVIRT_DEBUG=1
LIBVIRT_LOG_OUTPUTS=1:stderr /usr/libexec/libvirt_lxc --name testdeb
--console 17 --security=none --handshake 20 --background --veth veth1
2013-03-04 04:17:55.444+0000: 7197: debug : virFileClose:72 : Closed fd 21
2013-03-04 04:17:55.444+0000: 7197: debug : virCommandRunAsync:2218 :
Command result 0, with PID 7294
2013-03-04 04:17:55.444+0000: 7294: debug : virFileClose:72 : Closed fd 3
2013-03-04 04:17:55.444+0000: 7294: debug : virFileClose:72 : Closed fd 4
2013-03-04 04:17:55.444+0000: 7294: debug : virFileClose:72 : Closed fd 5
2013-03-04 04:17:55.444+0000: 7294: debug : virFileClose:72 : Closed fd 6
2013-03-04 04:17:55.444+0000: 7294: debug : virFileClose:72 : Closed fd 7
2013-03-04 04:17:55.444+0000: 7294: debug : virFileClose:72 : Closed fd 8
2013-03-04 04:17:55.444+0000: 7294: debug : virFileClose:72 : Closed fd 9
2013-03-04 04:17:55.444+0000: 7294: debug : virFileClose:72 : Closed fd 10
2013-03-04 04:17:55.444+0000: 7294: debug : virFileClose:72 : Closed fd 11
2013-03-04 04:17:55.444+0000: 7294: debug : virFileClose:72 : Closed fd 12
2013-03-04 04:17:55.444+0000: 7294: debug : virFileClose:72 : Closed fd 13
2013-03-04 04:17:55.444+0000: 7294: debug : virFileClose:72 : Closed fd 14
2013-03-04 04:17:55.444+0000: 7294: debug : virFileClose:72 : Closed fd 15
2013-03-04 04:17:55.444+0000: 7294: debug : virFileClose:72 : Closed fd 16
2013-03-04 04:17:55.444+0000: 7294: debug : virFileClose:72 : Closed fd 19
That's the last time anything with PID 7294 or lxc appears in the log
file. I'm unfortunately not getting any lxcContainer debug messages in
the log using LIBVIRT_DEBUG=1 LIBVIRT_LOG_OUTPUT=1:stderr
Did you check the last version libvirt?
I can't reproduce this problem with last libvirt.
Thanks!
Gao