[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



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 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

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]