Class VmGroup

All Implemented Interfaces:
Comparable<Vm>, AbstractMachine<Resource>, ChangeableId, CustomerEntity, Delayable, Identifiable, ResourceStatsComputer<VmResourceStats>, UniquelyIdentifiable, TimeZoned, Resourceful, Vm

public class VmGroup extends VmSimple
Represents a List of VMs that form a group, so that should be placed together at the same, according to resource availability. This way, such an object is not an actual Vm, but a mock used to check if all the resources required by all VMs inside the group are available at a single Host.

It assumes all VMs belong to the same DatacenterBroker.

Since:
CloudSim Plus 4.6.0
Author:
Manoel Campos da Silva Filho
  • Constructor Details

    • VmGroup

      public VmGroup(List<Vm> vmList)
      Creates a VmGroup for a List of VMs.
      Parameters:
      vmList - the List of VMs to create the group
    • VmGroup

      public VmGroup(List<Vm> vmList, double timeZone)
      Creates a VmGroup for a List of VMs to be placed at the datacenter closest to a given timezone. All VMs will be changed to the given timezone.
      Parameters:
      vmList - the List of VMs to create the group
      timeZone - the timezone of the Datacenter where it's expected the VMs to be placed as close as possible
      See Also:
    • VmGroup

      public VmGroup(long id, List<Vm> vmList, double timeZone)
      Creates a VmGroup for a List of VMs to be placed at the datacenter closest to a given timezone. All VMs will be changed to the given timezone.
      Parameters:
      id - the VmGroup ID
      vmList - the List of VMs to create the group
      timeZone - the timezone of the Datacenter where it's expected the VMs to be placed as close as possible
      See Also:
  • Method Details

    • getHostCpuUtilization

      public double getHostCpuUtilization(double time)
      Description copied from interface: Vm
      Computes the relative percentage of the CPU the VM is using from the Host's total MIPS capacity for the current simulation time. If the capacity is 1000 MIPS and the VM is using 250 MIPS, it's equivalent to 25% of the Host's capacity.
      Specified by:
      getHostCpuUtilization in interface Vm
      Overrides:
      getHostCpuUtilization in class VmSimple
      Parameters:
      time - the time to get the relative VM CPU utilization
      Returns:
      the relative VM CPU usage percent (from 0 to 1)
    • getHostRamUtilization

      public double getHostRamUtilization()
      Description copied from interface: Vm
      Computes the relative percentage of the RAM the VM is using from the Host's total Capacity for the current simulation time.
      Specified by:
      getHostRamUtilization in interface Vm
      Overrides:
      getHostRamUtilization in class VmSimple
      Returns:
      the relative VM RAM usage percent (from 0 to 1)
    • getHostBwUtilization

      public double getHostBwUtilization()
      Description copied from interface: Vm
      Computes the relative percentage of the Bandwidth the VM is using from the Host's total capacity for the current simulation time.
      Specified by:
      getHostBwUtilization in interface Vm
      Overrides:
      getHostBwUtilization in class VmSimple
      Returns:
      the relative VM BW usage percent (from 0 to 1)
    • setTimeZone

      public final Vm setTimeZone(double timeZone)
      Description copied from interface: Vm
      Sets the time zone offset between [TimeZoned.MIN_TIME_ZONE_OFFSET and TimeZoned.MAX_TIME_ZONE_OFFSET]. That is the timezone in which the VM is expected to be placed (if there is a Datacenter with enough capacity available at that timezone).
      Specified by:
      setTimeZone in interface TimeZoned
      Specified by:
      setTimeZone in interface Vm
      Overrides:
      setTimeZone in class VmSimple
      Parameters:
      timeZone - the new expected time zone offset
      Returns:
    • getVmList

      public List<Vm> getVmList()
      Gets the List of VMs belonging to this group.
      Returns:
    • size

      public int size()
      Gets the number of VMs in this group.
      Returns:
    • updateProcessing

      public double updateProcessing(double currentTime, MipsShare mipsShare)
      Description copied from interface: Vm
      Updates the processing of cloudlets running on this VM.
      Specified by:
      updateProcessing in interface Vm
      Overrides:
      updateProcessing in class VmSimple
      Parameters:
      currentTime - current simulation time
      mipsShare - list with MIPS share of each Pe available to the scheduler
      Returns:
      the predicted completion time of the earliest finishing cloudlet (which is a relative delay from the current simulation time), or Double.MAX_VALUE if there is no next Cloudlet to execute