Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have multiple VMs running on a KVM hypervisor. One of the VMs is consuming most of the available bandwidth, making it difficult for other VMs to use. How can I control the bandwidth usage for each VM. I would like to guarantee bandwidth for each individual VM. I would like to know if this is usually done on a hypervisor level, if so how? or on a virtual switch level provided that I have one.

share|improve this question
add comment

3 Answers

The libvirt domain specification includes this functionality already. You can specify separate settings for incoming and outgoing traffic. The example given in the libvirt documentation is:

<devices>
  <interface type='network'>
    <source network='default'/>
    <target dev='vnet0'/>
    <bandwidth>
      <inbound average='1000' peak='5000' floor='200' burst='1024'/>
      <outbound average='128' peak='256' burst='256'/>
    </bandwidth>
  </interface>
<devices>

You can read more upstream at http://libvirt.org/formatdomain.html#elementQoS

share|improve this answer
add comment

Depending how the VMs are networked (bridged vs routed), you might be able to use tc(8) in the host to provide priority queuing.

There is a full howto available.

share|improve this answer
add comment

While this might be overkill, I think it may be worth looking into Open vSwitch. It is a software switch that uses OpenFlow to provide Layer 2 and Layer 3 functions. This includes routing and QoS. You may have better luck with tc, I just wanted to make sure you were aware of this.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.