Interface HorizontalVmScaling

All Superinterfaces:
VmScaling
All Known Implementing Classes:
HorizontalVmScalingSimple

public interface HorizontalVmScaling extends VmScaling
A Vm Horizontal Scaling mechanism used by a DatacenterBroker to dynamically create VMs according to the arrival of Cloudlets, in order to enable load balancing.

Since Cloudlets can be created and submitted to a broker in runtime, the number of arrived Cloudlets can be to much to existing VMs, requiring the creation of new VMs to balance the load. A HorizontalVmScaling implementation performs such up scaling by creating VMs as needed.


To enable horizontal down scaling to destroy idle VMs, the DatacenterBroker has to be used by setting a DatacenterBroker.getVmDestructionDelayFunction(). Since there is no Cloudlet migration mechanism (and it isn't intended to have), if a VM becomes underloaded, there is nothing that can be done until all Cloudlets finish executing. When that happens, the DatacenterBroker.getVmDestructionDelayFunction() will handle such a situation.

Since:
CloudSim Plus 1.0.0
Author:
Manoel Campos da Silva Filho
  • Field Details

  • Method Details

    • getVmSupplier

      Supplier<Vm> getVmSupplier()
      Gets a Supplier that will be used to create VMs when the Load Balancer detects that the current Broker's VMs are overloaded.
      Returns:
    • setVmSupplier

      HorizontalVmScaling setVmSupplier(Supplier<Vm> supplier)
      Sets a Supplier that will be used to create VMs when the Load Balancer detects that Broker's VMs are overloaded.
      Parameters:
      supplier - the supplier to set
      Returns:
    • requestUpScalingIfPredicateMatches

      boolean requestUpScalingIfPredicateMatches(VmHostEventInfo evt)
      Requests a horizontal scale if the Vm is overloaded, according to the getOverloadPredicate() predicate. The scaling is performed by creating a new Vm using the getVmSupplier() method and submitting it to the broker.

      The time interval in which it will be checked if the Vm is overloaded depends on the Datacenter.getSchedulingInterval() value. Make sure to set such a value to enable the periodic overload verification.

      The method will check the need to create a new VM at the time interval defined by the Datacenter.getSchedulingInterval(). A VM creation request is only sent when the VM is overloaded and new Cloudlets were submitted to the broker.

      Specified by:
      requestUpScalingIfPredicateMatches in interface VmScaling
      Parameters:
      evt - current simulation time
      Returns:
      true if the Vm is over or underloaded and up or down scaling request was sent to the broker; false otherwise
    • getOverloadPredicate

      Predicate<Vm> getOverloadPredicate()
      Gets a Predicate that defines when Vm is overloaded or not, that will make the Vm's DatacenterBroker to up scale the VM. The up scaling is performed by creating new VMs to attend new arrived Cloudlets and then balance the load.
      Returns:
      See Also:
    • setOverloadPredicate

      VmScaling setOverloadPredicate(Predicate<Vm> predicate)
      Sets a Predicate that defines when the Vm is overloaded or not, making the DatacenterBroker to up scale the VM. The up scaling is performed by creating new VMs to attend new arrived Cloudlets in order to balance the load.
      Parameters:
      predicate - a predicate that checks certain conditions to define a Vm as overloaded. The predicate receives the Vm that has to be checked. Such a condition can be defined, for instance, based on Vm's Vm.getCpuPercentUtilization(double) CPU usage} and/or any other VM resource usage. Despite the VmScaling already is already linked to a Vm, the Vm parameter for the Predicate enables reusing the same predicate to detect overload of different VMs.
      Returns: