Add cpu caps in the ImageMetaProps class

Registered by jichenjc

hw_cpu_policy is now enabled as enum field, dedicated and shared are allowed value for this field
some hypervisors like virtual box (and others) support caps definition
https://www.virtualbox.org/manual/ch03.html
we can support this in nova as well

so the proposal is to add hw_cpu_cap into ImageMetaProps of nova objects, so whenever user need to set value for the cap of the instance (that is the priority of the instance), user can either specify
the value in flavor (extra_specs:cpu_cap) or in the image property. Then the instance will be scheduled accordingly.

some virtualization tools like libvirt can set this
https://libvirt.org/formatdomain.html#elementsCPUTuning on the share field

This is more like a 'pet' model instead of 'cattle' model, but to some desired users, it's helpful

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
jichenjc
Direction:
Needs approval
Assignee:
jichenjc
Definition:
Superseded
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
John Garbutt

Related branches

Sprints

Whiteboard

Add the field into image property and objects and also in the flavor extra spec support.

Add the utilized method for libvirt and other potential hypervisor drivers.

Are you sure this is not already implemented here: https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L3588 --johnthetubaguy 20151201

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.