add vcpupin to cputune for instances

Registered by wangpan

currently the instances can use all of the pcpu of compute node, the host may become slowly when vcpus of instances are busy, so we need to pin vcpus to the specific pcpus of host instead of all pcpus.
the vcpu xml conf of libvirt will change to like this:
<vcpu cpuset="4-12,^5,15">1</vcpu>

DocImpact:
1. add a new config entry 'vcpu_pin_set' to nova.conf, which will add 'cpuset' attribute to XML config file of libvirt, for example: <vcpu cpuset="4-12,^5,15">1</vcpu>,
this will force the vcpus of instances only using the pcpus assigned by 'vcpu_pin_set',
see http://libvirt.org/formatdomain.html#elementsCPUAllocation for more details.
2. also affect the total vcpus of compute host can be saw by scheduler, the scheduler only sees the pcpus assigned by 'vcpu_pin_set'.
3. cache the total vcpus of compute host in nova-compute process.

Blueprint information

Status:
Complete
Approver:
Russell Bryant
Priority:
Undefined
Drafter:
wangpan
Direction:
Needs approval
Assignee:
wangpan
Definition:
Discussion
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Mark McLoughlin
Completed by
wangpan

Related branches

Sprints

Whiteboard

we has test the performance of instances under KVM between pin-vcpu and not-pin, the performance of pin-vcpu is better than not-pin about 20%, because several pcpus can be reserved to the host by pin-vcpu to specific pcpus, and the host can use them to do tasks of himself.

Gerrit topic: https://review.openstack.org/#q,topic:bp/instance-vcpu-pin,n,z

Addressed by: https://review.openstack.org/26363
    Add cpuset attr to vcpu conf in libvirt xml

Gerrit topic: https://review.openstack.org/#q,topic:bp/page,n,z

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.