[nova] custom metric for weigh scheduling

Arnaud Morin arnaud.morin at gmail.com
Tue Jun 21 09:50:01 UTC 2022


Hey nova team,

Some context:
I want nova-scheduler to favor instances on some computes based on some
hypervisor metrics/traits.
E.G.
I have 2 hypervisors hosting few instances.
One of them is having an old kernel, that I will upgrade some day.
The second is already having the correct target kernel.

I want the scheduler to favor booting on the second host (good kernel).

How can I achieve that without disabling the bad_kernel hypervisor?

I was thinking about something in the weight scheduler.

I was first thinking about using placement traits (having a custom
traits) and reading traits from a weight scheduler.
But it seems not doable out of the box.
And it also seems not a good idea at all to call placement API from
weight scheduler. Maybe I am missing something here because I was
expecting to have the traits given by placement up to the nova
scheduler.

Second shoot, I found the metrics weight [1] which rely on the compute
monitors.
It seems less hacky, but I will still have to write custom monitor to
retrieve such metrics.

Am I missing an option here?
Is there anyone doing such thing is the community?

[1] https://github.com/openstack/nova/blob/master/nova/scheduler/weights/metrics.py
[2] https://github.com/openstack/nova/tree/master/nova/compute/monitors


Cheers,
Arnaud.



More information about the openstack-discuss mailing list