[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-discuss] Allow certain CPU cores for VMs
From: |
Aleksei |
Subject: |
Re: [Qemu-discuss] Allow certain CPU cores for VMs |
Date: |
Tue, 24 Oct 2017 23:27:37 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
libvirt has CPU pinning feature:
https://libvirt.org/formatdomain.html#elementsCPUAllocation
AFAIK this functionality is not available in QEMU itself, but can be
accomplished by scripting utilities like taskset.
You might also want to instruct the kernel not to do any work on the
cores you dedicate to VMs - look into kernel args isolcpus, nohz_full
and rcu_nocbs.
On 24/10/17 16:39, Martin Snowman wrote:
Hi,
is it possible to configure in qemu or libvirt to exclude certain cores
from VM deployment ?
Let's say we have 24 cores on hypervisor and I want to allocate first four
cores to openvswitch and use next 20 cores for QEMU VMs.
Is this configuration possible ? Whats the best approach.
Example of current Qemu VM:
/usr/bin/qemu-system-x86_64 -name one-76 -S -machine
pc-i440fx-wily,accel=kvm,usb=off -m 12288 -realtime mlock=off -smp
8,sockets=8,cores=1,threads=1 -uuid e1729682-f965-4810-aa3c-c2b7e5e717cb
-no-user-config -nodefaults -chardev
socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-one-76/monitor.sock,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown
-boot strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive
file=gluster://XXXX:24007/YYYY/76/disk.0,format=qcow2,if=none,id=drive-virtio-disk0,cache=none
-device
virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
-drive
file=/ZZZZ/76/disk.1,format=raw,if=none,id=drive-ide0-0-0,readonly=on
-device ide-cd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -netdev
tap,fd=30,id=hostnet0 -device
rtl8139,netdev=hostnet0,id=net0,mac=02:00:0a:00:65:0b,bus=pci.0,addr=0x3
-netdev tap,fd=44,id=hostnet1 -device
rtl8139,netdev=hostnet1,id=net1,mac=02:00:0a:00:6e:6f,bus=pci.0,addr=0x4
-vnc 0.0.0.0:76 -device cirrus-vga,id=video0,bus=pci.0,addr=0x2 -device
virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6 -msg timestamp=on
Thanks for replies in advance.
BR,
Martin
--
/--Regards, Aleksei/