[openstack-dev] [Openstack-operators] [nova] Default scheduler filters survey
mgagne at calavera.ca
Tue May 1 14:35:13 UTC 2018
On Tue, May 1, 2018 at 4:30 AM, Dave Holland <dh3 at sanger.ac.uk> wrote:
> On Mon, Apr 30, 2018 at 12:41:21PM -0400, Mathieu Gagné wrote:
>> Weighers for baremetal cells:
>> * ReservedHostForTenantWeigher 
>>  Used to favor reserved host over non-reserved ones based on project.
> Hello Mathieu,
> we are considering writing something like this, for virtual machines not
> for baremetal. Our use case is that a project buying some compute
> hardware is happy for others to use it, but when the compute "owner"
> wants sole use of it, other projects' instances must be migrated off or
> killed; a scheduler weigher like this might help us to minimise the
> number of instances needing migration or termination at that point.
> Would you be willing to share your source code please?
I'm not sure how battle-tested this code is to be honest but here it is:
I had to merge 2 files in one (the weigher and the conf) so I'm not
sure if it still works but I think you will get the idea.
To use it, you need to define the "reserved_for_tenant_id" Ironic node
property with the project ID to reserve it. (through Ironic API)
This code also assumes you already filtered out hosts which are
reserved for a different tenant. I included that code in the gist too.
On a side note, our technicians generally use the forced host feature
of Nova to target specific Ironic nodes:
But if the customer buys and reserves some machines, he should get
them first before the ones in the "public pool".
More information about the OpenStack-dev