Re: [Lxc-users] seeing a network pause when starting and stopping LXCs - how do I stop this?

2011-12-08 Thread Gary Ballantyne
On 08/12/11 19:39, Daniel Lezcano wrote:
 On 12/08/2011 12:38 AM, Joseph Heck wrote:
 I've been seeing a pause in the whole networking stack when starting
 and stopping LXC - it seems to be somewhat intermittent, but happens
 reasonably consistently the first time I start up the LXC.

 I'm using ubuntu 11.10, which is using LXC 0.7.5

 I'm starting the container with lxc-start -d -n $CONTAINERNAME
 That could be the bridge configuration. Did you do 'brctl setfd br0 0' ?


FWIW, I see the same issue following [1], which has 'brctl setfd br0 0'.

[1] 
http://www.activestate.com/blog/2011/10/virtualization-ec2-cloud-using-lxc

--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


[Lxc-users] How to use lxc-execute to start the networking service.

2011-12-08 Thread nishant mungse
Hi,

I want to start the networking service of each containers but don't want to
use lxc-start, i want to use lxc-execute command to start the networking
service. How can I do this?

Please help me ASAP.

Regards,
Nishant
--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


[Lxc-users] lxc-destroy does not destroy cgroup

2011-12-08 Thread Arie Skliarouk
Hi,

Most of the time the lxc-destroy works properly, removing the cgroup with
the same name as the container.

Today something strange happened on one of my vservers - suddenly it
stopped responding to requests and any attempt to connect just hanged (as
if connection was successful, but no data was coming through).
Checking dmesg on the host machine revealed that the vserver got into
out-of-memory situation:

*[304880.371274] Memory cgroup out of memory: Kill process 1959 (init)
score 1 or sacrifice child
[304880.403765] Killed process 10638 (apache2) total-vm:40608kB,
anon-rss:12kB, file-rss:4088kB
[304881.719832] bash invoked oom-killer: gfp_mask=0xd0, order=0, oom_adj=0,
oom_score_adj=0
...
[304881.719965] Task in /master killed as a result of limit of /master
[304881.719970] memory: usage 976564kB, limit 976564kB, failcnt 60487010
...
[304881.835887] [ 8938] 20081  8938 2625   90   6
0 0 sshd
[304881.835897] Memory cgroup out of memory: Kill process 1959 (init) score
1 or sacrifice child
[304881.836836] Killed process 19680 (apache2) total-vm:41372kB,
anon-rss:0kB, file-rss:4504kB
[304884.298748] bash invoked oom-killer: gfp_mask=0xd0, order=0, oom_adj=0,
oom_score_adj=0
...
[304884.414478] Memory cgroup out of memory: Kill process 1959 (init) score
1 or sacrifice child
[304884.415428] Killed process 1959 (init) total-vm:3188kB, anon-rss:0kB,
file-rss:476kB*

Note that the last process that got killed was init. IMHO it should be the
last process to be killed, immediately after sshd, but that's a minor
problem.

When I tried to restart the vserver, it did not came up. Long story short,
I found that lxc-destroy did not destroy the cgroup of the same name as the
server. The cgroup remains visible in the /sys/fs/cgroup/cpu/master
directory. The tasks file is empty though.

I had to rename the container to be able to start it.

All this on ubuntu 11.04, 3.0.0-12-server amd64. Thoughts, comments?

--
Arie
--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] How to start the network services so as to get the IP address using lxc-execute???

