VMmanager Knowledge Base
en En
es Es

How to limit VM bandwidth when traffic threshold is exceeded?

This article contains instructions on how to limit the bandwidth (incoming and outgoing traffic speeds) of a virtual machine (VM) exceeds its traffic consumption. 

The pmvmmgr6 module in BILLmanager allows you to restrict the traffic speed of virtual servers ordered in VMmanager 6. This feature is available starting from BILLmanager 6.123. For more details, see the Limiting speed in case of overage article in the BILLmanager 6 documentation. 

On the VMmanager 6 side, you can implement this functionality using a Python script. The script remotely connects to the platform and adjusts the settings of VMs that have exceeded their traffic limit.

Scripts requirements

  • The script can run on any server that has access to the platform using the HTTPS protocol.
  • To run the script, you will need to specify the platform administrator's e-mail and password.
  • For the script to run, an SSL certificate must be connected to the domain name of the platform.

Setting restrictions

To set the limits for the bandwidth of the channel:

  1. Prepare the environment for running Python scripts. See the official Python documentation for details.
  2. Create a python script called limits.py

    Script content
  3. Run the script:

    python3 limits.py --url <platform_url> --email <admin_email> --password <admin_pass> --vmid <vm_id> --threshold-gib <threshold> --limit-mbitps <limit>
    Comments to the command
The article was last updated on 07.28.2025. The article was prepared by technical writers of ISPsystem