[lxc-users] Converting from libvirt lxc

Fajar A. Nugraha list at fajar.net
Wed Dec 2 15:23:42 UTC 2015


On Wed, Dec 2, 2015 at 9:49 PM, Peter Steele <pwsteele at gmail.com> wrote:

> On 12/01/2015 08:25 PM, Fajar A. Nugraha wrote:
>
> Is there a reason why you can't install a centos7 container using the
> download template? It would've been MUCH easier, and some of the things you
> asked wouldn't even be an issue.
>
>
> So, that long winded answer is why we can't just use the LXC template for
> CentOS directly. I was assuming (hoping) that the libvirt container image
> we build would be largely LXC friendly. Apparently it's not going to be
> quite as straightforward as I'd hoped. I'm going to have to dissect the
> steps used for creating a CentOS LXC template and make sure our container
> image provides what is needed/expected by LXC.
>


Actually my point was about the config file :)

The rootfs should be OK as is, as any systemd-related problem inside the
container should've also been fixed if you've managed to run it under
libvirt. I was suggesting to create a centos7 container from the download
template (which would reference the common configs, and use lxcfs), then
copy its config file.



>
>
>
>> My containers are coming up but things are running really slowly,
>> although CPU usage is low. I'm not entirely sure what's going on and need
>> to do some more digging.
>>
>>
> Works for me. However I seem to recall an issue with centos' version of
> systemd sometime ago.
>
> Yes, I hit that systemd issue early on and found the fix for it. The
> slowness I'm seeing now is something else.
>
>
>> whereas under LXC /dev has the following:
>>
>
>
>>
>> I know how to trim the /dev/ttyN entries to match libvirt, but I'm not
>> sure what's needed for the others. For example, how do I get rid of
>> /dev/snd?
>>
>>
> Here's mine. Centos 7 container, ubuntu 14.04 host, lxc-1.1.4 and
> lxcfs-0.10 from ubuntu ppa:
>
> c7 / # ls /dev
> console  core  fd  full  hugepages  initctl  log  lxc  mqueue  null  ptmx
>  pts  random  shm  stderr  stdin  stdout  tty  tty1  tty2  tty3  tty4
>  urandom  zero
>
>
> That ultimately is very similar to my libvirt dev list. I clearly need to
> dig into the CentOS template to see what's being done differently compared
> to my libvirt image.
>
>

It occurs to me that the difference might be related to lxcfs. It provides
a private, customized copy of parts of /sys and /proc to the container, so
the container doesn't need to see what the host has. And IIRC libvirt has
something that functions similarly to lxcfs.

Do you also have lxcfs installed? What version of lxc are you using?
Try installing lxcfs and use lxc-1.1.x. Then try to install a new container
using download template to see if it's similar to what you want. If it is,
copy it's config file (and modify things like name and paths, obviously)
for your former-libvirt container.

-- 
Fajar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20151202/7ad9bec7/attachment.html>


More information about the lxc-users mailing list