2011-12-08 Thread Ramez Hanna
On Thu, Dec 8, 2011 at 12:33 PM, nishant mungse nishantmun...@gmail.com wrote:
 Hi,

 I want to manually invoke a networking setup to start the network service to
 get the IP address of container , But the problem is i don't want to start
 the container and want to use lxc-execute.

 When I tried these things happened::

 command :: lxc-execute -n base -f /home/nishant/ubuntu.conf
 /var/lib/lxc/base1/rootfs/etc/init.d/networking start

 O/P

 Rather than invoking init scripts through /etc/init.d, use the service(8)
 utility, e.g. service networking start

 Since the script you are attempting to invoke has been converted to an
 Upstart job, you may also use the start(8) utility, e.g. start networking
 start: Unable to connect to Upstart: Failed to connect to socket
 /com/ubuntu/upstart: Connection refused


 How to start the network services so as to get the IP addresses of
 containers?


 Regards,
 Nishant




 --
 Cloud Services Checklist: Pricing and Packaging Optimization
 This white paper is intended to serve as a reference, checklist and point of
 discussion for anyone considering optimizing the pricing and packaging model
 of a cloud services business. Read Now!
 http://www.accelacomm.com/jaw/sfnl/114/51491232/
 ___
 Lxc-users mailing list
 Lxc-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/lxc-users


looks like the upstart scripts need upstart to be running!
you could use a different script to start the networking say from a sysv init
but I am not sure that with execute you will get the networking
stack/isolation  available

-- 
BR
RH
http://informatiq.org

--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] lxc-destroy does not destroy cgroup

2011-12-08 Thread Gordon Henderson
On Thu, 8 Dec 2011, Arie Skliarouk wrote:

 When I tried to restart the vserver, it did not came up. Long story short,
 I found that lxc-destroy did not destroy the cgroup of the same name as the
 server. The cgroup remains visible in the /sys/fs/cgroup/cpu/master
 directory. The tasks file is empty though.

 I had to rename the container to be able to start it.

Did you remember to stop it first?

 All this on ubuntu 11.04, 3.0.0-12-server amd64. Thoughts, comments?

Very very similar to what I experience from time to time. (Posted about 
recently with zero response) Although my more drastic solution is to 
reboot the host, but I have gotten away with lxc-stop then a start.

I've now stopped using memory limits in containers and for the time being 
will let them swap (or share more memory with other containers and swap 
if needed) - they're mostly well behaved though.

I don't have a solution I'm afraid.

Gordon

--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] lxc-destroy does not destroy cgroup

2011-12-08 Thread Arie Skliarouk
On Thu, Dec 8, 2011 at 14:05, Gordon Henderson gor...@drogon.net wrote:

 On Thu, 8 Dec 2011, Arie Skliarouk wrote:

  When I tried to restart the vserver, it did not came up. Long story
 short, I found that lxc-destroy did not destroy the cgroup of the same name
 as the server. The cgroup remains visible in the /sys/fs/cgroup/cpu/master
 directory. The tasks file is empty though.

   I had to rename the container to be able to start it.

 Did you remember to stop it first?


Of course! It is part of the vserver stop script.


  All this on ubuntu 11.04, 3.0.0-12-server amd64. Thoughts, comments?

 Very very similar to what I experience from time to time. (Posted about
 recently with zero response) Although my more drastic solution is to reboot
 the host, but I have gotten away with lxc-stop then a start.


Well, with 65 running containers (24GB of RAM) it is easier to rename the
vserver :)

I've now stopped using memory limits in containers and for the time being
 will let them swap (or share more memory with other containers and swap if
 needed) - they're mostly well behaved though.


My vservers do not behave well and require restrictions.

BTW, do you know how can I restrict number of running processes in a
container (like in openvz)?

--
Arie
--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] How to start the network services so as to get the IP address using lxc-execute???

2011-12-08 Thread nishant mungse
Hi Greg,

Thanks 4 reply.

I just want the IP addresses of the containers. And one more thing can I
get the IP address of containers in sequence for eg. container1 ::
198.208.168.1 container 2 :: 198.208.168.2 and like this.

Please help me ASAP.

Regards,
Nishant

