O'Reilly logo

KVM Virtualization Cookbook by Konstantin Ivanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

To enable a KVM virtual machine to run on a given NUMA node and CPU using the strict NUMA policy, perform the following steps:

  1. Install the numactl package and check the hardware configuration of the hypervisor:
root@kvm:~# apt-get install numactl...root@kvm:~# numactl --hardwareavailable: 2 nodes (0-1)node 0 cpus: 0 1 2 3 4 5 6 7 8 9 20 21 22 23 24 25 26 27 28 29node 0 size: 64317 MBnode 0 free: 3173 MBnode 1 cpus: 10 11 12 13 14 15 16 17 18 19 30 31 32 33 34 35 36 37 38 39node 1 size: 64509 MBnode 1 free: 31401 MBnode distances:node 0 1 0: 10 21 1: 21 10root@kvm:~#
  1. Display the current NUMA placement for the KVM guest:
root@kvm:~# numastat -c kvm1Per-node process memory usage (in MBs) for PID 22395 (qemu-system-x86) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required