Image Metadata Properties weigher

Registered by Sylvain Bauza

This blueprint proposes adding a new weigher that will pack/spread instances based on th image properties requested by the instance and the image properties of existing instances on individual hosts.

A typical usecase is for Windows guests. Given the bill would be huge if we spread all the Windows instances into multiple nodes, we usually say that the admin should use aggregates and the AggregateImagePropertiesIsolation filter.
That said, the concern is that in general admins don't really know how many nodes they should be using for the Windows instances, and if they provide more than it needs, these nodes wouldn't be used.

That's why, instead of using this filter and asking operators to create aggregates, we would rather like to create a specific ImageMetadataPropsWeigher for looking at how many instances have a specific prop and then operators could use it for that case or for something else (like packing instances by machine types) as the HostState already knows the other existing instances and their related image.

Blueprint information

Status:
Complete
Approver:
Sylvain Bauza
Priority:
Undefined
Drafter:
Sylvain Bauza
Direction:
Approved
Assignee:
Sylvain Bauza
Definition:
Approved
Series goal:
Accepted for 2025.1
Implementation:
Implemented
Milestone target:
None
Started by
Sylvain Bauza
Completed by
Sylvain Bauza

Related branches

Sprints

Whiteboard

sean(2025-01-06): i would suggest that we implement this by looking at the set of all distinct image properties currently in use by instances on a host + the distinct requested image properties "total_prop" and then take the intersection of the request props and the current properties "common_props" and define the return value of the weiehr as "common_props / total_props"

total_props is just the the union of all image properties for all instance on the current host "existing_props" + the requested properties fo the current instnace form the request spec.

common_props is just the intersection of the the props form the request spec with existing_props.

that pretty simple to compute form a perfroamce point fo view as we should already have all that info in memory in the host_state object + request spec so i would expect no additional db look ups.

so while this wont be the cheapest weigher i don't expect it to be excessively expensive.

if we default the multiplier to 0.0 so that it has no effect by default it would have no upgrade impact and operators can use a negitive/positive multiplier to opt in

common_props divided by total naturally packs.

if we agree this ^ design in general i think we could proceed with this as a specless blueprint.

(gibi)[2025-01-07]: "total_props is just the the union of all image properties for all instance on the current host" Is this something that we need to now collect and put it into the host state?

[20250107 bauzas] Approved as specless during today's meeting

Gerrit topic: https://review.opendev.org/#/q/topic:bp/image-metadata-props-weigher

Addressed by: https://review.opendev.org/c/openstack/nova/+/940642
    Add a new ImagePropertiesWeigher

Addressed by: https://review.opendev.org/c/openstack/nova/+/941601
    per-property ImageMetaPropsWeigher

Addressed by: https://review.opendev.org/c/openstack/nova/+/942214
    Add fill_metadata() to InstanceList

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.