Class VmAllocationPolicyMigrationDynamicUpperThresholdFirstFit
- All Implemented Interfaces:
VmAllocationPolicyMigration
,VmAllocationPolicyMigrationDynamicUpperThreshold
,VmAllocationPolicy
- Author:
- Manoel Campos da Silva Filho
-
Field Summary
Fields inherited from class org.cloudbus.cloudsim.allocationpolicies.migration.VmAllocationPolicyMigrationAbstract
DEF_UNDERLOAD_THRESHOLD
Fields inherited from interface org.cloudbus.cloudsim.allocationpolicies.VmAllocationPolicy
DEF_HOST_COUNT_PARALLEL_SEARCH, LOGGER, NULL
Fields inherited from interface org.cloudbus.cloudsim.allocationpolicies.migration.VmAllocationPolicyMigration
NULL
-
Constructor Summary
ConstructorDescriptionVmAllocationPolicyMigrationDynamicUpperThresholdFirstFit
(VmSelectionPolicy vmSelectionPolicy) Creates a VmAllocationPolicyMigrationDynamicUpperThreshold with asafety parameter
equals to 0 and nofallback policy
.VmAllocationPolicyMigrationDynamicUpperThresholdFirstFit
(VmSelectionPolicy vmSelectionPolicy, double safetyParameter, VmAllocationPolicyMigration fallbackVmAllocationPolicy) Creates a VmAllocationPolicyMigrationDynamicUpperThreshold. -
Method Summary
Modifier and TypeMethodDescriptionGets the fallback VM allocation policy to be used when the over utilization host detection doesn't have data to be computed.double
Gets a dynamically computed Host over utilization threshold based on the Host CPU utilization history.double
Gets the safety parameter for the over utilization threshold in percentage, at scale from 0 to 1.boolean
isHostOverloaded
(Host host) Checks if a host is over utilized based on the CPU over utilization threshold computed using the statistical method defined inVmAllocationPolicyMigrationDynamicUpperThreshold.computeHostUtilizationMeasure(Host)
.final void
setFallbackVmAllocationPolicy
(VmAllocationPolicyMigration fallbackPolicy) Sets the fallback VM allocation policy to be used when the over utilization host detection doesn't have data to be computed.protected final void
setSafetyParameter
(double safetyParameter) Sets the safety parameter.Methods inherited from class org.cloudbus.cloudsim.allocationpolicies.migration.VmAllocationPolicyMigrationAbstract
areHostsOverloaded, areHostsUnderloaded, defaultFindHostForVm, findHostForVmInternal, getMaxUtilizationAfterAllocation, getOptimizedAllocationMap, getPowerAfterAllocation, getPowerDifferenceAfterAllocation, getSwitchedOffHosts, getUnderUtilizationThreshold, getUtilizationOfCpuMips, getVmSelectionPolicy, getVmsToMigrateFromUnderUtilizedHost, isHostUnderloaded, isVmMigrationSupported, setUnderUtilizationThreshold, setVmSelectionPolicy
Methods inherited from class org.cloudbus.cloudsim.allocationpolicies.VmAllocationPolicyAbstract
allocateHostForVm, allocateHostForVm, allocateHostForVm, deallocateHostForVm, findHostForVm, getDatacenter, getHostCountForParallelSearch, getHostList, scaleVmVertically, setDatacenter, setFindHostForVmFunction, setHostCountForParallelSearch
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.cloudbus.cloudsim.allocationpolicies.VmAllocationPolicy
allocateHostForVm, allocateHostForVm, allocateHostForVm, deallocateHostForVm, findHostForVm, getDatacenter, getHostCountForParallelSearch, getHostList, getOptimizedAllocationMap, isParallelHostSearchEnabled, isVmMigrationSupported, scaleVmVertically, setDatacenter, setFindHostForVmFunction, setHostCountForParallelSearch
Methods inherited from interface org.cloudbus.cloudsim.allocationpolicies.migration.VmAllocationPolicyMigration
areHostsOverloaded, areHostsUnderloaded, areHostsUnderOrOverloaded, getUnderUtilizationThreshold, getVmSelectionPolicy, isHostUnderloaded, setUnderUtilizationThreshold, setVmSelectionPolicy
Methods inherited from interface org.cloudbus.cloudsim.allocationpolicies.migration.VmAllocationPolicyMigrationDynamicUpperThreshold
computeHostUtilizationMeasure
-
Constructor Details
-
VmAllocationPolicyMigrationDynamicUpperThresholdFirstFit
public VmAllocationPolicyMigrationDynamicUpperThresholdFirstFit(VmSelectionPolicy vmSelectionPolicy) Creates a VmAllocationPolicyMigrationDynamicUpperThreshold with asafety parameter
equals to 0 and nofallback policy
.- Parameters:
vmSelectionPolicy
- the policy that defines how VMs are selected for migration
-
VmAllocationPolicyMigrationDynamicUpperThresholdFirstFit
public VmAllocationPolicyMigrationDynamicUpperThresholdFirstFit(VmSelectionPolicy vmSelectionPolicy, double safetyParameter, VmAllocationPolicyMigration fallbackVmAllocationPolicy) Creates a VmAllocationPolicyMigrationDynamicUpperThreshold.- Parameters:
vmSelectionPolicy
- the policy that defines how VMs are selected for migrationsafetyParameter
- the safety parameterfallbackVmAllocationPolicy
- the fallback VM allocation policy to be used when the over utilization host detection doesn't have data to be computed
-
-
Method Details
-
isHostOverloaded
Checks if a host is over utilized based on the CPU over utilization threshold computed using the statistical method defined inVmAllocationPolicyMigrationDynamicUpperThreshold.computeHostUtilizationMeasure(Host)
.- Specified by:
isHostOverloaded
in interfaceVmAllocationPolicyMigration
- Overrides:
isHostOverloaded
in classVmAllocationPolicyMigrationAbstract
- Parameters:
host
- the host to check- Returns:
- true, if the host is over utilized; false otherwise
-
getOverUtilizationThreshold
Gets a dynamically computed Host over utilization threshold based on the Host CPU utilization history.- Specified by:
getOverUtilizationThreshold
in interfaceVmAllocationPolicyMigration
- Parameters:
host
- the host to get the over utilization threshold- Returns:
- 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.- Parameters:
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 interfaceVmAllocationPolicyMigrationDynamicUpperThreshold
-
setFallbackVmAllocationPolicy
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 interfaceVmAllocationPolicyMigrationDynamicUpperThreshold
- Parameters:
fallbackPolicy
- the new fallback vm allocation policy
-
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 interfaceVmAllocationPolicyMigrationDynamicUpperThreshold
- Returns:
- the fallback vm allocation policy
-