Actually there already is a filter in Nova scheduler that does almost exactly that (except those extra 2 MiB) - ExactDiskFilter [1].
Moreover, it is included in default set of filters for IronicHostManager [2], but devstack (and probably others) do not use these default filters by default (sic) [3]
So probably the solution would be to update the ExactDiskFilter to account for extra 2MB (or create a modified variant of it) and start actually using it in scheduler filters.
Actually there already is a filter in Nova scheduler that does almost exactly that (except those extra 2 MiB) - ExactDiskFilter [1].
Moreover, it is included in default set of filters for IronicHostManager [2], but devstack (and probably others) do not use these default filters by default (sic) [3]
So probably the solution would be to update the ExactDiskFilter to account for extra 2MB (or create a modified variant of it) and start actually using it in scheduler filters.
[1] https:/ /github. com/openstack/ nova/blob/ master/ nova/scheduler/ filters/ exact_disk_ filter. py#L23 /github. com/openstack/ nova/blob/ master/ nova/scheduler/ ironic_ host_manager. py#L39 /github. com/openstack/ nova/blob/ master/ nova/scheduler/ ironic_ host_manager. py#L45
[2] https:/
[3] https:/