Class VmAllocationPolicyMigrationBestFitStaticThreshold
java.lang.Object
org.cloudbus.cloudsim.allocationpolicies.VmAllocationPolicyAbstract
org.cloudbus.cloudsim.allocationpolicies.migration.VmAllocationPolicyMigrationAbstract
org.cloudbus.cloudsim.allocationpolicies.migration.VmAllocationPolicyMigrationStaticThreshold
org.cloudbus.cloudsim.allocationpolicies.migration.VmAllocationPolicyMigrationBestFitStaticThreshold
- All Implemented Interfaces:
VmAllocationPolicyMigration
,VmAllocationPolicy
public class VmAllocationPolicyMigrationBestFitStaticThreshold
extends VmAllocationPolicyMigrationStaticThreshold
A
VmAllocationPolicy
that uses a Static CPU utilization Threshold (THR) to
detect host under
and
VmAllocationPolicyMigrationStaticThreshold.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.
- Since:
- CloudSim Plus 1.0
- Author:
- Anton Beloglazov, Manoel Campos da Silva Filho
-
Field Summary
Fields inherited from class org.cloudbus.cloudsim.allocationpolicies.migration.VmAllocationPolicyMigrationStaticThreshold
DEF_OVER_UTILIZATION_THRESHOLD
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
ConstructorDescriptionVmAllocationPolicyMigrationBestFitStaticThreshold
(VmSelectionPolicy vmSelectionPolicy) Creates a VmAllocationPolicyMigrationBestFitStaticThreshold.VmAllocationPolicyMigrationBestFitStaticThreshold
(VmSelectionPolicy vmSelectionPolicy, double overUtilizationThreshold) VmAllocationPolicyMigrationBestFitStaticThreshold
(VmSelectionPolicy vmSelectionPolicy, double overUtilizationThreshold, BiFunction<VmAllocationPolicy, Vm, Optional<Host>> findHostForVmFunction) Creates a new VmAllocationPolicy, changing theFunction
to select a Host for a Vm. -
Method Summary
Methods inherited from class org.cloudbus.cloudsim.allocationpolicies.migration.VmAllocationPolicyMigrationStaticThreshold
getOverUtilizationThreshold, setOverUtilizationThreshold
Methods inherited from class org.cloudbus.cloudsim.allocationpolicies.migration.VmAllocationPolicyMigrationAbstract
areHostsOverloaded, areHostsUnderloaded, defaultFindHostForVm, getMaxUtilizationAfterAllocation, getOptimizedAllocationMap, getPowerAfterAllocation, getPowerDifferenceAfterAllocation, getSwitchedOffHosts, getUnderUtilizationThreshold, getUtilizationOfCpuMips, getVmSelectionPolicy, getVmsToMigrateFromUnderUtilizedHost, isHostOverloaded, isHostUnderloaded, isVmMigrationSupported, setDatacenter, setUnderUtilizationThreshold, setVmSelectionPolicy
Methods inherited from class org.cloudbus.cloudsim.allocationpolicies.VmAllocationPolicyAbstract
allocateHostForVm, allocateHostForVm, allocateHostForVm, deallocateHostForVm, findHostForVm, getDatacenter, getHostCountForParallelSearch, getHostList, scaleVmVertically, 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, isParallelHostSearchEnabled, scaleVmVertically, setFindHostForVmFunction, setHostCountForParallelSearch
Methods inherited from interface org.cloudbus.cloudsim.allocationpolicies.migration.VmAllocationPolicyMigration
areHostsUnderOrOverloaded
-
Constructor Details
-
VmAllocationPolicyMigrationBestFitStaticThreshold
Creates a VmAllocationPolicyMigrationBestFitStaticThreshold. 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:
-
VmAllocationPolicyMigrationBestFitStaticThreshold
public VmAllocationPolicyMigrationBestFitStaticThreshold(VmSelectionPolicy vmSelectionPolicy, double overUtilizationThreshold) -
VmAllocationPolicyMigrationBestFitStaticThreshold
public VmAllocationPolicyMigrationBestFitStaticThreshold(VmSelectionPolicy vmSelectionPolicy, double overUtilizationThreshold, BiFunction<VmAllocationPolicy, Vm, Optional<Host>> findHostForVmFunction) Creates a new VmAllocationPolicy, 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:
-
-
Method Details
-
findHostForVmInternal
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.
- Overrides:
findHostForVmInternal
in classVmAllocationPolicyMigrationAbstract
- Parameters:
vm
- the VM to find a Host to be placed intopredicate
- aPredicate
to filter suitable Hosts- Returns:
- an
Optional
containing a suitable Host to place the VM or an emptyOptional
if not found - See Also:
-
VmAllocationPolicyMigrationAbstract.findHostForVm(Vm, Predicate)
-