Class VmAllocationPolicyMigrationDynamicUpperThresholdFirstFit

All Implemented Interfaces:
VmAllocationPolicyMigration, VmAllocationPolicyMigrationDynamicUpperThreshold, VmAllocationPolicy

public abstract class VmAllocationPolicyMigrationDynamicUpperThresholdFirstFit extends VmAllocationPolicyMigrationAbstract implements VmAllocationPolicyMigrationDynamicUpperThreshold
An abstract class that is the base for implementation of VM allocation policies which use a dynamic over utilization threshold.
Manoel Campos da Silva Filho
  • Constructor Details

    • VmAllocationPolicyMigrationDynamicUpperThresholdFirstFit

      public VmAllocationPolicyMigrationDynamicUpperThresholdFirstFit(VmSelectionPolicy vmSelectionPolicy)
      Creates a VmAllocationPolicyMigrationDynamicUpperThreshold with a safety parameter equals to 0 and no fallback policy.
      vmSelectionPolicy - the policy that defines how VMs are selected for migration
    • VmAllocationPolicyMigrationDynamicUpperThresholdFirstFit

      public VmAllocationPolicyMigrationDynamicUpperThresholdFirstFit(VmSelectionPolicy vmSelectionPolicy, double safetyParameter, VmAllocationPolicyMigration fallbackVmAllocationPolicy)
      Creates a VmAllocationPolicyMigrationDynamicUpperThreshold.
      vmSelectionPolicy - the policy that defines how VMs are selected for migration
      safetyParameter - the safety parameter
      fallbackVmAllocationPolicy - the fallback VM allocation policy to be used when the over utilization host detection doesn't have data to be computed
  • Method Details

    • isHostOverloaded

      public boolean isHostOverloaded(Host host)
      Checks if a host is over utilized based on the CPU over utilization threshold computed using the statistical method defined in VmAllocationPolicyMigrationDynamicUpperThreshold.computeHostUtilizationMeasure(Host).
      Specified by:
      isHostOverloaded in interface VmAllocationPolicyMigration
      isHostOverloaded in class VmAllocationPolicyMigrationAbstract
      host - the host to check
      true, if the host is over utilized; false otherwise
    • getOverUtilizationThreshold

      public double getOverUtilizationThreshold(Host host)
      Gets a dynamically computed Host over utilization threshold based on the Host CPU utilization history.
      Specified by:
      getOverUtilizationThreshold in interface VmAllocationPolicyMigration
      host - the host to get the over utilization threshold
      the over utilization threshold or Double.MAX_VALUE if the threshold could not be computed (for instance, because the Host doesn't have enough history to use)
      See Also:
    • setSafetyParameter

      protected final void setSafetyParameter(double safetyParameter)
      Sets the safety parameter.
      safetyParameter - the new safety parameter
    • getSafetyParameter

      public double getSafetyParameter()
      Description copied from interface: VmAllocationPolicyMigrationDynamicUpperThreshold
      Gets the safety parameter for the over utilization threshold in percentage, at scale from 0 to 1. For instance, a value 1 means 100% while 1.5 means 150%. It is a tuning parameter used by the allocation policy to define when a host is overloaded. The overload detection is based on a dynamic defined host utilization threshold.

      Such a threshold is computed based on the host's usage history using different statistical methods (such as Median absolute deviation - MAD, that is similar to the Standard Deviation) depending on the implementing class, as defined by the method VmAllocationPolicyMigrationDynamicUpperThreshold.computeHostUtilizationMeasure(Host).

      This safety parameter is used to increase or decrease the utilization threshold. As the safety parameter increases, the threshold decreases, what may lead to less SLA violations. So, as higher is that parameter, safer the algorithm will be when defining a host as overloaded. A value equal to 0 indicates that the safety parameter doesn't affect the computed CPU utilization threshold.

      Let's take an example of a class that uses the MAD to compute the over utilization threshold. Considering a host's resource usage mean of 0.6 (60%) and a MAD of 0.2, meaning the usage may vary from 0.4 to 0.8. Now take a safety parameter of 0.5 (50%). To compute the usage threshold, the MAD is increased by 50%, being equals to 0.3. Finally, the threshold will be 1 - 0.3 = 0.7. Thus, only when the host utilization threshold exceeds 70%, the host is considered overloaded.

      Here, safer doesn't mean a more accurate overload detection but that the algorithm will use a lower host utilization threshold that may lead to lower SLA violations but higher resource wastage. Thus this parameter has to be tuned in order to trade-off between SLA violation and resource wastage.

      Specified by:
      getSafetyParameter in interface VmAllocationPolicyMigrationDynamicUpperThreshold
    • setFallbackVmAllocationPolicy

      public final void setFallbackVmAllocationPolicy(VmAllocationPolicyMigration fallbackPolicy)
      Description copied from interface: VmAllocationPolicyMigrationDynamicUpperThreshold
      Sets the fallback VM allocation policy to be used when the over utilization host detection doesn't have data to be computed.
      Specified by:
      setFallbackVmAllocationPolicy in interface VmAllocationPolicyMigrationDynamicUpperThreshold
      fallbackPolicy - the new fallback vm allocation policy
    • getFallbackVmAllocationPolicy

      public VmAllocationPolicyMigration getFallbackVmAllocationPolicy()
      Description copied from interface: VmAllocationPolicyMigrationDynamicUpperThreshold
      Gets the fallback VM allocation policy to be used when the over utilization host detection doesn't have data to be computed.
      Specified by:
      getFallbackVmAllocationPolicy in interface VmAllocationPolicyMigrationDynamicUpperThreshold
      the fallback vm allocation policy