On Thu, Dec 8, 2011 at 5:09 PM, Greg Kurz gk...@fr.ibm.com wrote:

 On Thu, 2011-12-08 at 16:03 +0530, nishant mungse wrote:
  Hi,
 
  I want to manually invoke a networking setup to start the network
  service to get the IP address of container , But the problem is i
  don't want to start the container and want to use lxc-execute.
 
  When I tried these things happened::
 
  command :: lxc-execute -n base
  -f /home/nishant/ubuntu.conf
 /var/lib/lxc/base1/rootfs/etc/init.d/networking start

 Ok... this can't work. lxc-execute is for application containers only:
 it runs lxc-init instead of standard /sbin/init. The networking script
 you invoke needs upstart to be already running in the container... You
 seem to have a system container here, it _MUST_ be started with
 lxc-start.

 
  O/P
 
  Rather than invoking init scripts through /etc/init.d, use the
  service(8)
  utility, e.g. service networking start
 
  Since the script you are attempting to invoke has been converted to an
  Upstart job, you may also use the start(8) utility, e.g. start
  networking
  start: Unable to connect to Upstart: Failed to connect to
  socket /com/ubuntu/upstart: Connection refused
 
 
  How to start the network services so as to get the IP addresses of
  containers?
 

 What's your true need here ? Controlling the containers network services
 from the host or just knowing the addresses used by the containers ? I
 guess both are doable in a variety of ways.

 Cheers.

 
  Regards,
  Nishant
 
 
 
 
 --
  Cloud Services Checklist: Pricing and Packaging Optimization
  This white paper is intended to serve as a reference, checklist and
 point of
  discussion for anyone considering optimizing the pricing and packaging
 model
  of a cloud services business. Read Now!
  http://www.accelacomm.com/jaw/sfnl/114/51491232/
  ___ Lxc-users mailing list
 Lxc-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/lxc-users

 --
 Gregory Kurz gk...@fr.ibm.com
 Software Engineer @ IBM/Meiosys  http://www.ibm.com
 Tel +33 (0)534 638 479   Fax +33 (0)561 400 420

 Anarchy is about taking complete responsibility for yourself.
Alan Moore.


--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] lxc-destroy does not destroy cgroup

2011-12-08 Thread Gordon Henderson
On Thu, 8 Dec 2011, Arie Skliarouk wrote:

 On Thu, Dec 8, 2011 at 14:05, Gordon Henderson gor...@drogon.net wrote:

 On Thu, 8 Dec 2011, Arie Skliarouk wrote:

 When I tried to restart the vserver, it did not came up. Long story
 short, I found that lxc-destroy did not destroy the cgroup of the same name
 as the server. The cgroup remains visible in the /sys/fs/cgroup/cpu/master
 directory. The tasks file is empty though.

  I had to rename the container to be able to start it.

 Did you remember to stop it first?

 Of course! It is part of the vserver stop script.

Just checking!

 All this on ubuntu 11.04, 3.0.0-12-server amd64. Thoughts, comments?

 Very very similar to what I experience from time to time. (Posted about
 recently with zero response) Although my more drastic solution is to reboot
 the host, but I have gotten away with lxc-stop then a start.

 Well, with 65 running containers (24GB of RAM) it is easier to rename the
 vserver :)

Yes. I can see that a system restart might irritate a few other people!

Out of curiosity, what kernel are you running? I'm on 2.6.35, but looking 
at some of the later ones now...

 I've now stopped using memory limits in containers and for the time being
 will let them swap (or share more memory with other containers and swap if
 needed) - they're mostly well behaved though.

 My vservers do not behave well and require restrictions.

OK.

 BTW, do you know how can I restrict number of running processes in a
 container (like in openvz)?

No idea I'm afraid. I guess some sort of super limit passed into the 
containers init (via setrlimit() ?) is what's needed...

Gordon

--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] How to start the network services so as to get the IP address using lxc-execute???

2011-12-08 Thread Geordy Korte
I have a script that gets the from a running container, if that is what you 
need i post it tommorrow morning. If i forget ST me via the ibm network.

Mvg

Geordy Korte
(Sent via iphone so shorter then normal)


