
2011/2/11 Nirmal Guhan <vavatutu@gmail.com>:
On Fri, Feb 11, 2011 at 9:05 PM, Osier Yang <jyang@redhat.com> wrote:
于 2011年02月12日 11:52, Nirmal Guhan 写道:
Hi,
Has anyone used libvirt to start/stop/manage LXC (linux containers) ? Is it supported at all? Last I tried, had few issues and the reply was :
Yes, it's supported, though still much work to do, but the basic is there.
/// Note that libvirt lxc driver is a different implementation from lxc tools and doesn't use lxc tools internally.
Indeed, it doesn't invoke lxc tools.
You may not be able to do what
you are doing with lxc tools. Especially, the driver doesn't take aware of files and settings inside a container at all. You have to prepare them by yourself in advance
libvirt.org has the example, e.g. the busybox example, I guess it could explain "the driver doesn't take care of files and setting inside a container at all, you have to prepare them by yourself in advance."
Regards Osier
Thanks. Will give a try. ~nirmal
Seeing some strange behavior running fedora 12 for both host and lxc container. I do a define, start and console : [root@fedora12new lxc-libvirt-scripts]# virsh -c lxc:// console testf12new Connected to domain testf12new Escape character is ^] --> I press enter here and virsh exits. I don't get login prompt always. Sometimes I do and when I try to login it rejects my password. Apparently, the same rootfs works fine with lxc tools and I can login. Snippet from etc/event.d/tty1 : respawn exec /sbin/mingetty pts/0 I use "exec /sbin/mingetty tty1" for lxc tools and that works fine. I had to try pts/0 for libvirt since tty1 does not even get me the occasional login prompts I get with pts. Also even after virsh shutdown, I see that the container processes do not exit. Is there something else I should do? ~nirmal