Re: [Lxc-users] Networking Qs

2010-06-18 Thread Daniel Lezcano
On 06/17/2010 06:49 PM, Nirmal Guhan wrote:
 Hi,

 Any reason why we require bridging in the host for lxc ? Am not able to
 setup IP address for the container unless I configure bridge in the host.

You can use the macvlan but the container -- host communication won't 
work.

 Also couple of other questions :
 1. Can I configure container and host be in different networks / subnets
 (assuming I have multiple interfaces) ? I can't try this yet as I just have
 one interface.
 2. Does container and host use different routing tables / VRFs ?


Yes, the virtualization begins at the network layer 2 and a virtual 
interface is created for the container.
Look at the lxc.conf man page and the doc/examples configuration files.

A quick start:

lxc-execute -n foo -s lxc.network.type=macvlan -s lxc.network.link=eth0 
-s lxc.network.flags=up -s lxc.network.ipv4=1.2.3.4 -- /bin/bash


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


[Lxc-users] How to get the CPU usage of a container ?

2010-06-18 Thread Louis Opter
Hello,

I'm working on a LXC plugin for collectd (A system statistics collection
daemon): http://collectd.org.

My goal is to get statistics on a container almost as if it was a real server.
I have started to focus on RAM and CPU usage.

I have carefully read the cgroups documentation in the kernel sources, as well
as your mailing lists and relevent posts on the LKML.

With the memory.stat getting memory usage was straightforward, I use:
 - cache: to get the amount of ram cached;
 - rss: to get the amount of ram used.

However, I can't figure out how to (correctly) get the cpu usage.

I was searching for something like the cpus lines of /proc/stats.

The right file to get this kind of informations seemed to be cpuacct.stat.

But to make values in this file change *a bit* I have to stress the cpu a lot in
my container. I expected that this value will continously increase because of
backgrounds jobs in my container (postfix, sshd, cron,...).

How is cpuacct.stat calculated ? Can I use it to report CPU usage, like it is
possible with /proc/stats ?

Maybe I'm using the wrong file ?

Best Regards

-- 
Louis Opter

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Networking Qs

2010-06-18 Thread Nirmal Guhan
On Fri, Jun 18, 2010 at 9:39 AM, Daniel Lezcano daniel.lezc...@free.fr wrote:
 On 06/17/2010 06:49 PM, Nirmal Guhan wrote:

 Hi,

 Any reason why we require bridging in the host for lxc ? Am not able to
 setup IP address for the container unless I configure bridge in the host.


 You can use the macvlan but the container -- host communication won't
 work.

Not sure what am doing wrong but container -- gateway too does not
work with macvlan. If I change it back to veth and bridge it works
fine. So just wondering what is the point of configuring macvlan? Am I
missing anything?


 Also couple of other questions :
 1. Can I configure container and host be in different networks / subnets
 (assuming I have multiple interfaces) ? I can't try this yet as I just
 have
 one interface.
 2. Does container and host use different routing tables / VRFs ?


 Yes, the virtualization begins at the network layer 2 and a virtual
 interface is created for the container.
 Look at the lxc.conf man page and the doc/examples configuration files.

 A quick start:

 lxc-execute -n foo -s lxc.network.type=macvlan -s lxc.network.link=eth0 -s
 lxc.network.flags=up -s lxc.network.ipv4=1.2.3.4 -- /bin/bash



--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


[Lxc-users] Reboot from container

2010-06-18 Thread Nirmal Guhan
Hi,

I gave a reboot command (accidently) from container. Although it did
not reboot the system, it made it less functional. All the vtys were
closed and could not open any new terminal. Had to reboot the system
to make it functional again.

Have any one seen such behavior ? This is with 2.6.32 kernel.

--Nirmal

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Reboot from container

2010-06-18 Thread John Drescher
 I gave a reboot command (accidently) from container. Although it did
 not reboot the system, it made it less functional. All the vtys were
 closed and could not open any new terminal. Had to reboot the system
 to make it functional again.

 Have any one seen such behavior ? This is with 2.6.32 kernel.


I believe that was fixed with the latest lxc-0.7.0 release.

John

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users