[lxc-devel] Default Namespace
Hi, How can we create common default namespace which can be communicated with all the other namespaces. (I mean, all the namespaces will communicate with external system via default namespace) Main() is considered as a default namespace. Thanks Mahesh -Original Message- From: Daniel Lezcano [mailto:daniel.lezc...@free.fr] Sent: Tuesday, February 22, 2011 5:26 PM To: Maheswara Reddy C - ERS, HCL Tech Cc: lxc-devel@lists.sourceforge.net Subject: Re: [lxc-devel] do pid1 and pid2 run in the same network namespace On 02/22/2011 12:22 PM, Maheswara Reddy C - ERS, HCL Tech wrote: >> Then it is quite easy. You just have to fork ten times the routine in the >> program I gave you in the previous email. > Hi Daniel, > > But I want to run two different (fork() run same copy) process/threads in > each namespace, that's why I am using clone() which take function pointer of > each process/thered to start. Have fun ;) #include #include #include #include #include #include #include #define NRNS 10 int myroutine1(void) { return 0; } int myroutine2(void) { return 0; } int main(int argc, char *argv[]) { int i; pid_t pid; for (i = 0; i< NRNS; i++) { /* create a new network namespace for my childs */ if (unshare(CLONE_NEWNET)) { perror("unshare"); return 1; } pid = fork(); if (pid< 0) { perror("fork"); return 1; } if (!pid) exit(myroutine1()); pid = fork(); if (pid< 0) { perror("fork2"); return 1; } if (!pid) exit(myroutine2()); } /* create a new netns to not share with the last one * At the end we have 10 netns + 1 this one */ if (unshare(CLONE_NEWNET)) { perror("unshare2"); return 1; } for (;;) { pid = wait(NULL); if (pid< 0) { if (errno == ECHILD) return 0; if (errno == EINTR) continue; perror("wait"); return 1; } } } ::DISCLAIMER:: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. --- -- Free Software Download: Index, Search & Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
[lxc-devel] lxc final thesis
Hi, I am a student in the final year at the Computer Science Faculty in Bucharest, Romania and I would like to contribute to the lxc project as part of the final thesis together with a colleague of mine. We were thinking to work at the bandwidth limitation within a container. Is it ok to contribute? Are there some pointers regarding the course of action? Or is there anything else we could do in three months time? Thank you in advance, Ana-Maria. -- Free Software Download: Index, Search & Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
Re: [lxc-devel] Default Namespace
On 02/24/2011 07:52 AM, Maheswara Reddy C - ERS, HCL Tech wrote: > Hi, How can we create common default namespace which can be > communicated with all the other namespaces. What does that mean? When you say "namespace", there's the mount namespace, network namespace, PID namespace, /dev namespace, and several others. Each can be individually unshared, meaning siblings processes can see the same network but different filesystems and neither of them have the full device list their parent has. As for "communicate": they can communicate. You can set up a network routing between different network namesapces. You can mount shared filesystems between different filesystem namespaces. You can communicate to the outside world through /dev nodes in a unique device namespace. Please explain: what are you trying to _do_? Rob -- Free Software Download: Index, Search & Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
Re: [lxc-devel] lxc final thesis
On 02/24/2011 07:38 PM, Farcasi Ana-Maria wrote: > Hi, > > I am a student in the final year at the Computer Science Faculty in > Bucharest, Romania and I would like to contribute to the lxc project as part > of the final thesis together with a colleague of mine. > We were thinking to work at the bandwidth limitation within a container. Is > it ok to contribute? Are there some pointers regarding the course of action? > Or is there anything else we could do in three months time? Are you referring to bandwidth in general (cpu, io, network ...) or just the network ? Lxc is tied with the cgroup. The cgroup provides some controllers to limit the network bandwidth as well as the blkio. The network bandwidth for a container is hard to setup as far as I can see and some experiments to limit the bandwidth wrt the different lxc's network configuration maybe helpful. The first step would be to do that manually and the second step we can integrate in a couple of configuration lines the bandwidth limits for download and upload for the container. Some pointers: http://vger.kernel.org/netconf2009_slides/cgroup_talk.odp http://vger.kernel.org/netconf2009_slides/Network%20Control%20Group%20Whitepaper.odt Thanks -- Daniel -- Free Software Download: Index, Search & Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel