proxmoxVE Traffic Accounting

Phinitris

Active Member
Jun 1, 2014
83
12
28
Hello,
Proxmox VE lacks on traffic accounting support and the ability to limit OpenVZ Containers.

That's why I thought, go with SolusVM or maybe you can do that yourself? Why has Proxmox not already done so?
I love OpenSource Projects so I stood with Proxmox.

So I developed my own Traffic Accounting and Limitation solution.

Features:
-
KVM Traffic Accounting(NAT mode not tested, may not work)
- OpenVZ Traffic Accounting(Bridged mode not tested, may not work)
- KVM Limitation on the fly(Change Network speed while KVM is running)
- OpenVZ Network Limitation(You can set a network speed rate as you already know it from VMs(KVM))
- Automatically reset the traffic on a given date to 0(e.g. every month on the 15th) - Date can be set
- Automatically limit the VM/Container when it exceeds a defined bandwidth limit (e.g. Normal Network speed: 125MB/s ; After exceeding 1TB traffic limit to 20MB/s)

All these features are integrated with WHMCS. I only developed the API part. You can not administrate these settings via the Proxmox GUI.
There were some traffic calculation bugs, but seems to be fixed. I did not really stress tested it.

Currently I'm just taking the netin and netout values of the container, storing them in the pmxcfs filesystem and calculating traffic every 5 minutes.
Also every 5 minutes new limits will be applied.

So, every 5 minutes, for each VM a /etc/pve/[openvz/qemu-server]/VMID.conf like file will be read and written. Seems to work fine and doesn't lead to problems on a 500 VMs cluster.

For now, I won't make the code public accessibly because it could lead to more confusion. My Git Repository is not compatible with the official Proxmox branch, because I also implemented many other functions like:
- Reinstall an OpenVZ Container (Integrated in GUI)
- ISO Upload for customers(KVM) / also integrated into WHMCS
- Set CPU Limit for KVM and OpenVZ Containers (e.g. Host CPU has 3.6 Ghz and you can limit the vCores of a VM/CT to 800 Mhz)
- NoVNC Console as a own Service - Currently running on Port 3129 so we can block the GUI (8006) for customers and use WHMCS for administration
- TUN/TAP can be enabled/disabled in an OpenVZ Container via API
- FUSE can be enabled/disabled in an OpenVZ Container via API
- Root password of an OpenVZ Container can be changed via API
- Fixed: extended attributes of an OpenVZ Container are set(i) and so the files cannot be deleted / You first need to do a chattr -ia -R /var/lib/vz/private/... before removing that container

I think Traffic accounting is an important feature that is really wanted by users of Proxmox VE and i don't understand why you didn't implemented that yet. Hope to get a response of a Proxmox developer about that.

If anyone would give some advice, would like to discuss some more things or review code, I would be very thankful.

Best regards
Henry
 
Hey,
sure. You can contact me on my business address <henry@myvirtualserver.de>

Best regards,
Henry
 
Do you make your solution for that feature open for all?
I am looking to for a feature for traffic accounting like 100 gb per month.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!