On 8 dec. 2011, at 13:59, nishant mungse nishantmun...@gmail.com wrote:

 
 Hi Greg,
 
 Thanks 4 reply.
 
 I just want the IP addresses of the containers. And one more thing can I get 
 the IP address of containers in sequence for eg. container1 :: 198.208.168.1 
 container 2 :: 198.208.168.2 and like this.
 
 Please help me ASAP.
 
 Regards,
 Nishant
 
 On Thu, Dec 8, 2011 at 5:09 PM, Greg Kurz gk...@fr.ibm.com wrote:
 On Thu, 2011-12-08 at 16:03 +0530, nishant mungse wrote:
  Hi,
 
  I want to manually invoke a networking setup to start the network
  service to get the IP address of container , But the problem is i
  don't want to start the container and want to use lxc-execute.
 
  When I tried these things happened::
 
  command :: lxc-execute -n base
  -f /home/nishant/ubuntu.conf 
  /var/lib/lxc/base1/rootfs/etc/init.d/networking start
 
 Ok... this can't work. lxc-execute is for application containers only:
 it runs lxc-init instead of standard /sbin/init. The networking script
 you invoke needs upstart to be already running in the container... You
 seem to have a system container here, it _MUST_ be started with
 lxc-start.
 
 
  O/P
 
  Rather than invoking init scripts through /etc/init.d, use the
  service(8)
  utility, e.g. service networking start
 
  Since the script you are attempting to invoke has been converted to an
  Upstart job, you may also use the start(8) utility, e.g. start
  networking
  start: Unable to connect to Upstart: Failed to connect to
  socket /com/ubuntu/upstart: Connection refused
 
 
  How to start the network services so as to get the IP addresses of
  containers?
 
 
 What's your true need here ? Controlling the containers network services
 from the host or just knowing the addresses used by the containers ? I
 guess both are doable in a variety of ways.
 
 Cheers.
 
 
  Regards,
  Nishant
 
 
 
  --
  Cloud Services Checklist: Pricing and Packaging Optimization
  This white paper is intended to serve as a reference, checklist and point of
  discussion for anyone considering optimizing the pricing and packaging model
  of a cloud services business. Read Now!
  http://www.accelacomm.com/jaw/sfnl/114/51491232/
  ___ Lxc-users mailing list 
  Lxc-users@lists.sourceforge.net 
  https://lists.sourceforge.net/lists/listinfo/lxc-users
 
 --
 Gregory Kurz gk...@fr.ibm.com
 Software Engineer @ IBM/Meiosys  http://www.ibm.com
 Tel +33 (0)534 638 479   Fax +33 (0)561 400 420
 
 Anarchy is about taking complete responsibility for yourself.
Alan Moore.
 
 
 --
 Cloud Services Checklist: Pricing and Packaging Optimization
 This white paper is intended to serve as a reference, checklist and point of 
 discussion for anyone considering optimizing the pricing and packaging model 
 of a cloud services business. Read Now!
 http://www.accelacomm.com/jaw/sfnl/114/51491232/
 ___
 Lxc-users mailing list
 Lxc-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/lxc-users
--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] How to start the network services so as to get the IP address using lxc-execute???

2011-12-08 Thread Geordy Korte
Ok, got out of the hellish traffic jam.  Attached the Script I use to check
the IP number of a running machine.



