Why Windows10 VM is slow on OpenStack?

Updated on April 12, 2022

Before we proceed, please read Why does Windows 10 VM show 100% CPU utilization always on QEMU-KVM? The same issue holds for Windows10 VM on OpenStack making it slow and using 100% CPU utilization always. This article shows how to configure OpenStack to run Windows10 VM on a multicore processor utilizing all the cores per CPU.

Setup Info

KVM Version: 2.12.0

Guest OS: Windows10 Home

HOST CPU: AMD Opteron(TM) Processor 6128 with

  • CPU model: x86_64
  • CPU(s): 16
  • CPU frequency: 2000 MHz
  • CPU socket(s): 1
  • Core(s) per socket: 4
  • Thread(s) per core: 1
  • NUMA cell(s): 4
  • Memory size: 65771872 KiB

How to configure OpenStack to run Windows10 VM on a multicore processor

Modern server CPUs as above use NUMA (Non-Uniform Memory Access) architecture. The below image shows the comparison of UMA with NUMA. NUMA architecture provides separate memory for each processor (unlike UMA, where all processors access shared memory through a bus). At the same time, a processor can access memory that belongs to other processors by using a shared bus. A CPU has the performance advantage of accessing its own local memory faster than other memory on a multiprocessor.

Comparison of UMA and NUMA Architecture CPUs

PIC Courtesy: www.nakivo.com

When running VMs on NUMA hosts as shown in the below image, it is important that the vCPUs executing processes are on the same NUMA node as the memory used by these processes. This ensures all memory accesses are local to the node and thus do not consume the limited cross-node memory bandwidth, adding latency to memory accesses.

configure OpenStack Windows10 VM

OpenStack’s configuration of NUMA topology and CPU pinning features provides high-level control over how instances run on hypervisor CPUs and the topology of virtual CPUs available to instances.

How to configure flavors with NUMA node placement & Topology

With the below configuration, libvirt driver will be able to do intelligent CPU/CORES placement for guests. This will increase the effective utilization of computing resources and decrease latency by avoiding cross-node memory accesses by guests. To support the specification of the topology, you need to add extra specs to the flavor. Openstack allows defining the CPU topology of the processors in the Virtual Machine using properties.

$ openstack flavor set FLAVOR-NAME \
    --property hw:cpu_sockets=FLAVOR-SOCKETS \
    --property hw:cpu_cores=FLAVOR-CORES \
    --property hw:cpu_threads=FLAVOR-THREADS \

Where:

  • FLAVOR-SOCKETS:  (integer) The number of sockets for the guest VM. By default, this is set to the number of vCPUs requested.
  • FLAVOR-CORES: (integer) The number of cores per socket for the guest VM. By default, this is set to 1.
  • FLAVOR-THREADS: (integer) The number of threads per core for the guest VM. By default, this is set to 1.
Never Configure higher no. of Cores on each VM

Never configure a higher number of virtual cores on each VM than the number of real cores available on the host computer.

For my topology, below is the flavor set:

$ openstack flavor set Windows10 \
    --property hw:cpu_sockets=1 \
    --property hw:cpu_cores=4 \
    --property hw:cpu_threads=1 \

 

Was this article helpful?

Related Articles

Leave a Comment