Ask Your Question

How to do Openstack JUNO cpu pinning?

asked 2015-12-07 19:43:41 -0500

satish.lx gravatar image

updated 2015-12-09 12:16:17 -0500

I have install JUNO RDO version of Openstack. but my instance giving me very poor performance. I am looking for some dedicated CPU setting so my instance grab physical CPU. How do i configure Openstack so it will do cpu pinning.

I was also reading about NUMA also, not sure what i need to do in order to do CPU pinning. Help me folks


[root@compute-1 ]# numactl --hardware
available: 2 nodes (0-1)
node 0 cpus: 0 1 2 3
node 0 size: 16349 MB
node 0 free: 3906 MB
node 1 cpus: 4 5 6 7
node 1 size: 16383 MB
node 1 free: 14929 MB
node distances:
node   0   1
  0:  10  20
  1:  20  10



I did following to enable pinning

nova aggregate-details cpu_pinning
nova aggregate-set-metadata 3 pinned=true
nova flavor-create pinned.medium 8 2048 20 2
nova flavor-key 8 set "hw:cpu_policy"="dedicated"
nova flavor-key 8 set "aggregate_instance_extra_specs:pinned"="true"
nova aggregate-add-host 3 <compute-node-1>

Start VM

nova boot --image e4e0e7cf-a33a-4b38-bf5c-1a1f5af54e03 --nic net-id=f6276312-b604-40a1-94f8-c6e6ac30fac6 --flavor 8 test_pinning


[root@compute-1]# virsh dumpxml instance-0000003e | grep placement
  <vcpu placement='static' cpuset='2-3'>2</vcpu>

But if i grep vcpupin, got nothing..

[root@compute-1]# virsh dumpxml instance-0000003e | grep vcpupin

But if i do following it works! not sure this is right way to do

virsh vcpupin instance-0000003e 0 2
virsh vcpupin instance-0000003e 1 3

Lets check now.. WTF... what i am missing..

 [root@compute-1]# virsh dumpxml instance-0000003e | grep vcpupin
        <vcpupin vcpu='0' cpuset='2'/>
        <vcpupin vcpu='1' cpuset='3'/>

OS info:

[root@compute-1]# uname -a
Linux 3.10.0-229.20.1.el7.x86_64 #1 SMP Tue Nov 3 19:10:07 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

[root@compute-1]# rpm -qa \*qemu-kvm\*

CPU info:

[root@compute-1]# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    1
Core(s) per socket:    4
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 62
Model name:            Intel(R) Xeon(R) CPU E5-2609 v2 @ 2.50GHz
Stepping:              4
CPU MHz:               2500.000
BogoMIPS:              4997.60
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              10240K
NUMA node0 CPU(s):     0-3
NUMA node1 CPU(s):     4-7
edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted

answered 2015-12-08 00:49:23 -0500

dbaxps gravatar image

updated 2015-12-09 10:57:33 -0500


    You need upgrade up to qemu-kvm-ev-2.1.2-23.el7.1
    Reread [2] one more time it was told in the  header of my post

edit flag offensive delete link more


I have already followed that document and interesting thing, in VM xml dump i can see <vcpu placement='static'>2</vcpu> but i can't see <vcpupin vcpu='0' cpuset='2'/> line. Do you know why i can't see vcpupin_vcpu ?

satish.lx gravatar imagesatish.lx ( 2015-12-09 09:20:18 -0500 )edit

Which OS are you running ?
What reports rpm -qa \*qemu-kvm\* ?

dbaxps gravatar imagedbaxps ( 2015-12-09 10:00:35 -0500 )edit

CPU Model installed ?

dbaxps gravatar imagedbaxps ( 2015-12-09 10:02:06 -0500 )edit

I am running CentOS7.1 Linux [root@compute-1 ]# rpm -qa \*qemu-kvm\* qemu-kvm-1.5.3-86.el7_1.8.x86_64 qemu-kvm-common-1.5.3-86.el7_1.8.x86_64

satish.lx gravatar imagesatish.lx ( 2015-12-09 10:32:54 -0500 )edit

model name : Intel(R) Xeon(R) CPU E5-2609 v2 @ 2.50GHz

satish.lx gravatar imagesatish.lx ( 2015-12-09 10:34:36 -0500 )edit

answered 2015-12-09 05:09:02 -0500

Prateek K gravatar image

updated 2015-12-09 05:10:02 -0500

Before going to advance features such as cpu pinning I would recommend you to check the following on the setup.

  1. The compute node on which the instance is running is using which hypervisor(QEMU or KVM) ?
  2. QEMU runs as a process and is suitable only for testing and simulation purpose, Change the type to kvm in that case. you have to change the libvirt_type variable in nova.conf file of the compute node and restart compute service.

  3. If you already have a KVM hypervisor running then its a different case and then we need to focus on Hardware config, throughput that you want from the VM and features such as CPU pinning.

Also note that for KVM hypervisor to work the CPU should support virtualization technology. This can be checked by seeing the cpu flags

edit flag offensive delete link more


I am using KVM and i have VT CPU support, Now i am looking for pinning CPU so my VM use 100% of CPU core instead or share with other VM. my application is CPU intensive, i don't care about Memory I have enabled vcpu_pin_set in nova.conf and edit flavor to use pin but no luck.

satish.lx gravatar imagesatish.lx ( 2015-12-09 09:10:36 -0500 )edit

answered 2015-12-09 02:20:30 -0500

RHK gravatar image
edit flag offensive delete link more


I have tried vcpu_pin_set=2,3,6,7 in compute nova.conf file and adjust flavor to pin cpu, but in VM xml file i can't see its doing any thing to do CPU pin :( is there any thing else i need to do except nova.conf

satish.lx gravatar imagesatish.lx ( 2015-12-09 09:14:18 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-12-07 19:43:41 -0500

Seen: 967 times

Last updated: Dec 09 '15