On Thu, Dec 8, 2011 at 5:48 PM, Geordy Korte gko...@gmail.com wrote:

 I have a script that gets the from a running container, if that is what
 you need i post it tommorrow morning. If i forget ST me via the ibm network.

 Mvg

 Geordy Korte
 (Sent via iphone so shorter then normal)


 On 8 dec. 2011, at 13:59, nishant mungse nishantmun...@gmail.com wrote:


 Hi Greg,

 Thanks 4 reply.

 I just want the IP addresses of the containers. And one more thing can I
 get the IP address of containers in sequence for eg. container1 ::
 198.208.168.1 container 2 :: 198.208.168.2 and like this.

 Please help me ASAP.

 Regards,
 Nishant

 On Thu, Dec 8, 2011 at 5:09 PM, Greg Kurz gk...@fr.ibm.com wrote:

 On Thu, 2011-12-08 at 16:03 +0530, nishant mungse wrote:
  Hi,
 
  I want to manually invoke a networking setup to start the network
  service to get the IP address of container , But the problem is i
  don't want to start the container and want to use lxc-execute.
 
  When I tried these things happened::
 
  command :: lxc-execute -n base
  -f /home/nishant/ubuntu.conf
 /var/lib/lxc/base1/rootfs/etc/init.d/networking start

 Ok... this can't work. lxc-execute is for application containers only:
 it runs lxc-init instead of standard /sbin/init. The networking script
 you invoke needs upstart to be already running in the container... You
 seem to have a system container here, it _MUST_ be started with
 lxc-start.

 
  O/P
 
  Rather than invoking init scripts through /etc/init.d, use the
  service(8)
  utility, e.g. service networking start
 
  Since the script you are attempting to invoke has been converted to an
  Upstart job, you may also use the start(8) utility, e.g. start
  networking
  start: Unable to connect to Upstart: Failed to connect to
  socket /com/ubuntu/upstart: Connection refused
 
 
  How to start the network services so as to get the IP addresses of
  containers?
 

 What's your true need here ? Controlling the containers network services
 from the host or just knowing the addresses used by the containers ? I
 guess both are doable in a variety of ways.

 Cheers.

 
  Regards,
  Nishant
 
 
 
 
 --
  Cloud Services Checklist: Pricing and Packaging Optimization
  This white paper is intended to serve as a reference, checklist and
 point of
  discussion for anyone considering optimizing the pricing and packaging
 model
  of a cloud services business. Read Now!
  http://www.accelacomm.com/jaw/sfnl/114/51491232/
  ___ Lxc-users mailing list
 Lxc-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/lxc-users

 --
 Gregory Kurz gk...@fr.ibm.com
 Software Engineer @ IBM/Meiosys  http://www.ibm.com
 Tel +33 (0)534 638 479   Fax +33 (0)561 400 420

 Anarchy is about taking complete responsibility for yourself.
Alan Moore.



 --
 Cloud Services Checklist: Pricing and Packaging Optimization
 This white paper is intended to serve as a reference, checklist and point
 of
 discussion for anyone considering optimizing the pricing and packaging
 model
 of a cloud services business. Read Now!
 http://www.accelacomm.com/jaw/sfnl/114/51491232/

 ___
 Lxc-users mailing list
 Lxc-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/lxc-users




-- 
==
Geordy Korte
MSN geo...@geordy.nl


lxc-ip
Description: Binary data
--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] seeing a network pause when starting and stopping LXCs - how do I stop this?

2011-12-08 Thread Michael H. Warfield
On Thu, 2011-12-08 at 19:47 +1300, Gary Ballantyne wrote: 
 On 08/12/11 19:39, Daniel Lezcano wrote:
  On 12/08/2011 12:38 AM, Joseph Heck wrote:
  I've been seeing a pause in the whole networking stack when starting
  and stopping LXC - it seems to be somewhat intermittent, but happens
  reasonably consistently the first time I start up the LXC.
 
  I'm using ubuntu 11.10, which is using LXC 0.7.5
 
  I'm starting the container with lxc-start -d -n $CONTAINERNAME
  That could be the bridge configuration. Did you do 'brctl setfd br0 0' ?

 FWIW, I see the same issue following [1], which has 'brctl setfd br0 0'.

 [1] 
 http://www.activestate.com/blog/2011/10/virtualization-ec2-cloud-using-lxc

That just sets the bridge delay to zero (which could have an impact)
but does not change the MAC address policy of assigning the lowest MAC
address to the bridge itself.

If the bridge mac address changes then any OTHER nodes or routers on the
network have to fail out their ARP caches and re-ARP for the new MAC
address, resulting in the delay.  The only way to work around this
problem is to assign very high MAC addresses to the nodes on the bridge
to keep them from changing the MAC address of the bridge itself.
Setting the locally administered (0200 in first word) bit in the MAC
address helps but may not be sufficient (warning - DO NOT set the
MULTICAST bit (0100 in first word)!).

This was a design decision made many years ago in the Linux kernel for
reasons I did not agree with and do not agree with but it is what it is
and I doubt it will ever change.  I think there's a patch going into the
lxc-tools to avoid this problem.

Regards,
Mike

-- 
Michael H. Warfield (AI4NB) | (770) 985-6132 |  m...@wittsend.com
   /\/\|=mhw=|\/\/  | (678) 463-0932 |  http://www.wittsend.com/mhw/
   NIC whois: MHW9  | An optimist believes we live in the best of all
 PGP Key: 0x674627FF| possible worlds.  A pessimist is sure of it!


