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.
Bases: object
Reduced set of information about a host that has been weighed. This is an attempt to remove some of the ad-hoc dict structures previously used.
More free ram = higher weight. So servers with less free ram will be preferred.
Note: the weight for this function in default configuration is -1.0. With a -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
Use the weighted-sum method to compute a score for an array of objects.
Normalize the results of the objective-functions so that the weights are meaningful regardless of objective-function’s range.
Parameters: |
|
---|---|
Returns: | a single WeightedHost object which represents the best candidate. |