PowerVmAllocationPolicyMigrationAbstract (cloudsim 3.1-SNAPSHOT API)

org.cloudbus.cloudsim.power

## Class PowerVmAllocationPolicyMigrationAbstract

- java.lang.Object
- - org.cloudbus.cloudsim.VmAllocationPolicy
  - - org.cloudbus.cloudsim.power.PowerVmAllocationPolicyAbstract
    - - org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationAbstract

- Direct Known Subclasses:
    PowerVmAllocationPolicyMigrationInterQuartileRange, PowerVmAllocationPolicyMigrationLocalRegression, PowerVmAllocationPolicyMigrationMedianAbsoluteDeviation, PowerVmAllocationPolicyMigrationStaticThreshold

      public abstract class PowerVmAllocationPolicyMigrationAbstract
      extends PowerVmAllocationPolicyAbstract

  The class of an abstract power-aware VM allocation policy that dynamically optimizes the VM allocation using migration. If you are using any algorithms, policies or workload included in the power package, please cite the following paper: Anton Beloglazov, and Rajkumar Buyya, "Optimal Online Deterministic Algorithms and Adaptive Heuristics for Energy and Performance Efficient Dynamic Consolidation of Virtual Machines in Cloud Data Centers", Concurrency and Computation: Practice and Experience, ISSN: 1532-0626, Wiley Press, New York, USA, 2011, DOI: 10.1002/cpe.1867
  Since:
    CloudSim Toolkit 3.0
  Author:
    Anton Beloglazov

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PowerVmAllocationPolicyMigrationAbstract(List<? extends Host> hostList, PowerVmSelectionPolicy vmSelectionPolicy)` Instantiates a new power vm allocation policy migration abstract.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addHistoryEntry(HostDynamicWorkload host, double metric)` Adds the history value.
    `protected boolean` | `areAllVmsMigratingOutOrAnyVmMigratingIn(PowerHost host)` Checks whether all vms are in migration.
    `protected List<PowerHost>` | `extractHostListFromMigrationMap(List<Map<String,Object>> migrationMap)` Extract host list from migration map.
    `PowerHost` | `findHostForVm(Vm vm)` Find host for vm.
    `PowerHost` | `findHostForVm(Vm vm, Set<? extends Host> excludedHosts)` Find host for vm.
    `List<Double>` | `getExecutionTimeHistoryHostSelection()` Gets the execution time history host selection.
    `List<Double>` | `getExecutionTimeHistoryTotal()` Gets the execution time history total.
    `List<Double>` | `getExecutionTimeHistoryVmReallocation()` Gets the execution time history vm reallocation.
    `List<Double>` | `getExecutionTimeHistoryVmSelection()` Gets the execution time history vm selection.
    `protected double` | `getMaxUtilizationAfterAllocation(PowerHost host, Vm vm)` Gets the power after allocation.
    `Map<Integer,List<Double>>` | `getMetricHistory()` Gets the metric history.
    `protected List<Map<String,Object>>` | `getMigrationMapFromUnderUtilizedHosts(List<PowerHostUtilizationHistory> overUtilizedHosts)` Gets the migration map from under utilized hosts.
    `protected List<Map<String,Object>>` | `getNewVmPlacement(List<? extends Vm> vmsToMigrate, Set<? extends Host> excludedHosts)` Gets the new vm placement.
    `protected List<Map<String,Object>>` | `getNewVmPlacementFromUnderUtilizedHost(List<? extends Vm> vmsToMigrate, Set<? extends Host> excludedHosts)` Gets the new vm placement from under utilized host.
    `protected List<PowerHostUtilizationHistory>` | `getOverUtilizedHosts()` Gets the over utilized hosts.
    `protected double` | `getPowerAfterAllocation(PowerHost host, Vm vm)` Gets the power after allocation.
    `protected List<Map<String,Object>>` | `getSavedAllocation()` Gets the saved allocation.
    `protected List<PowerHost>` | `getSwitchedOffHosts()` Gets the switched off host.
    `Map<Integer,List<Double>>` | `getTimeHistory()` Gets the time history.
    `protected PowerHost` | `getUnderUtilizedHost(Set<? extends Host> excludedHosts)` Gets the under utilized host.
    `Map<Integer,List<Double>>` | `getUtilizationHistory()` Gets the utilization history.
    `protected PowerVmSelectionPolicy` | `getVmSelectionPolicy()` Gets the vm selection policy.
    `protected List<? extends Vm>` | `getVmsToMigrateFromHosts(List<PowerHostUtilizationHistory> overUtilizedHosts)` Gets the vms to migrate from hosts.
    `protected List<? extends Vm>` | `getVmsToMigrateFromUnderUtilizedHost(PowerHost host)` Gets the vms to migrate from under utilized host.
    `protected abstract boolean` | `isHostOverUtilized(PowerHost host)` Checks if is host over utilized.
    `protected boolean` | `isHostOverUtilizedAfterAllocation(PowerHost host, Vm vm)` Checks if is host over utilized after allocation.
    `List<Map<String,Object>>` | `optimizeAllocation(List<? extends Vm> vmList)` Optimize allocation of the VMs according to current utilization.
    `protected void` | `printOverUtilizedHosts(List<PowerHostUtilizationHistory> overUtilizedHosts)` Prints the over utilized hosts.
    `protected void` | `restoreAllocation()` Restore allocation.
    `protected void` | `saveAllocation()` Save allocation.
    `protected void` | `setVmSelectionPolicy(PowerVmSelectionPolicy vmSelectionPolicy)` Sets the vm selection policy.

    - ### Methods inherited from class org.cloudbus.cloudsim.power.PowerVmAllocationPolicyAbstract

      `allocateHostForVm, allocateHostForVm, deallocateHostForVm, getHost, getHost, getVmTable, TryDVFSEnableHost`

    - ### Methods inherited from class org.cloudbus.cloudsim.VmAllocationPolicy

      `getHostList, setHostList`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PowerVmAllocationPolicyMigrationAbstract

          public PowerVmAllocationPolicyMigrationAbstract(List<? extends Host> hostList,
                                                  PowerVmSelectionPolicy vmSelectionPolicy)

      Instantiates a new power vm allocation policy migration abstract.
      Parameters:
        `hostList` - the host list
        `vmSelectionPolicy` - the vm selection policy

  - ### Method Detail

    - #### optimizeAllocation

          public List<Map<String,Object>> optimizeAllocation(List<? extends Vm> vmList)

      Optimize allocation of the VMs according to current utilization.
      Specified by:
        `optimizeAllocation` in class `VmAllocationPolicy`
      Parameters:
        `vmList` - the vm list
      Returns:
        the array list< hash map< string, object>>

    - #### getMigrationMapFromUnderUtilizedHosts

          protected List<Map<String,Object>> getMigrationMapFromUnderUtilizedHosts(List<PowerHostUtilizationHistory> overUtilizedHosts)

      Gets the migration map from under utilized hosts.
      Parameters:
        `overUtilizedHosts` - the over utilized hosts
      Returns:
        the migration map from under utilized hosts

    - #### printOverUtilizedHosts

          protected void printOverUtilizedHosts(List<PowerHostUtilizationHistory> overUtilizedHosts)

      Prints the over utilized hosts.
      Parameters:
        `overUtilizedHosts` - the over utilized hosts

    - #### findHostForVm

          public PowerHost findHostForVm(Vm vm,
                                Set<? extends Host> excludedHosts)

      Find host for vm.
      Parameters:
        `vm` - the vm
        `excludedHosts` - the excluded hosts
      Returns:
        the power host

    - #### isHostOverUtilizedAfterAllocation

          protected boolean isHostOverUtilizedAfterAllocation(PowerHost host,
                                                  Vm vm)

      Checks if is host over utilized after allocation.
      Parameters:
        `host` - the host
        `vm` - the vm
      Returns:
        true, if is host over utilized after allocation

    - #### findHostForVm

          public PowerHost findHostForVm(Vm vm)

      Find host for vm.
      Overrides:
        `findHostForVm` in class `PowerVmAllocationPolicyAbstract`
      Parameters:
        `vm` - the vm
      Returns:
        the power host

    - #### extractHostListFromMigrationMap

          protected List<PowerHost> extractHostListFromMigrationMap(List<Map<String,Object>> migrationMap)

      Extract host list from migration map.
      Parameters:
        `migrationMap` - the migration map
      Returns:
        the list

    - #### getNewVmPlacement

          protected List<Map<String,Object>> getNewVmPlacement(List<? extends Vm> vmsToMigrate,
                                                   Set<? extends Host> excludedHosts)

      Gets the new vm placement.
      Parameters:
        `vmsToMigrate` - the vms to migrate
        `excludedHosts` - the excluded hosts
      Returns:
        the new vm placement

    - #### getNewVmPlacementFromUnderUtilizedHost

          protected List<Map<String,Object>> getNewVmPlacementFromUnderUtilizedHost(List<? extends Vm> vmsToMigrate,
                                                                        Set<? extends Host> excludedHosts)

      Gets the new vm placement from under utilized host.
      Parameters:
        `vmsToMigrate` - the vms to migrate
        `excludedHosts` - the excluded hosts
      Returns:
        the new vm placement from under utilized host

    - #### getVmsToMigrateFromHosts

          protected List<? extends Vm> getVmsToMigrateFromHosts(List<PowerHostUtilizationHistory> overUtilizedHosts)

      Gets the vms to migrate from hosts.
      Parameters:
        `overUtilizedHosts` - the over utilized hosts
      Returns:
        the vms to migrate from hosts

    - #### getVmsToMigrateFromUnderUtilizedHost

          protected List<? extends Vm> getVmsToMigrateFromUnderUtilizedHost(PowerHost host)

      Gets the vms to migrate from under utilized host.
      Parameters:
        `host` - the host
      Returns:
        the vms to migrate from under utilized host

    - #### getOverUtilizedHosts

          protected List<PowerHostUtilizationHistory> getOverUtilizedHosts()

      Gets the over utilized hosts.
      Returns:
        the over utilized hosts

    - #### getSwitchedOffHosts

          protected List<PowerHost> getSwitchedOffHosts()

      Gets the switched off host.
      Returns:
        the switched off host

    - #### getUnderUtilizedHost

          protected PowerHost getUnderUtilizedHost(Set<? extends Host> excludedHosts)

      Gets the under utilized host.
      Parameters:
        `excludedHosts` - the excluded hosts
      Returns:
        the under utilized host

    - #### areAllVmsMigratingOutOrAnyVmMigratingIn

          protected boolean areAllVmsMigratingOutOrAnyVmMigratingIn(PowerHost host)

      Checks whether all vms are in migration.
      Parameters:
        `host` - the host
      Returns:
        true, if successful

    - #### isHostOverUtilized

          protected abstract boolean isHostOverUtilized(PowerHost host)

      Checks if is host over utilized.
      Parameters:
        `host` - the host
      Returns:
        true, if is host over utilized

    - #### addHistoryEntry

          protected void addHistoryEntry(HostDynamicWorkload host,
                             double metric)

      Adds the history value.
      Parameters:
        `host` - the host
        `metric` - the metric

    - #### saveAllocation

          protected void saveAllocation()

      Save allocation.

    - #### restoreAllocation

          protected void restoreAllocation()

      Restore allocation.

    - #### getPowerAfterAllocation

          protected double getPowerAfterAllocation(PowerHost host,
                                       Vm vm)

      Gets the power after allocation.
      Parameters:
        `host` - the host
        `vm` - the vm
      Returns:
        the power after allocation

    - #### getMaxUtilizationAfterAllocation

          protected double getMaxUtilizationAfterAllocation(PowerHost host,
                                                Vm vm)

      Gets the power after allocation. We assume that load is balanced between PEs. The only restriction is: VM's max MIPS < PE's MIPS
      Parameters:
        `host` - the host
        `vm` - the vm
      Returns:
        the power after allocation

    - #### getSavedAllocation

          protected List<Map<String,Object>> getSavedAllocation()

      Gets the saved allocation.
      Returns:
        the saved allocation

    - #### setVmSelectionPolicy

          protected void setVmSelectionPolicy(PowerVmSelectionPolicy vmSelectionPolicy)

      Sets the vm selection policy.
      Parameters:
        `vmSelectionPolicy` - the new vm selection policy

    - #### getVmSelectionPolicy

          protected PowerVmSelectionPolicy getVmSelectionPolicy()

      Gets the vm selection policy.
      Returns:
        the vm selection policy

    - #### getUtilizationHistory

          public Map<Integer,List<Double>> getUtilizationHistory()

      Gets the utilization history.
      Returns:
        the utilization history

    - #### getMetricHistory

          public Map<Integer,List<Double>> getMetricHistory()

      Gets the metric history.
      Returns:
        the metric history

    - #### getTimeHistory

          public Map<Integer,List<Double>> getTimeHistory()

      Gets the time history.
      Returns:
        the time history

    - #### getExecutionTimeHistoryVmSelection

          public List<Double> getExecutionTimeHistoryVmSelection()

      Gets the execution time history vm selection.
      Returns:
        the execution time history vm selection

    - #### getExecutionTimeHistoryHostSelection

          public List<Double> getExecutionTimeHistoryHostSelection()

      Gets the execution time history host selection.
      Returns:
        the execution time history host selection

    - #### getExecutionTimeHistoryVmReallocation

          public List<Double> getExecutionTimeHistoryVmReallocation()

      Gets the execution time history vm reallocation.
      Returns:
        the execution time history vm reallocation

    - #### getExecutionTimeHistoryTotal

          public List<Double> getExecutionTimeHistoryTotal()

      Gets the execution time history total.
      Returns:
        the execution time history total

Copyright © 2013 The Cloud Computing and Distributed Systems (CLOUDS) Laboratory, The University of Melbourne. All Rights Reserved.