[Lxc-users] Failed to access console after launching LXC through libvirt

unicell unicell at gmail.com
Thu Nov 8 16:09:57 UTC 2012


Hi,

I'm trying to manage LXC instances through OpenStack, which use libvirt as
a virtualization driver layer. After launching LXC instance, I simply could
not attach to the console.

virsh # list
 Id Name                 State
----------------------------------
14366 instance-00000078    running

virsh # console 14366
Connected to domain instance-00000078
Escape character is ^]


And it keeps stuck here.

Initially I thought it could be a cgroup device config issue, and tried to
"echo ‘c 5:1 rwm'
>/cgroup/devices/libvirt/lxc/instance-00000078/devices.allow“, to add
/dev/console access right to the container. But it does not work, console
stilll not working.

Before the cgroup tweaking, devices.list are as follows

[root at localhost libvirt]# cat
/cgroup/devices/libvirt/lxc/instance-0000007a/devices.list

c 1:3 rwm
c 1:5 rwm
c 1:7 rwm
c 1:8 rwm
c 1:9 rwm
c 5:0 rwm
c 5:2 rwm
c 136:* rwm


I'm not quite sure what kind of issue could possibly cause this console
access issue. Cause I'm now using two different guest OS templates on two
different host OSes. Following are some symptoms I observed.


* (g) for container guest OS
* (h) for host OS
* NOTE: Ubuntu guest os are generated by lxc-create -t ubuntu, which is an
Ubuntu 12.04 based lxc template.
             CentOS guest os are handcrafted by myself, taking reference of
http://wiki.1tux.org/wiki/Lxc/Installation/Guest/Centos/6

   1. Ubuntu (g) launched by lxc-start on Ubuntu 12.04 host, console works
   2. Ubuntu (g) launched by OpenStack / libvirt on Ubuntu 12.04 host,
   console works
   3. Ubuntu (g) launched by OpenStack / libvirt on CentOS 6.3 host,
   console NOT works
   4. CentOS (g) launched by lxc-start on Ubuntu 12.04 host, console works
   5. CentOS (g) launched by OpenStack / libvirt on Ubuntu12.04 host,
   console NOT works
   6. CentOS (g) launched by OpenStack / libvirt on CentOS 6.3 host,
   console NOT works

So somehow I feel it could be something related to LXC template rootfs, but
Host OS do make a difference (2 vs. 3). lxc-start / libvirt also makes a
difference (4 vs. 5), but that might be caused by cgroup setting.

Could someone shed me some clues to further digging this issue? Thanks!

--
Qiu Yu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20121109/e3ff3be3/attachment.html>


More information about the lxc-users mailing list