VmAllocationPolicyMigrationBestFitStaticThreshold

public class VmAllocationPolicyMigrationBestFitStaticThreshold extends VmAllocationPolicyMigrationStaticThreshold

A VmAllocationPolicy that uses a Static CPU utilization Threshold (THR) to detect host under and getOverUtilizationThreshold(Host) over} utilization.

It’s a Best Fit policy which selects the Host having the most used amount of CPU MIPS to place a given VM, disregarding energy consumption.

Author:Anton Beloglazov, Manoel Campos da Silva Filho

Constructors

VmAllocationPolicyMigrationBestFitStaticThreshold

public VmAllocationPolicyMigrationBestFitStaticThreshold(PowerVmSelectionPolicy vmSelectionPolicy, double overUtilizationThreshold)

VmAllocationPolicyMigrationBestFitStaticThreshold

public VmAllocationPolicyMigrationBestFitStaticThreshold(PowerVmSelectionPolicy vmSelectionPolicy, double overUtilizationThreshold, BiFunction<VmAllocationPolicy, Vm, Optional<Host>> findHostForVmFunction)

Creates a new VmAllocationPolicy, changing the Function to select a Host for a Vm.

Parameters:
  • vmSelectionPolicy – the policy that defines how VMs are selected for migration
  • overUtilizationThreshold – the over utilization threshold
  • findHostForVmFunction – a Function to select a Host for a given Vm. Passing null makes the Function to be set as the default findHostForVm(Vm).

See also: VmAllocationPolicy.setFindHostForVmFunction(java.util.function.BiFunction)

Methods

findHostForVmInternal

protected Optional<Host> findHostForVmInternal(Vm vm, Stream<Host> hostStream)

Gets the Host having the least available MIPS capacity (max used MIPS).

This method is ignoring the additional filtering performed by the super class. This way, Host selection is performed ignoring energy consumption. However, all the basic filters defined in the super class are ensured, since this method is called just after they are applied.

Parameters:
Returns:

{@inheritDoc}