signature.asc
Description: This is a digitally signed message part
--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] How to start the network services so as to get the IP address using lxc-execute???

2011-12-08 Thread Brian K. White
This isn't meant as an insult but you seem to be trying to do things 
backwards and expecting, worse, demanding, a low level tool to contain 
high level features that really should be provided by your own 
scripting, or by other tools that already exist for that purpose.

If you want to assign container ip addresses in some particular order, 
then simply do so. You can ensure container IP's get set whatever way 
you want by any number of means. You can write a start script that 
writes IP's into the container config files and/or rewrites them 
dynamically every time it's started up, you can tell the containers to 
use dhcp and you can control the dhcp server. If you want to read the 
containers IP, you can get it from the hosts dhcp server state/log file 
or possibly from the arp table on the host or by directly reading files 
from the containers filesystem.

Someone already gave you a good example of a simple bit of shell 
scripting that takes the container name and uses that to produce the ip 
address as long as the container names adhered to a consistent pattern.

If that's not what you wanted then what? Chronological order? That's 
sort of meaningless since containers can be stopped and restarted.

If you want the ip's to be assigned chronologically, ie, the first 
container to be started gets ip #1, that's trivial too, just write the 
start script to keep count in a temp file every time it is started, or 
have it parse the list of all running containers and add one to whatever 
is the current highest number running before starting a new container. 
But then this points out how meaningless this request is from the 
beginning. What happens after containers have been stopped and 
restarted? Do you want a restarted container to get a new next-highest 
number? or remember it's original number? If you want it to get a new 
number, then what happens when the always incrementing number gets to 
the end of the netmask? If you want it to remember the number that it 
got originally then what why not just write that number in it's config 
file from the beginning? If you want it to reuse IP's dynamically from a 
pool then that is already what a dhcp server does.

I really don't understand what you are trying to do or trying to avoid 
doing or why, that isn't easily answered by a little shell scripting 
and/or a dhcp server.

-- 
bkw

On 12/8/2011 7:59 AM, nishant mungse wrote:

 Hi Greg,

 Thanks 4 reply.

 I just want the IP addresses of the containers. And one more thing can I
 get the IP address of containers in sequence for eg. container1 ::
 198.208.168.1 container 2 :: 198.208.168.2 and like this.

 Please help me ASAP.

 Regards,
 Nishant

 On Thu, Dec 8, 2011 at 5:09 PM, Greg Kurz gk...@fr.ibm.com
 mailto:gk...@fr.ibm.com wrote:

 On Thu, 2011-12-08 at 16:03 +0530, nishant mungse wrote:
   Hi,
  
   I want to manually invoke a networking setup to start the network
   service to get the IP address of container , But the problem is i
   don't want to start the container and want to use lxc-execute.
  
   When I tried these things happened::
  
   command :: lxc-execute -n base
   -f /home/nishant/ubuntu.conf
 /var/lib/lxc/base1/rootfs/etc/init.d/networking start

 Ok... this can't work. lxc-execute is for application containers only:
 it runs lxc-init instead of standard /sbin/init. The networking script
 you invoke needs upstart to be already running in the container... You
 seem to have a system container here, it _MUST_ be started with
 lxc-start.

  
   O/P
  
   Rather than invoking init scripts through /etc/init.d, use the
   service(8)
   utility, e.g. service networking start
  
   Since the script you are attempting to invoke has been converted
 to an
   Upstart job, you may also use the start(8) utility, e.g. start
   networking
   start: Unable to connect to Upstart: Failed to connect to
   socket /com/ubuntu/upstart: Connection refused
  
  
   How to start the network services so as to get the IP addresses of
   containers?
  

 What's your true need here ? Controlling the containers network services
 from the host or just knowing the addresses used by the containers ? I
 guess both are doable in a variety of ways.

 Cheers.

  
   Regards,
   Nishant
  
  
  
  
 
 --
   Cloud Services Checklist: Pricing and Packaging Optimization
   This white paper is intended to serve as a reference, checklist
 and point of
   discussion for anyone considering optimizing the pricing and
 packaging model
   of a cloud services business. Read Now!
   http://www.accelacomm.com/jaw/sfnl/114/51491232/
   ___ Lxc-users mailing
 list Lxc-users@lists.sourceforge.net
 

