How to distribute the created virtual machines on the nodes in order to optimally utilize the equipment? VMmanager contains basic settings at the cluster level: you can create VMs one by one until all nodes are filled, or you can evenly fill all nodes with VMs. But this is not always enough, because it does not take into account the specifics of each server and the limitations of the provider.
Composite filters in VMmanager will help you distribute created VMs to nodes so as to optimally utilize different equipment. Here we will look into methods of working with them, as well as with the general distribution settings.
Example of VMmanager settings for optimal equipment utilization
Let us solve the problem of distributing VMs to nodes if the provider has the following conditions:
- there are Windows licenses for only one physical server;
- there is a server for large VMs. It has several expensive CPUs, lots of RAM and fast NVME disks connected;
- there are several servers with slow disks to create small virtual machines.
VMmanager allows to flexibly configure the distribution of VMs across cluster nodes. There is a special section for this in the general cluster and node settings. In it, you can choose a uniform or sequential distribution.
When VMs are distributed uniformly, they are created one by one on each node. In case of sequential distribution, VMs first completely fill the first node, and then are created on the next one.
These general distribution settings apply to all nodes in the cluster, except those that use their own policies. Next, I will go into more detail about the complex distribution policy settings that you can establish with composite filters.
How the VM distribution filters work on the node
VM distribution filters are set in the VM distribution settings on the node in the node card.
By default, VMs are created on any cluster node that has enough resources to create them.
For example, there are three nodes of 16 GB of RAM and 1 TB of disk space. If the first node has a total of 15 GB of RAM and 800 GB of disk, when creating a VM with 2 GB of RAM, the first node will be excluded and the VM will be created on the second or third node:
In VMmanager we can set additional filters:
- by OS tag;
- by VDS configurations;
- by RAM size;
- by vCPU count;
- by disk size.
How does it work? Let us add an OS tag filter to the second node: windows. In this case:
- when creating a VDS running on AlmaLinux 8, this node will be excluded;
- the first or third node will be used;
- when creating a VDS running on Windows Server 2019, this node will not be excluded;
- the first, second or third node will be used.
Schematically it can be represented as follows:
How to exclude the creation of VMs running on Windows on the first and third node?
By adding an OS tag filter to these nodes: !windows
The filters are combined with each other through the logical AND.
If the filter RAM>1G, vCPU>=2 is set on the node, then:
- when the (RAM 2G, 1 vCPU) VM is created, it will not be deployed on this node;
- when the (RAM 2G, 4 vCPU) VM is created, it will be deployed on this node.
You can specify comma separated conditions inside the filter. In this case the conditions are combined through a logical OR.
For example, the OS tags can be written as: freebsd, centos. This means that only CentOS or FreeBSD VDS will be deployed on this node.
What if VMs with RAM > 2G or with vCPU > 4 need to be created on the node?
For this, you need to use a “Composite filter” “cpu_number > 4 || ram_mib > 2048”. This is described in more detail in the documentation: working with VM distribution filters.
This way, the distribution filters in VMmanager allow you to flexibly manage your equipment and solve even the most complex tasks of assigning VMs to certain nodes. To try VMmanager, leave a request at our site - our consultants will answer all your questions and provide you with a trial version of VMmanager.