[libvirt-users] LXCs using Libvirt

Anu Mercian amercian at lbl.gov
Tue Jun 9 19:44:38 UTC 2015


Thanks for the explanation Jiri!

On Thu, Jun 4, 2015 at 11:43 PM, Jiri Denemark <jdenemar at redhat.com> wrote:

> On Thu, Jun 04, 2015 at 16:22:43 -0700, Anu Mercian wrote:
> > Hi all,
> >
> > I am trying to bring up lxc's using Libvirt JAVA API. I do the following:
> >
> > conn = Connect("lxc:\\\")
> >
> > xml_config = "<domain> .... <\domain>"
> >
> > dom = conn.domainCreateXML(xml_config, 0)
> >
> > dom.create()
> >
> > Using the above code, I am able to start a domain but the domain is not
> > visible within the "lxc" list, i.e
> > when I use the command "lxc-ls --fancy", the domain that was created
> cannot
> > be viewed, although, when I use the function conn.listDomains(), I can
> view
> > the domain.
>
> That's expected and correct. Libvirt does not use lxc tools to manage
> Linux containers. Libvirt manages everything by itself and talks to the
> kernel directly. Thus containers created in libvirt are not visible to
> lxc tools and containers created using lxc tools are not visible to
> libvirt. In other words, use either lxc tools or libvirt but do not try
> to mix them.
>
> If you want to manage libvirt's containers from a command line, use
> virsh. For example, "virsh list --all" will show you all containers
> libvirt knows about.
>
> Jirka
>



-- 
Kind Regards,
Anu Mercian
Summer Intern-ESnet
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20150609/25ed58bd/attachment.htm>


More information about the libvirt-users mailing list