Re: [Lxc-users] How to start the network services so as to get the IP address using lxc-execute???

2011-12-08 Thread nishant mungse
Hi,


Thanks 4 script.

Regards,
Nishant

On Fri, Dec 9, 2011 at 12:18 AM, Geordy Korte gko...@gmail.com wrote:

 Ok, got out of the hellish traffic jam.  Attached the Script I use to
 check the IP number of a running machine.




 On Thu, Dec 8, 2011 at 5:48 PM, Geordy Korte gko...@gmail.com wrote:

 I have a script that gets the from a running container, if that is what
 you need i post it tommorrow morning. If i forget ST me via the ibm network.

 Mvg

 Geordy Korte
 (Sent via iphone so shorter then normal)


 On 8 dec. 2011, at 13:59, nishant mungse nishantmun...@gmail.com wrote:


 Hi Greg,

 Thanks 4 reply.

 I just want the IP addresses of the containers. And one more thing can I
 get the IP address of containers in sequence for eg. container1 ::
 198.208.168.1 container 2 :: 198.208.168.2 and like this.

 Please help me ASAP.

 Regards,
 Nishant

 On Thu, Dec 8, 2011 at 5:09 PM, Greg Kurz gk...@fr.ibm.com wrote:

 On Thu, 2011-12-08 at 16:03 +0530, nishant mungse wrote:
  Hi,
 
  I want to manually invoke a networking setup to start the network
  service to get the IP address of container , But the problem is i
  don't want to start the container and want to use lxc-execute.
 
  When I tried these things happened::
 
  command :: lxc-execute -n base
  -f /home/nishant/ubuntu.conf
 /var/lib/lxc/base1/rootfs/etc/init.d/networking start

 Ok... this can't work. lxc-execute is for application containers only:
 it runs lxc-init instead of standard /sbin/init. The networking script
 you invoke needs upstart to be already running in the container... You
 seem to have a system container here, it _MUST_ be started with
 lxc-start.

 
  O/P
 
  Rather than invoking init scripts through /etc/init.d, use the
  service(8)
  utility, e.g. service networking start
 
  Since the script you are attempting to invoke has been converted to an
  Upstart job, you may also use the start(8) utility, e.g. start
  networking
  start: Unable to connect to Upstart: Failed to connect to
  socket /com/ubuntu/upstart: Connection refused
 
 
  How to start the network services so as to get the IP addresses of
  containers?
 

 What's your true need here ? Controlling the containers network services
 from the host or just knowing the addresses used by the containers ? I
 guess both are doable in a variety of ways.

 Cheers.

 
  Regards,
  Nishant
 
 
 
 
 --
  Cloud Services Checklist: Pricing and Packaging Optimization
  This white paper is intended to serve as a reference, checklist and
 point of
  discussion for anyone considering optimizing the pricing and packaging
 model
  of a cloud services business. Read Now!
  http://www.accelacomm.com/jaw/sfnl/114/51491232/
  ___ Lxc-users mailing list
 Lxc-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/lxc-users

 --
 Gregory Kurz gk...@fr.ibm.com
 Software Engineer @ IBM/Meiosys  http://www.ibm.com
 Tel +33 (0)534 638 479   Fax +33 (0)561 400 420

 Anarchy is about taking complete responsibility for yourself.
Alan Moore.



 --
 Cloud Services Checklist: Pricing and Packaging Optimization
 This white paper is intended to serve as a reference, checklist and point
 of
 discussion for anyone considering optimizing the pricing and packaging
 model
 of a cloud services business. Read Now!
 http://www.accelacomm.com/jaw/sfnl/114/51491232/

 ___
 Lxc-users mailing list
 Lxc-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/lxc-users




 --
 ==
 Geordy Korte
 MSN geo...@geordy.nl

