libvirt: Virt driver pinning guest vCPUs to host pCPUs (partial)

Registered by Daniel Berrange

This feature aims to improve the libvirt driver so that it is able to strictly
pin guest vCPUS to host pCPUs. This provides the concept of "dedicated CPU"
guest instances.

Blueprint information

Status:
Complete
Approver:
John Garbutt
Priority:
Low
Drafter:
Daniel Berrange
Direction:
Approved
Assignee:
Daniel Berrange
Definition:
Approved
Series goal:
Accepted for kilo
Implementation:
Implemented
Milestone target:
milestone icon 2015.1.0
Started by
Joe Gordon
Completed by
John Garbutt

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:virt-driver-cpu-pinning,n,z

Addressed by: https://review.openstack.org/93652
    Virt driver pinning guest vCPUs to host pCPUs

Gerrit topic: https://review.openstack.org/#q,topic:bp/virt-driver-numa-placement,n,z

Addressed by: https://review.openstack.org/99153
    libvirt: introduce separate class for cpu tune XML config

Addressed by: https://review.openstack.org/99154
    libvirt: add support for per-vCPU pinning in guest XML

Addressed by: https://review.openstack.org/99927
    libvirt: add helpers for parsing/formatting CPU range specs

Addressed by: https://review.openstack.org/105201
    virt: move get_cpuset_ids into nova.virt.hardware

Addressed by: https://review.openstack.org/105202
    virt: split CPU spec parsing code out into helper method

Addressed by: https://review.openstack.org/105203
    virt: add method for formatting CPU sets to strings

Addressed by: https://review.openstack.org/105204
    libvirt: convert cpuset XML handling to use set instead of string

Gerrit topic: https://review.openstack.org/#q,topic:virt-driver-guest-cpu-memory-placement-v5,n,z

All the above code seems to have merged, a quick read through the spec seems to suggest this is at least partially complete. Please document what proportion of functionality has merged here, and what is left for a future release. --johnthetubaguy 22nd August 2014

Ah, so nothing useful merged here it seemed, so this has missed juno now. Feature Proposal Freeze means this must not land in juno, because it appears like the code is not all currently ready to be reviewed. To be able to merge in kilo, we would first need to merge a kilo spec. More details on the exact process will be available on the ML shortly. --johnthetubaguy 22nd August 2014

Gerrit topic: https://review.openstack.org/#q,topic:bp/virt-driver-cpu-pinning,n,z

Addressed by: https://review.openstack.org/128738
    Add hardware CPU pinning types and pinning logic

Addressed by: https://review.openstack.org/129266
    Add NUMA support for CPU pinning logic

Addressed by: https://review.openstack.org/129326
    Add method for getting the CPU pinning constraint

Addressed by: https://review.openstack.org/129603
    Add cpu_pinning column to the compute_node table

Addressed by: https://review.openstack.org/129626
    Add cpu_pinning to instance_extra table

Addressed by: https://review.openstack.org/130490
    Add InstanceCPUPinning and related objects

Addressed by: https://review.openstack.org/130491
    Add cpu_pinning to Instance object.

Addressed by: https://review.openstack.org/130598
    libvirt: Add method for getting host cpu_pinning

Addressed by: https://review.openstack.org/131069
    Expose numa_topology to the resource tracker

Addressed by: https://review.openstack.org/131070
    Stash CPU policy related extra_spec in system_metadata

Addressed by: https://review.openstack.org/131210
    Hook CPU pinning checking into claims

(ndipanov 28.10.2014) - the spec is now merged http://git.openstack.org/cgit/openstack/nova-specs/tree/specs/kilo/approved/virt-driver-cpu-pinning.rst

Addressed by: https://review.openstack.org/131830
    Make hardware topology extraction hacks more general

Addressed by: https://review.openstack.org/131831
    Method for getting NUMA usage from an instance

Addressed by: https://review.openstack.org/132001
    Make resource tracker always use Flavor objects

Addressed by: https://review.openstack.org/132086
    Make resource tracker track CPU pinning usage

Addressed by: https://review.openstack.org/132295
    Make HostManager track CPU pinning usage

Addressed by: https://review.openstack.org/132296
    Add the CPUPinningFilter

Addressed by: https://review.openstack.org/132297
    Save insance CPU pinning after a successful claim

Addressed by: https://review.openstack.org/132557
    API boot process sets CPU pinning for instances

Addressed by: https://review.openstack.org/132655
    libvirt: Consider CPU pinning when booting

Addressed by: https://review.openstack.org/137809
    objects: Add DictOfBooleansField and ListOfSetsOfIntegersField

Addressed by: https://review.openstack.org/137810
    Add NUMACPUPinningCell object

Addressed by: https://review.openstack.org/137898
    Add InstanceNUMACPUPinningCell object

Addressed by: https://review.openstack.org/138100
    Add pinning to InstanceNUMATopology tests

Addressed by: https://review.openstack.org/138101
    Add methods for calculating CPU pinning

Addressed by: https://review.openstack.org/138493
    Add method for getting the CPU pinning constraint

Addressed by: https://review.openstack.org/138602
    Adds NUMA CPU Pinning object modeling

Addressed by: https://review.openstack.org/139134
    Add cpu pinning check to numa_fit_instance_to_host

Addressed by: https://review.openstack.org/139615
    Make numa_usage_from_instances consider CPU pinning

Addressed by: https://review.openstack.org/139668
    Make libvirt driver expose sibling info in NUMA topology

Addressed by: https://review.openstack.org/140021
    Make get_best_cpu_topology consider NUMA topology

Addressed by: https://review.openstack.org/140111
    libvirt: un-cruft _get_guest_numa_config

Addressed by: https://review.openstack.org/140357
    libvirt: Fix NUMA memnode assignments to host cells

Addressed by: https://review.openstack.org/140377
    libvirt: Consider CPU pinning when booting

Addressed by: https://review.openstack.org/140408
    Add method for getting the CPU pinning constraint

Seems like everything has merged, are we done now? --johnthetubaguy 17th December 2014
OK, there are patches left to review, moving to kilo-2 --johnthetubaguy 17th December 2014

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

Addressed by: https://review.openstack.org/194221
    Add virt-driver CPU thread pinning

Addressed by: https://review.openstack.org/194559
    trivial: Change file permissions for spec

Addressed by: https://review.openstack.org/241355
    Add virt-driver CPU thread pinning

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.