Least Cost is an algorithm for choosing which host machines to provision a set of resources to. The input is a WeightedHost object which is decided upon by a set of objective-functions, called the ‘cost-functions’. The WeightedHost contains a combined weight for each cost-function.
The cost-function and weights are tabulated, and the host with the least cost is then selected for provisioning.
NOTE(comstud): This is deprecated. One should use the RAMWeigher and/or create other weight modules.
Higher weights win, so we should return a lower weight when there’s more free ram available.
Note: the weight modifier for this function in default configuration is -1.0. With -1.0 this function runs in reverse, so systems with the most free memory will be preferred.
Return a pre-weight cost of 1 for each host.