[libvirt] adding bandwidth control support

My last post failed, resend... Max Zhen at 2008-12-24 18:39 wrote:
Hi,
I'm working on adding bandwidth control support in virt-install/virsh/libvirt on Xen. This support can allow setting bandwidth control in dom0 (I'm working on Solaris dom0 now) for virtual nic devices used in a domU. I've attached my design in this email. Basically, this design is about how to represent bandwidth limit information in command line for virsh/virt-install and how to represent it in current XML configuration file for a domU.
Your comments will be highly appreciated :).
Thanks, Max
There are a few things to do to achieve this goal: 1. extend current command line syntax of 'virsh attach-interface' 2. extend current command line syntax of 'virt-install' 3. define bandwidth representation in XML format For 1. I will change the current command line syntax to: virsh attach-interface <domain> <type> <source> [--target <target>] [--mac <mac>] [--script <script>] [--rate <rate-string>] So that we are able to specify bandwidth as "--rate 100M" in command line, like: #virsh attach-interface domu bridge bge0 --rate 100M In this case, bandwidth is specified as an integer with one of the scale suffixes K, M, or G for Kbps, Mbps, or Gbps. For 2. I will add one more option "--rate=rate-string" to current option set of virt-install command. Users can repeatedly add more than one 'rate' options to set bandwidth for multiple nic devices respectively, if needed. For example, with below command line, we start installing a domain with two nic devices whose bandwidth are set to 100Mb/s and 200Mb/s respectively: #virt-install -n snv105 -r 2048 -p --file=/root/snv105 --location=/solarisdvd.iso -b bge0 --rate=100M -b bge1 --rate=200M In this case, bandwidth is specified as an integer with one of the scale suffixes K, M, or G for Kbps, Mbps, or Gbps. For 3. All user specified bandwidth will be represented as part of interface element currently defined in XML configuration file. The new format looks like: <interface type='bridge'> <source bridge='e1000g1'/> <flowcontrol> <rate unit='megabit' period='second' value='100'/> </flowcontrol> </interface> So, I create a new element, "flowcontrol", inside "interface" element. Inside "flowcontrol", I provide bandwidth by setting "rate" element with three attributes, "unit", "period" and "value" to express the bandwidth limit. The supported unit can be 'gigabit', 'megabit' and 'kilobit'. The supported period can be 'second', 'millisecond' and 'microsecond'. And value is an integer to express the amount of data in unit allowed to be transfered in period of time. More elements can be added inside "flowcontrol" element, if we want to add more flow control policies in the future.

Max Zhen <Max.Zhen@Sun.COM> wrote:
Hi,
I'm working on adding bandwidth control support in virt-install/virsh/libvirt on Xen. This support can allow setting bandwidth control in dom0 (I'm working on Solaris dom0 now) for virtual nic devices used in a domU. I've attached my design in this email. Basically, this design is about how to represent bandwidth limit information in command line for virsh/virt-install and how to represent it in current XML configuration file for a domU.
Hi Max, Can the vif "rate=..." setting do what you want? http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Virtualiz...

Jim Meyering at 2009-1-5 23:50 wrote:
Max Zhen <Max.Zhen@Sun.COM> wrote:
Hi,
I'm working on adding bandwidth control support in virt-install/virsh/libvirt on Xen. This support can allow setting bandwidth control in dom0 (I'm working on Solaris dom0 now) for virtual nic devices used in a domU. I've attached my design in this email. Basically, this design is about how to represent bandwidth limit information in command line for virsh/virt-install and how to represent it in current XML configuration file for a domU.
Hi Max,
Can the vif "rate=..." setting do what you want?
http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Virtualiz...
Hi Jim, Yes, that is my first step to support bandwidth control in Solaris dom0 (by leveraging 'rate=' in '.py' config file working with xm). But, since virsh/libvirt is much more popular now, I think that it would be a good idea to support bandwidth in libvirt. This is why I'd like to add it to XML format config file :). What is your concern to support rate option in XML file? Max

