A new set of enhancements for the virtualization stack of OpenNebula is coming with 5.10. Virtual Machines are now able to be deployed with a fine-tailored compute resources topology, gaining performance and security benefits. Most of the enhancements are applied to KVM, however LXD is getting minor updates as well.
- A VM will now allow for a fine-grained CPU topology by specifying the cores per socket, threads per core and sockets.
- A new NUMA-aware scheduler will be available for pinning VM onto a host-specific NUMA node, cores or CPU threads, according to different policies.
- Hugepages can be used to improve the performance on VMs.
Setting up the virtualization nodes
Hosts will now have an extra field. In order to be able to use the new features, you’ll need to update the PIN_POLICY attribute to “Pinned”.
The VM Scheduler is being updated as well and, when a host is marked as Pinned, it will only be used by VM templates with an advanced compute resources topology. Also every core and NUMA node is a resource upon which the tuned VMs can be deployed.
Testing the new features…
We will create a VM with CPU pinning and hugepages. First you will need to enable hugepages on your OS. In this case we will use Ubuntu 18.04. The VM will have 2 sockets, 2 cores and 2 threads per core.
These are the template attributes for the VM:
Once the VM is running, we’ll be able to check the allocation in the host, in this case the virtual node 0 of the VM has been pinned in the host node 0 (CPUs 0, 16, 1 and 17); and the virtual node 1 to the physical NUMA node 1 (CPUs 8, 24, 9 and 25).
Also, take a look at the memory being halved for each node and being allocated from the available hugepages in the hypervisor.
root@numa:~# cat /proc/meminfo | grep Huge
AnonHugePages: 0 kB
ShmemHugePages: 0 kB
Hugepagesize: 2048 kB