[libvirt-users] How to pin an libvirt lxc to a specific physical CPU core in openstack?

WANG Cheng D Cheng.d.Wang at alcatel-sbell.com.cn
Fri Feb 3 08:03:40 UTC 2017


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20170203/9f0b2351/attachment.htm>


More information about the libvirt-users mailing list