[Lxc-users] Gathering information about containers - from inside and from outside

Daniel Lezcano daniel.lezcano at free.fr
Mon Jul 19 13:22:38 UTC 2010


On 07/19/2010 12:53 PM, Clemens Perz wrote:
> On 07/18/2010 11:13 PM, Daniel Lezcano wrote:
>>>
>>> Cool, found them in /proc/net/unix, thats good. Is there a way to read
>>> this path - /var/lib/lxc - from somewhere? Just thinking if some distro
>>> might want to change it at compiletime and then the script sucks :)
>>>
>>
>> You can look at /usr/share/pkgconfig/lxc for the list of variables.
>>
>
> That is indeed a good start.
>
>> You are right, the refcount is 0. Weird because the refcount prevents
>> the unloading of the module.
>> At the first glance that seems to not hurt the system to unload the
>> macvlan module while it is in use,
>
> Okay, I thought there was some real magic going on :)) I could not find
> any information about the actually working containers macvlan interface
> in the hosts proc. But I am sure there must be some bits telling the
> world that eth0 has a macvlan or vlan assigned to it, that is has an id,
> a mode and a mac. Do you know where to look for this?

I think it is not possible for the moment or at least nicely implementable.

IMHO there are 2 solutions :

  1) ask for the configuration to lxc

  2) wait for the attach syscall to collect information inside the 
container directly

The advantage of 1) is it does not rely on any kernel version, the 
drawback is if the container's init script setup the IP address, we 
won't get it as it is not in the lxc configuration.

The advantage of 2) is we enter the container and we can collect 
everything, but we will need a 2.6.36 kernel as minimal (assuming the 
attach will be for this version).

Maybe a mix of both can be interesting. Older kernels give restricted 
informations, newer kernels give more informations, no ?





More information about the lxc-users mailing list