-
-
Save nde1/41c1f42f5560599d271fd726726f8921 to your computer and use it in GitHub Desktop.
Script for limiting SmartOS zones bandwidth.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# | |
# Script should be run in GZ. | |
# | |
# example: | |
# ./add-flow-to-vm.sh c480b89f-f8a1-41b1-abd0-45bac4685cb2 15M | |
# | |
# It will add TCP/UDP flows for this particular VM, and limits bandwidth to 15Mbps | |
# | |
VM_UUID=$1 | |
MAXBW=$2 | |
for next in `vmadm get $VM_UUID | grep interface | awk -F\" '{ print $4 }'` | |
do | |
flowadm add-flow -l $next -z $VM_UUID -a transport=tcp -p maxbw=$MAXBW $VM_UUID-$next-tcp | |
flowadm add-flow -l $next -z $VM_UUID -a transport=udp -p maxbw=$MAXBW $VM_UUID-$next-udp | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment