<div dir="ltr"><br><div class="gmail_extra">Hi,<br><br><div class="gmail_quote">On Fri, Jul 25, 2014 at 2:11 PM, Divya Vyas <span dir="ltr"><<a href="mailto:dvyas@mvista.com" target="_blank">dvyas@mvista.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi,<div><span style="color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.799999237060547px"><br>
</span></div>

<div><span style="color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.799999237060547px">sudo tc class add dev vethxxxxx parent 1: classid 1:1 htb rate 10mbit</span><br>


</div><div><span style="color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.799999237060547px"> Here you should give classid 10:2 as u are giving </span><span style="color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.799999237060547px">lxc-cgroup -n container net_cls.classid 0x00010002 . </span></div>
</div></blockquote><div>I think 0x00010002 must be 1:2, (0xAAAABBBB )</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">

<div><span style="color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.799999237060547px"><br></span></div><div><span style="color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.799999237060547px">Does tc command work in unprivileged mode also ? </span></div>


<div><span style="color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.799999237060547px"><br></span></div></div></blockquote>
<div> I didn't test it in container, I use tc command in host. :)</div><div>And I has resolved 'problem 2'. Unprivileged container don't support for command lxc.network.veth.pair.</div><div><a href="https://github.com/lxc/lxc/issues/255">https://github.com/lxc/lxc/issues/255</a><br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><span style="color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.799999237060547px"></span></div>
<div><br></div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 7, 2014 at 11:57 AM, Nguyễn Thành Long <span dir="ltr"><<a href="mailto:longnt@viegrid.com" target="_blank">longnt@viegrid.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><p style="margin-right:0px;margin-bottom:15px;margin-left:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.8px;margin-top:0px!important">





Hi all,</p><p style="margin-right:0px;margin-bottom:15px;margin-left:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.8px;margin-top:0px!important">





I have 2 problems when use unprivileged container.</p><p style="margin-right:0px;margin-bottom:15px;margin-left:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.8px;margin-top:0px!important">





Problem 1:</p><p style="margin:15px 0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.8px">I configured my container with:<br>





lxc.cgroup.blkio.weight = 500<br>lxc.cgroup.net_cls.classid = 0x00010002 # 1:2</p><p style="margin:15px 0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.8px">





and ran tc commands:<br>$sudo tc qdisc add dev lxcbr0 root handle 1: htb<br>$sudo tc class add dev lxcbr0 parent 1: classid 1:1 htb rate 10mbit<br>$sudo tc class add dev lxcbr0 parent 1: classid 1:2 htb rate 1mbit<br>$sudo tc filter add dev lxcbr0 protocol ip parent 1: prio 1 handle 1: cgroup</p>





<p style="margin:15px 0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.8px">then I started container and tested block i/o, network bandwidth by</p>





<ul style="padding:0px 0px 0px 30px;margin:15px 0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.8px"><li>copy a large file: dd if=/dev/zero of=/tmp/output bs=20k count=100k; rm -f /tmp/output</li>



<li>upload/download a large file. after that, I changed my config:</li></ul><p style="margin:15px 0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.8px">





lxc-cgroup -n container blkio.weight 1000.<br>lxc-cgroup -n container net_cls.classid 0x00010002</p><p style="margin-top:15px;margin-right:0px;margin-left:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.8px;margin-bottom:0px!important">





and tested again, but i didn't see a difference. <br>I also trying the same commands on eth0 instead of lxcbr0, but there was no effect.</p><p style="margin-top:15px;margin-right:0px;margin-left:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.8px;margin-bottom:0px!important">





I changed 'lxcbr0' by veth pair name(appear when start container after 
use ifconfig cmd, I can't set veth pair name, lxc.network.veth.pair no 
effect), and use:<br>$sudo tc qdisc add dev vethxxxxx root handle 1: htb default 2<br>

$sudo tc class add dev vethxxxxx parent 1: classid 1:1 htb rate 10mbit<br>$sudo tc class add dev vethxxxxx parent 1: classid 1:2 htb rate 1mbit<br>$sudo tc filter add dev vethxxxxx protocol ip parent 1: prio 1 handle 1: cgroup<br>





and test again, It's work. So I think it's a problem with net_cls, or lxc.cgroup.net_cls.classid no effect.<br>I feel confused.<br><br>I found many tutorials, but they maybe used for privileged container. </p>
<p style="margin-top:15px;margin-right:0px;margin-left:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.8px;margin-bottom:0px!important">





Problem 2:</p><p style="margin-right:0px;margin-bottom:15px;margin-left:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.8px;margin-top:0px!important">




I configured network in container:</p><p style="margin-right:0px;margin-bottom:15px;margin-left:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.8px;margin-top:0px!important">




<i>lxc.network.type = veth</i></p><p style="margin-right:0px;margin-bottom:15px;margin-left:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.8px;margin-top:0px!important">




<i>lxc.network.veth.pair = veth-c1</i></p><p style="margin-right:0px;margin-bottom:15px;margin-left:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.8px;margin-top:0px!important">




<i><a href="http://lxc.network.name" target="_blank">lxc.network.name</a> = eth0</i></p><p style="margin-right:0px;margin-bottom:15px;margin-left:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.8px;margin-top:0px!important">




<i>lxc.network.flags = up</i></p><p style="margin-right:0px;margin-bottom:15px;margin-left:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.8px;margin-top:0px!important">




<i>lxc.network.link = lxcbr0</i></p><p style="margin-right:0px;margin-bottom:15px;margin-left:0px;margin-top:0px!important"><i><font color="#333333" face="Helvetica, arial, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol"><span style="font-size:14px;line-height:23.8px">lxc.network.hwaddr = </span></font><font color="#545454" face="arial, sans-serif"><span style="line-height:18.2px">00:16:3e:67:4f:a5</span></font></i></p>




<p style="margin-right:0px;margin-bottom:15px;margin-left:0px;margin-top:0px!important"><font color="#545454" face="arial, sans-serif"><span style="line-height:18.2px">but veth inteface  don't rename at host ( veth-$random instead veth-c1)</span></font></p>




<p style="margin-right:0px;margin-bottom:15px;margin-left:0px;margin-top:0px!important">So lxc.network.veth.pair is not effect, or am I missing something ?</p><p style="margin-top:15px;margin-right:0px;margin-left:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:23.8px;margin-bottom:0px!important">





Host Ubuntu 14.04 LTS, container Ubuntu 12.04 LTS<br></p>
Can someone help me ? Thanks in advance.</div>
<br>_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br></blockquote></div><br></div>
<br>_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br></blockquote></div><br></div></div>