Limited Bandwidth / Speed Cap on VM is Easy!

By admin, June 4, 2011 10:46 pm

In order to prevent some abusive clients using all the bandwidth you’ve got, we need to have some kind of capping ability, it was done on our physical switch before, but since we are moving everything into virtual world, we now have a much better and flexible weapon on ESX 4.1. Btw, I don’t know why VMware got rid of the nice traffic shaping capability on individual VM like in the old days (ESX 2.5).

The step is actually very simple, just create a bunch of speed limit/capping port groups, I named them External – 1Mbps, External – 2Mbps, etc, setup VLAN or not is according to your own environment. Then go to each port group, click Traffic Shaping, then Enable, that’s it!

For example, you want to limit a VM with 1Mbps, what you need to set is 1000kbps for Average, 1000kbps for Peak (this eventually makes zero room for burst), 1 Byte for Burst if you like.

You may have more fun with Peak and Burst Size, for example, you can set Average to 500kbps (ie, 0.5Mbps), then you can give 1000kbps for Peak and 8000 Bytes for Burst, this means you actually allow the VM to go up to 1Mbps at peak in step of 64kbps burst size (ie, 64kbps, then burst adds up to 128kbps, then 256kbps until reaching the total peak of 1Mbps from the average 0.5Mbps)

Since the traffic shaping policy applies to each individual vNIC connecting to the same Port Group, this means if you have two vNICs on the same VM, then this VM will get TWICE the capped bandwidth than a VM with only one vNIC.

Finally, the traffic shaping is only for outbound only, if you need inbound, then you need to use vDS and in that sense you need to have Enterprise Plus version.

Leave a Reply