Class VmAllocationPolicyMigrationStaticThreshold
java.lang.Object
org.cloudbus.cloudsim.allocationpolicies.VmAllocationPolicyAbstract
org.cloudbus.cloudsim.allocationpolicies.migration.VmAllocationPolicyMigrationAbstract
org.cloudbus.cloudsim.allocationpolicies.migration.VmAllocationPolicyMigrationStaticThreshold
- All Implemented Interfaces:
VmAllocationPolicyMigration
,VmAllocationPolicy
- Direct Known Subclasses:
VmAllocationPolicyMigrationBestFitStaticThreshold
,VmAllocationPolicyMigrationWorstFitStaticThreshold
public class VmAllocationPolicyMigrationStaticThreshold extends VmAllocationPolicyMigrationAbstract
A VM allocation policy that uses a static CPU utilization threshold to detect
host over utilization.
It's a First Fit policy which selects the first Host found with most efficient power usage to place a given VM.
If you are using any algorithms, policies or workload included in the power package please cite the following paper:
- Since:
- CloudSim Toolkit 3.0
- Author:
- Anton Beloglazov
-
Field Summary
Fields Modifier and Type Field Description static double
DEF_OVER_UTILIZATION_THRESHOLD
Fields inherited from class org.cloudbus.cloudsim.allocationpolicies.migration.VmAllocationPolicyMigrationAbstract
DEF_UNDER_UTILIZATION_THRESHOLD
Fields inherited from interface org.cloudbus.cloudsim.allocationpolicies.VmAllocationPolicy
DEF_HOST_COUNT_FOR_PARALLEL_SEARCH, NULL
Fields inherited from interface org.cloudbus.cloudsim.allocationpolicies.migration.VmAllocationPolicyMigration
NULL
-
Constructor Summary
Constructors Constructor Description VmAllocationPolicyMigrationStaticThreshold(VmSelectionPolicy vmSelectionPolicy)
Creates a VmAllocationPolicyMigrationStaticThreshold.VmAllocationPolicyMigrationStaticThreshold(VmSelectionPolicy vmSelectionPolicy, double overUtilizationThreshold)
Creates a VmAllocationPolicyMigrationStaticThreshold.VmAllocationPolicyMigrationStaticThreshold(VmSelectionPolicy vmSelectionPolicy, double overUtilizationThreshold, java.util.function.BiFunction<VmAllocationPolicy,Vm,java.util.Optional<Host>> findHostForVmFunction)
Creates a VmAllocationPolicyMigrationStaticThreshold, changing theFunction
to select a Host for a Vm. -
Method Summary
Modifier and Type Method Description double
getOverUtilizationThreshold(Host host)
Gets the static host CPU utilization threshold to detect over utilization.void
setOverUtilizationThreshold(double overUtilizationThreshold)
Sets the static host CPU utilization threshold to detect over utilization.Methods inherited from class org.cloudbus.cloudsim.allocationpolicies.migration.VmAllocationPolicyMigrationAbstract
defaultFindHostForVm, findHostForVmInternal, getHostCpuUsageArray, getMaxUtilizationAfterAllocation, getOptimizedAllocationMap, getPowerAfterAllocation, getPowerDifferenceAfterAllocation, getSwitchedOffHosts, getUnderUtilizationThreshold, getUtilizationOfCpuMips, getVmSelectionPolicy, getVmsToMigrateFromUnderUtilizedHost, isHostOverloaded, isHostUnderloaded, isVmMigrationSupported, setUnderUtilizationThreshold, setVmSelectionPolicy
Methods inherited from class org.cloudbus.cloudsim.allocationpolicies.VmAllocationPolicyAbstract
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, deallocateHostForVm, findHostForVm, getDatacenter, getHostCountForParallelSearch, getHostList, isParallelHostSearchEnabled, scaleVmVertically, setDatacenter, setFindHostForVmFunction, setHostCountForParallelSearch
-
Field Details
-
DEF_OVER_UTILIZATION_THRESHOLD
public static final double DEF_OVER_UTILIZATION_THRESHOLD- See Also:
- Constant Field Values
-
-
Constructor Details
-
VmAllocationPolicyMigrationStaticThreshold
Creates a VmAllocationPolicyMigrationStaticThreshold. It uses adefault over utilization threshold
and adefault under utilization threshold
.- Parameters:
vmSelectionPolicy
- the policy that defines how VMs are selected for migration- See Also:
VmAllocationPolicyMigrationAbstract.setUnderUtilizationThreshold(double)
,setOverUtilizationThreshold(double)
-
VmAllocationPolicyMigrationStaticThreshold
public VmAllocationPolicyMigrationStaticThreshold(VmSelectionPolicy vmSelectionPolicy, double overUtilizationThreshold)Creates a VmAllocationPolicyMigrationStaticThreshold.- Parameters:
vmSelectionPolicy
- the policy that defines how VMs are selected for migrationoverUtilizationThreshold
- the over utilization threshold
-
VmAllocationPolicyMigrationStaticThreshold
public VmAllocationPolicyMigrationStaticThreshold(VmSelectionPolicy vmSelectionPolicy, double overUtilizationThreshold, java.util.function.BiFunction<VmAllocationPolicy,Vm,java.util.Optional<Host>> findHostForVmFunction)Creates a VmAllocationPolicyMigrationStaticThreshold, changing theFunction
to select a Host for a Vm.- Parameters:
vmSelectionPolicy
- the policy that defines how VMs are selected for migrationoverUtilizationThreshold
- the over utilization thresholdfindHostForVmFunction
- aFunction
to select a Host for a given Vm. Passing null makes the Function to be set as the defaultVmAllocationPolicyAbstract.findHostForVm(Vm)
.- See Also:
VmAllocationPolicy.setFindHostForVmFunction(java.util.function.BiFunction)
-
-
Method Details
-
setOverUtilizationThreshold
public final void setOverUtilizationThreshold(double overUtilizationThreshold)Sets the static host CPU utilization threshold to detect over utilization.- Parameters:
overUtilizationThreshold
- the overUtilizationThreshold to set
-
getOverUtilizationThreshold
Gets the static host CPU utilization threshold to detect over utilization. It is a percentage value from 0 to 1 that can be changed when creating an instance of the class.This implementation always returns the same over utilization threshold for any given host
- Parameters:
host
- the host to get the over utilization threshold- Returns:
- the over utilization threshold (that is the same for any given host)
-