[libvirt-users] [qemu-kvm] Network bandwidth limits via libvirt

卓浩凡 zhuohaofan at 126.com
Thu Jun 15 05:56:09 UTC 2017


Hi all,

I try to understand why the network bandwidth limits are not applied to my ubuntu 16.04.2 VM (qemu-kvm driver) and I would need some insights.
I create my VM network with virsh and when I issue a dumpxml on my network, I can see that bandwidth limits are set:

virsh # net-dumpxml nat_limit
<network>
  <name>nat_limit</name>
  <uuid>4b5e128d-9ad0-4ccc-9424-dee60b71861a</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr1' stp='on' delay='0'/>
  <mac address='52:54:00:af:99:73'/>
  <bandwidth>
    <inbound average='10' peak='50' burst='10'/>
    <outbound average='128' peak='256' burst='256'/>
  </bandwidth>
  <ip address='192.168.123.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.123.2' end='192.168.123.254'/>
    </dhcp>
  </ip>

</network>


And the net info is:
virsh # net-info nat_limit
Name:           nat_limit
UUID:           4b5e128d-9ad0-4ccc-9424-dee60b71861a
Active:         yes
Persistent:     yes
Autostart:      yes
Bridge:         virbr1
Then, I create my VM, and the source of interface is the network, like this:
virsh # dumpxml virt20
...
    <interface type='network'>
      <mac address='52:54:00:a2:5b:10'/>
      <source network='nat_limit' bridge='virbr1'/>
      <target dev='vnet2'/>
      <model type='rtl8139'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
...


However when I send a big file with netper I don't see any limits applied to the transfer rate.

I've checked the domain log and I didn't see any qemu command line argument related to bandwidth limits.


Could you tell me why the network bandwidth limits can not work? Do network limits are managed in another way?
Thanks.

Below some information about my hypervisor:

root at ubuntu-04:~# virsh -V
Virsh command line tool of libvirt 1.3.1
See web site at http://libvirt.org/

Compiled with support for:
 Hypervisors: QEMU/KVM LXC UML Xen LibXL OpenVZ VMWare VirtualBox ESX Test
 Networking: Remote Network Bridging Interface netcf Nwfilter VirtualPort
 Storage: Dir Disk Filesystem SCSI Multipath iSCSI LVM RBD Sheepdog ZFS
 Miscellaneous: Daemon Nodedev AppArmor Secrets Debug Readline Modular

qemu version: 2.5.0

Thanks,

Netsurfed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20170615/91903641/attachment.htm>


More information about the libvirt-users mailing list