[lxc-devel] lxc and ganeti integration

Daniel Lezcano daniel.lezcano at free.fr
Fri May 22 13:15:36 UTC 2009


Guido Trotter wrote:
> On Fri, May 22, 2009 at 12:38 PM, Daniel Lezcano <daniel.lezcano at free.fr> wrote:
>   
>> Hi Guido,
>>
>> I was wondering how is going ganeti integration with lxc ?
>>
>>     
>
> I am in the initial stage, of basically checking that lxc has all the
> required features.
>   

Cool, let me know if something is missing.
>   
>> I am planning to commit soon a new parameter to lxc-start to daemonize the
>> container.
>> As the logging facility is nearly finished, the output of the console will
>> probably go there, if specified.
>>
>>     
>
> These are definitely very useful features for the integration.
> Other useful things would be to be able to execute "other" commands in
> the container, for example for shutting it down or providing a console
> inside it (by executing a new shell inside it).
Oh, Dietmar Maurer did that. It is in a branch called "forker". It did 
some changes because I need to have it optional for another project 
build on top of lxc. Dietmar was supposed to do some cleanup but I guess 
he is very busy right now.
I played with its code and it works well. A daemon is launched by lxc in 
the container right before exec'ing '/sbin/init' and communicate with a 
lxc command outside of the container via a fifo.
So it is very easy to exec a command inside, so you can do 'ps', debug 
your application, netstat or configure the network.
Unfortunately when a application is run instead of a system and the 
'forker' is enabled, when the application finishes, the container does 
not exit. I am trying to find a way to fix that.
I will merge the forker branch with the master soon.

At present, if you install a debian container (via lxc-debian), you 
would be able to log to the container with the lxc-console command.

> Finally things like
> multiple network interfaces and an arbitrary script to execute to
> configure them (as kvm or xen do) would be useful too. I will be
> submitting patches probably in june for some of these features (and in
> the meantime proceed with the ganeti part of the code).
>   

Not sure this is what you want, but you can specify several interfaces 
for the container either if you have just one physical nic and lxc will 
configure them automatically for you if you specify the network 
configuration in the configuration file.

below an example of a network section configuration from a configuration 
file. The hwaddr, ipv4 and ipv6 are optional in case you want to 'boot' 
a system like a debian because this one will configure the network. But 
in case you want to launch an application (eg. sshd), specifying this 
network configuration will setup automatically ipv4 and ipv6. If the 
hwaddr is not specified it is automatically and randomly generated by a 
kernel algorithm.

# Container with network a complex network mixing macvlan, veth interfaces

# first interface
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.hwaddr = 4a:49:43:49:79:bf
lxc.network.ipv4 = 1.2.3.5/24
lxc.network.ipv4 = 1.2.3.7/24
lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3597

# second interface
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.hwaddr = 4a:49:43:49:79:ef
lxc.network.ipv4 = 1.2.3.6/24
lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3565

# third interface
lxc.network.type = macvlan
lxc.network.flags = up
lxc.network.link = eth0
lxc.network.hwaddr = 4a:49:43:49:79:bd
lxc.network.ipv4 = 1.2.3.4/24
lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3596




More information about the lxc-devel mailing list