WANG Cheng D
2017-Feb-03 08:03 UTC
[libvirt-users] How to pin an libvirt lxc to a specific physical CPU core in openstack?
Dear all, In my applications, the real-time performance is very important, so I used 4 containers, with only one application running in each container and a physical CPU core is only dedicated to one lxc. and I must know which container is hosted by which CPU core. That is, I need to pin a specific lxc to a specific CPU core. I can achieve this in a native linux system by the following xml script (to pin a libvirt lxc to core #3 of a machine). It works fine. <vcpu placement='static' cpuset='3'>1</vcpu> Now I want to realize this on openstack platform, I carefully read the instruction on CPU pinning in nova and found that openstack flavor can only support pinning an lxc(instance) onto a set of CPU cores. I cannot allocate a specific pCPU to an lxc. After the lxc is started, "dumpxml" only shows the following statement, I even don't know to which CPU core the lxc is pinned. <vcpu placement='static' >1</vcpu> I tried to edit the libvirt.xml for the lxc which locates at nova/instances/#INSTANCE ID#/libvirt.xml and manually inserted cpuset='3', but this didn't take effect. After the lxc is restarted, the libvirt.xml is recovered and the modification was not there anymore. I googled the question on Internet, but no solution was found. I hope the libvirt people can help me on this. Thank you in advance. Cheng
Reasonably Related Threads
- [LXC][Openstack] Clarifications needed on usage of libvirt-lxc for openstack
- OpenStack+libvirt+lxc: lxcContainerGetSubtree:1199 : Failed to read /proc/mounts
- libvirt with lxc: internal error The 'cpuacct', 'devices' & 'memory' cgroups controllers must be mounted
- libvirt on OpenStack
- How can openstack retrieve the CPU usage of a lxc via libvirt?