Max Zhen <Max.Zhen@Sun.COM> wrote:
Jim Meyering at 2009-1-5 23:50 wrote:
Max Zhen <Max.Zhen@Sun.COM> wrote:
I'm working on adding bandwidth control support in virt-install/virsh/libvirt on Xen. This support can allow setting bandwidth control in dom0 (I'm working on Solaris dom0 now) for virtual nic devices used in a domU. I've attached my design in this email. Basically, this design is about how to represent bandwidth limit information in command line for virsh/virt-install and how to represent it in current XML configuration file for a domU.
Hi Max,
Can the vif "rate=..." setting do what you want?
http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Virtualiz...
Hi Jim,
Yes, that is my first step to support bandwidth control in Solaris dom0 (by leveraging 'rate=' in '.py' config file working with xm). But, since virsh/libvirt is much more popular now, I think that it would be a good idea to support bandwidth in libvirt. This is why I'd like to add it to XML format config file :). What is your concern to support rate option in XML file?
Hi Max, In principle, I have no objection at all. Since you didn't mention the "time window" parameter discussed there, I wondered if you'd seen it. As long as we're looking at extending the interface XML, are there other things to consider, like interface bonding and failover? This is QoS oriented, so should we consider something more sophisticated than a one- or two-parameter bandwidth control?

Jim Meyering at 2009-1-10 1:18 wrote:
Max Zhen <Max.Zhen@Sun.COM> wrote:
Jim Meyering at 2009-1-5 23:50 wrote:
Max Zhen <Max.Zhen@Sun.COM> wrote:
I'm working on adding bandwidth control support in virt-install/virsh/libvirt on Xen. This support can allow setting bandwidth control in dom0 (I'm working on Solaris dom0 now) for virtual nic devices used in a domU. I've attached my design in this email. Basically, this design is about how to represent bandwidth limit information in command line for virsh/virt-install and how to represent it in current XML configuration file for a domU.
Hi Max,
Can the vif "rate=..." setting do what you want?
http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Virtualiz...
Hi Jim,
Yes, that is my first step to support bandwidth control in Solaris dom0 (by leveraging 'rate=' in '.py' config file working with xm). But, since virsh/libvirt is much more popular now, I think that it would be a good idea to support bandwidth in libvirt. This is why I'd like to add it to XML format config file :). What is your concern to support rate option in XML file?
Hi Max,
In principle, I have no objection at all. Since you didn't mention the "time window" parameter discussed there, I wondered if you'd seen it.
As long as we're looking at extending the interface XML, are there other things to consider, like interface bonding and failover? This is QoS oriented, so should we consider something more sophisticated than a one- or two-parameter bandwidth control?
Hi Jim, Yes, it would be nice if we have a total solution for QoS support in virsh/libvirtd and I wouldn't claim that I'm trying to solve that problem in my current design. I think that it is just one step toward that goal. The reason to choose to just support bandwidth limit is that bandwidth is currently the only parameter explicitly supported by Xen (in xend, to be specific). Max
-- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Hi, Here are some updates on this work: It is common that user want to set up backend device for a virtual interface over a VLAN. So, one more option is added, '--vlanid', to specify the VLAN ID user want to attach to the backend device supporting this virtual interface. So that the shell script responsible for setting up the backend device can do all the configuration for user. It was pointed out that 'bandwidth control' is not a clear statement. We can only support setting upper limit of the bandwidth for a virtual interface for now. We are not able to reserve a specific bandwidth for it. So, the name of the new option for 'virsh attach-interface' is changed from '--rate' to '--capped-bandwidth' to remove the ambiguity and leave room for reserved bandwidth in the future. Based on the above changes, the XML format changed from my previous proposal: <interface type='bridge'> <source bridge='e1000g1'/> <flowcontrol> <rate unit='megabit' period='second' value='100'/> </flowcontrol> </interface> to something looks like below: <interface type='bridge'> <source bridge='e1000g1'/> <networkresource> <capped-bandwidth unit='megabit' period='second' value='100'/> </networkresource> <vlan id='1'/> </interface> Note that we also change the element name from 'flowcontrol' to 'networkresource' so that we can add more QoS related (not just related to bandwidth) parameters into this element in the future, if needed. There are also changes in virt-install command line options. Like '--disk' option, I also grouped network related optioins into properties of -w/--network option. So, instead of adding '--capped-bandwidth' and '--vlanid' options, I choose to add two properties for -w/--network option. Now, we have: # virt-install ... --network bridge=eth0,vlanid=2,mac=aa:0:1:2:3:4,capped-bandwidth=200M. Old style of syntax is still supported, but should be obsoleted. Any comment? Thanks, Max
participants (2)
-
Jim Meyering
-
Max Zhen