How to connect a VM to a specific processor core through Numa?

sbin

New Member
Jan 4, 2020
4
0
1
43
Hi,

When starting VM error:
Code:
qm start 100

kvm: -numa node,nodeid=1,cpus=1,memdev=ram-node1: CPU index (1) should be smaller than maxcpus (1)
start failed: QEMU exited with code 1

How can this problem be solved? How to assign the necessary cores to VM?

configuration VM:
Code:
balloon: 0
bootdisk: scsi0
cores: 1
ide2: none,media=cdrom
memory: 1024
name: eeee1
numa: 1
numa1: cpus=1,hostnodes=1,memory=1024,policy=bind
ostype: l26
scsi0: VMS:vm-100-disk-0,size=9G
scsihw: virtio-scsi-pci
smbios1: uuid=ceb5befb-d88b-4760-aadc-d3d817e99d5b
sockets: 1
vcpus: 1
vmgenid: b38eff65-ea85-4e45-a87c-be5af2f46a55

Thank you.
 
For example, if I run the VM with the settings:
balloon: 0
bootdisk: scsi0
cores: 1
ide2: none,media=cdrom
memory: 1024
name: eeee1
numa: 1
numa0: nodeid=0,cpus=2,hostnodes=0,memory=1024,policy=bind
ostype: l26
scsi0: VMS:vm-100-disk-0,size=9G
scsihw: virtio-scsi-pci
smbios1: uuid=ceb5befb-d88b-4760-aadc-d3d817e99d5b
sockets: 1
vcpus: 1
vmgenid: b38eff65-ea85-4e45-a87c-be5af2f46a55

Before starting the VM:
Code:
root@pv1:~# numactl -H
available: 2 nodes (0-1)
node 0 cpus: 0 2 4 6 8 10 12 14
node 0 size: 12017 MB
node 0 free: 11078 MB
node 1 cpus: 1 3 5 7 9 11 13 15
node 1 size: 12067 MB
node 1 free: 10613 MB
node distances:
node   0   1
  0:  10  20
  1:  20  1

###
Code:
root@pv1:~# qm start 100
vm 100 - unable to parse value of 'numa0' - format error
nodeid: property is not defined in schema and the schema does not allow additional properties


after starting the VM:
root@pv1:~# numactl -H
available: 2 nodes (0-1)
node 0 cpus: 0 2 4 6 8 10 12 14
node 0 size: 12017 MB
node 0 free: 11039 MB
node 1 cpus: 1 3 5 7 9 11 13 15
node 1 size: 12067 MB
node 1 free: 10266 MB
node distances:
node 0 1
0: 10 20
1: 20 10

root@pv1:~# qm list
vm 100 - unable to parse value of 'numa0' - format error
nodeid: property is not defined in schema and the schema does not allow additional properties
VMID NAME STATUS MEM(MB) BOOTDISK(GB) PID
100 eeee1 running 1024 9.00 9421
root@pv1:~#
root@pv1:~#
root@pv1:~# numastat -c 9421

Per-node process memory usage (in MBs) for PID 9421 (kvm)
Node 0 Node 1 Total
------ ------ -----
Huge 0 0 0
Heap 0 0 0
Stack 0 1 1
Private 15 303 318
------- ------ ------ -----
Total 15 304 319
root@pv1:~#

running VM state:
Code:
root@pv1:~# ps aux | grep 9421
.....
-smp 1,sockets=1,cores=1,maxcpus=1 -nodefaults -boot menu=on,....
-cpu kvm64,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,enforce -m 1024
-object memory-backend-ram,id=ram-node0,size=1024M -numa node,nodeid=0,cpus=0,memdev=ram-node0
....

The VM was attached to NODE0 and CPU # 2, but the VM uses RAM from NODE1.
From this we can conclude that Numa does not work correctly or does not work at all.

If I made the settings incorrectly, then tell me how to fix the CPU and memory to the desired node?
 
Last edited:
If I specify any cpus in the VM configuration, then proxmox in any case uses only cpus0
This can be seen from the post above.
 
Hello
We are having the same issue as sbin
our numa configuration line is :

numa0: cpus=0;1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;40;41;42;43;44;45;46;47;48;49;50;51;52;53;54;55;56;57;58;59,hostnodes=0,memory=40960,policy=bind

which is what is described in the documentation.

We are also getting the
vm 100 - unable to parse value of 'numa0' - format error


Thanks
 
please post the complete vm config (qm config ID) and the error on start (qm start ID)
 
Hello

Configuration:
bootdisk: scsi0
cores: 40
cpu: host
ide2: none,media=cdrom
memory: 40960
name: osl-pi1-wrk20a
net0: virtio=C2:8B:A3:29:7B:A8,bridge=vmbr10,firewall=1
numa: 1
numa0: cpus=20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36;37;38;39;60;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79,hostnodes=1,memory=40960,policy=bind
ostype: l26
scsi0: r1-pool:vm-100-disk-0,backup=0,size=50000M
scsihw: virtio-scsi-pci
smbios1: uuid=553a5e55-b812-4723-af72-ee77902932dd
sockets: 1
unused0: local:100/vm-100-disk-0.qcow2
vmgenid: aff0af2a-bab3-409e-9a0b-c4ecf16c27dc

Error:
Feb 28 09:31:49 osl-host36 qmeventd[2317]: vm 101 - unable to parse value of 'numa0' - format error

Doc:
numa[n]: cpus= [,hostnodes=] [,memory=] [,policy=] NUMA topology.
cpus= CPUs accessing this NUMA node.
hostnodes= Host NUMA nodes to use.
memory= Amount of memory this NUMA node provides.
policy= NUMA allocation policy.
 
Last edited:
I tried to allocate cores to a VM (16 of 24) as well. The VM starts and everything is running. BUT if I run a stress test on the VM for 16 cores then it will utilize all 24 cores of the host to ~70 %. Even if I stress only one core the thread is spread over all 24 cores on Proxmox.

Code:
cores: 8
cpu: host
sockets: 2
memory: 16384
numa: 1
numa0: cpus=0;2;4;6;8;10;12,hostnodes=0,memory=8192,policy=bind
numa1: cpus=1;3;5;7;9;11;13;15,hostnodes=1,memory=8192,policy=bind

Code:
numactl -H
available: 2 nodes (0-1)
node 0 cpus: 0 2 4 6 8 10 12 14 16 18 20 22
node 0 size: 72548 MB
node 0 free: 47012 MB
node 1 cpus: 1 3 5 7 9 11 13 15 17 19 21 23
node 1 size: 72553 MB
node 1 free: 43520 MB
node distances:
node   0   1
  0:  10  20
  1:  20  10
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!