--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] How to start the network services so as to get the IP address using lxc-execute???

2011-12-08 Thread nishant mungse
Hi Geordy,

You said that your script gets the IP from running container, but i dont
want to use lxc-start I just want the IP address and use lxc-execute to
start network services.


Regards,
Nishant

On Fri, Dec 9, 2011 at 11:00 AM, nishant mungse nishantmun...@gmail.comwrote:

 Hi,


 Thanks 4 script.

 Regards,
 Nishant


 On Fri, Dec 9, 2011 at 12:18 AM, Geordy Korte gko...@gmail.com wrote:

 Ok, got out of the hellish traffic jam.  Attached the Script I use to
 check the IP number of a running machine.




 On Thu, Dec 8, 2011 at 5:48 PM, Geordy Korte gko...@gmail.com wrote:

 I have a script that gets the from a running container, if that is what
 you need i post it tommorrow morning. If i forget ST me via the ibm network.

 Mvg

 Geordy Korte
 (Sent via iphone so shorter then normal)


 On 8 dec. 2011, at 13:59, nishant mungse nishantmun...@gmail.com
 wrote:


 Hi Greg,

 Thanks 4 reply.

 I just want the IP addresses of the containers. And one more thing can I
 get the IP address of containers in sequence for eg. container1 ::
 198.208.168.1 container 2 :: 198.208.168.2 and like this.

 Please help me ASAP.

 Regards,
 Nishant

 On Thu, Dec 8, 2011 at 5:09 PM, Greg Kurz gk...@fr.ibm.com wrote:

 On Thu, 2011-12-08 at 16:03 +0530, nishant mungse wrote:
  Hi,
 
  I want to manually invoke a networking setup to start the network
  service to get the IP address of container , But the problem is i
  don't want to start the container and want to use lxc-execute.
 
  When I tried these things happened::
 
  command :: lxc-execute -n base
  -f /home/nishant/ubuntu.conf
 /var/lib/lxc/base1/rootfs/etc/init.d/networking start

 Ok... this can't work. lxc-execute is for application containers only:
 it runs lxc-init instead of standard /sbin/init. The networking script
 you invoke needs upstart to be already running in the container... You
 seem to have a system container here, it _MUST_ be started with
 lxc-start.

 
  O/P
 
  Rather than invoking init scripts through /etc/init.d, use the
  service(8)
  utility, e.g. service networking start
 
  Since the script you are attempting to invoke has been converted to an
  Upstart job, you may also use the start(8) utility, e.g. start
  networking
  start: Unable to connect to Upstart: Failed to connect to
  socket /com/ubuntu/upstart: Connection refused
 
 
  How to start the network services so as to get the IP addresses of
  containers?
 

 What's your true need here ? Controlling the containers network services
 from the host or just knowing the addresses used by the containers ? I
 guess both are doable in a variety of ways.

 Cheers.

 
  Regards,
  Nishant
 
 
 
 
 --
  Cloud Services Checklist: Pricing and Packaging Optimization
  This white paper is intended to serve as a reference, checklist and
 point of
  discussion for anyone considering optimizing the pricing and
 packaging model
  of a cloud services business. Read Now!
  http://www.accelacomm.com/jaw/sfnl/114/51491232/
  ___ Lxc-users mailing
 list Lxc-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/lxc-users

 --
 Gregory Kurz gk...@fr.ibm.com
 Software Engineer @ IBM/Meiosys  http://www.ibm.com
 Tel +33 (0)534 638 479   Fax +33 (0)561 400 420

 Anarchy is about taking complete responsibility for yourself.
Alan Moore.



 --
 Cloud Services Checklist: Pricing and Packaging Optimization
 This white paper is intended to serve as a reference, checklist and
 point of
 discussion for anyone considering optimizing the pricing and packaging
 model
 of a cloud services business. Read Now!
 http://www.accelacomm.com/jaw/sfnl/114/51491232/

 ___
 Lxc-users mailing list
 Lxc-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/lxc-users




 --
 ==
 Geordy Korte
 MSN geo...@geordy.nl



--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users