Class VmAbstract

All Implemented Interfaces:
Comparable<Vm>, ChangeableId, CustomerEntity, ExecDelayable, Identifiable, Lifetimed, Machine<Resource>, ResourceStatsComputer<VmResourceStats>, Startable, SubmissionDelayable, UniquelyIdentifiable, TimeZoned, Resourceful, Vm
Direct Known Subclasses:
VmSimple

public abstract class VmAbstract extends CustomerEntityAbstract implements Vm
A base class for implementing Vms.
Since:
CloudSim Plus 8.3.0
Author:
Manoel Campos da Silva Filho
  • Field Details

  • Constructor Details

    • VmAbstract

      public VmAbstract(Vm sourceVm)
      A copy constructor that creates a VM based on the configuration of another one. The created VM will have the same MIPS capacity, number of PEs, BW, RAM and size of the given VM, but a default CloudletScheduler and no DatacenterBroker.
      Parameters:
      sourceVm - the VM to be cloned
    • VmAbstract

      protected VmAbstract(long id, long mipsCapacity, long pesNumber)
    • VmAbstract

      protected VmAbstract(long id, long mipsCapacity, long pesNumber, CloudletScheduler cloudletScheduler)
  • Method Details

    • setDefaultRamCapacity

      public static void setDefaultRamCapacity(long defaultCapacity)
      Sets the Default RAM capacity (in MB) for creating VMs. This value is used when the RAM capacity is not given in a VM constructor.
    • setDefaultBwCapacity

      public static void setDefaultBwCapacity(long defaultCapacity)
      Sets the Default Bandwidth capacity (in Mbps) for creating VMs. This value is used when the BW capacity is not given in a VM constructor.
    • setDefaultStorageCapacity

      public static void setDefaultStorageCapacity(long defaultCapacity)
      Sets the Default Storage capacity (in MB) for creating VMs. This value is used when the Storage capacity is not given in a VM constructor.
    • getFirstVm

      public static <T> VmAbstract getFirstVm(T vmOrList)
      Accepts a Vm or List<Vm>. If a Vm is given, it is returned. If a List is given, returns the first VM in that List.
      Type Parameters:
      T - the type of the parameter, which may be a Vm or List<Vm>
      Parameters:
      vmOrList - a single Vm object or a List<Vm>
      Returns:
      the Vm object or the first Vm inside the List (according to the given parameter)
    • getList

      public static <T> List<Vm> getList(T vmOrList)
      Accepts a Vm or List<Vm> and return a List<Vm>
      Type Parameters:
      T - the type of the parameter, which may be a Vm or List<Vm>
      Parameters:
      vmOrList - a single Vm object or a List<Vm>
      Returns:
      a List with 1 Vm object if a Vm instance is given; or a List<Vm> if a List is given
    • isVmList

      public static <T> boolean isVmList(T vmOrList)
      Checks if an object is a Vm or List<Vm>.
      Type Parameters:
      T - the type of the parameter, which may be a Vm or List<Vm>
      Parameters:
      vmOrList - a Vm List<Vm>
      Returns:
      true if it's a List<Vm>, false otherwise
    • getVmCount

      public static <T> int getVmCount(T vmOrList)
      Accepts a single Vm object or a List<Vm> and returns the number of Vms in the given object.
      Type Parameters:
      T - the type of the parameter, which may be a Vm or List<Vm>
      Parameters:
      vmOrList - a Vm List<Vm>
      Returns:
      1 if the given object is a single Vm object, List.size() if it's a List.
    • mutableAttributesInit

      protected void mutableAttributesInit()
    • updateProcessing

      public double updateProcessing(MipsShare mipsShare)
      Description copied from interface: Vm
      Updates the processing of cloudlets running on this VM at the current simulation time.
      Specified by:
      updateProcessing in interface Vm
      Parameters:
      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
    • updateProcessing

      public double updateProcessing(double currentTime, @NonNull @NonNull MipsShare mipsShare)
      Description copied from interface: Vm
      Updates the processing of cloudlets running on this VM.
      Specified by:
      updateProcessing in interface Vm
      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
    • setFreePesNumber

      public Vm setFreePesNumber(long freePesNumber)
      Sets the current number of free PEs.
      Returns:
      the new free pes number
    • addExpectedFreePesNumber

      public Vm addExpectedFreePesNumber(long pesToAdd)
      Adds a given number of expected free PEs to the total number of expected free PEs. This value is updated as cloudlets are assigned to VMs but not submitted to the broker for running yet.
      Parameters:
      pesToAdd - the number of expected free PEs to add
    • removeExpectedFreePesNumber

      public Vm removeExpectedFreePesNumber(long pesToRemove)
      Adds a given number of expected free PEs to the total number of expected free PEs. This value is updated as cloudlets are assigned to VMs but not submitted to the broker for running yet.
      Parameters:
      pesToRemove - the number of expected free PEs to remove
    • getCpuPercentUtilization

      public double getCpuPercentUtilization()
      Description copied from interface: Vm
      Gets the current percentage of CPU capacity (MIPS %) used by all Cloudlets running on this VM. It represents the actual percentage of MIPS allocated.
      Specified by:
      getCpuPercentUtilization in interface Vm
      Returns:
      total CPU utilization percentage (between [0 and 1]) for the current time
    • getCpuPercentUtilization

      public double getCpuPercentUtilization(double time)
      Description copied from interface: Vm
      Gets the percentage of CPU capacity (MIPS %) used by all Cloudlets running on this VM at the given time. It represents the actual percentage of MIPS allocated for that time.
      Specified by:
      getCpuPercentUtilization in interface Vm
      Parameters:
      time - the time to get the CPU utilization percentage
      Returns:
      total CPU utilization percentage (between [0 and 1])
    • getCpuPercentRequested

      public double getCpuPercentRequested()
      Description copied from interface: Vm
      Gets the percentage of CPU capacity (MIPS %) requested by all Cloudlets running on this VM at the current time. It represents the percentage of MIPS requested, which may be higher than the percentage used (allocated) due to lack of capacity.
      Specified by:
      getCpuPercentRequested in interface Vm
      Returns:
      the percentage (between [0 and 1]) of CPU capacity requested
      See Also:
    • getCpuPercentRequested

      public double getCpuPercentRequested(double time)
      Description copied from interface: Vm
      Gets the percentage of CPU capacity (MIPS %) requested by all Cloudlets running on this VM at the given time. It represents the percentage of MIPS requested for that time, which may be higher than the percentage used (allocated) due to lack of capacity.
      Specified by:
      getCpuPercentRequested in interface Vm
      Parameters:
      time - the time to get the CPU requested percentage
      Returns:
      the percentage (between [0 and 1]) of CPU capacity requested for the current time
      See Also:
    • 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
      Parameters:
      time - the time to get the relative VM CPU utilization
      Returns:
      the relative VM CPU usage percent (from 0 to 1)
    • getExpectedHostCpuUtilization

      public double getExpectedHostCpuUtilization(double vmCpuUtilizationPercent)
      Description copied from interface: Vm
      Computes what would be the relative percentage of the CPU the VM is using from a PM's total MIPS capacity, considering that the VM 's CPU load is at a given percentage.
      Specified by:
      getExpectedHostCpuUtilization in interface Vm
      Parameters:
      vmCpuUtilizationPercent - the VM's CPU utilization percentage for a given time
      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
      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
      Returns:
      the relative VM BW usage percent (from 0 to 1)
    • getTotalCpuMipsUtilization

      public double getTotalCpuMipsUtilization()
      Description copied from interface: Vm
      Gets the current total CPU MIPS utilization of all PEs from all cloudlets running on this VM.
      Specified by:
      getTotalCpuMipsUtilization in interface Vm
      Returns:
      total CPU utilization in MIPS
      See Also:
    • getTotalCpuMipsUtilization

      public double getTotalCpuMipsUtilization(double time)
      Description copied from interface: Vm
      Gets the total CPU MIPS utilization of all PEs from all cloudlets running on this VM at the given time.
      Specified by:
      getTotalCpuMipsUtilization in interface Vm
      Parameters:
      time - the time to get the utilization
      Returns:
      total CPU utilization in MIPS
      See Also:
    • getTotalCpuMipsRequested

      public double getTotalCpuMipsRequested()
      Description copied from interface: Vm
      Gets the current requested total MIPS. It is the sum of MIPS capacity requested for every virtual Pe.
      Specified by:
      getTotalCpuMipsRequested in interface Vm
      Returns:
      the current requested total MIPS
      See Also:
    • getCurrentRequestedMips

      public MipsShare getCurrentRequestedMips()
      Description copied from interface: Vm
      Gets a copy list of current requested MIPS of each virtual Pe, avoiding the original list to be changed.
      Specified by:
      getCurrentRequestedMips in interface Vm
      Returns:
      the current requested MIPS of each Pe
    • getCurrentRequestedBw

      public long getCurrentRequestedBw()
      Description copied from interface: Vm
      Gets the current requested bw.
      Specified by:
      getCurrentRequestedBw in interface Vm
      Returns:
      the current requested bw
    • getTotalMipsCapacity

      public double getTotalMipsCapacity()
      Specified by:
      getTotalMipsCapacity in interface Machine<Resource>
      Returns:
      total MIPS capacity across all PEs of the machine.
    • getCurrentRequestedRam

      public long getCurrentRequestedRam()
      Description copied from interface: Vm
      Gets the current requested ram (in Megabytes).
      Specified by:
      getCurrentRequestedRam in interface Vm
      Returns:
    • onStart

      protected void onStart(double time)
      Description copied from class: StartableAbstract
      Notifies when the entity is actually started.
      Specified by:
      onStart in class StartableAbstract
      Parameters:
      time - the new start time
    • onFinish

      protected void onFinish(double time)
      Description copied from class: StartableAbstract
      Notifies when the entity is actually finished.
      Specified by:
      onFinish in class StartableAbstract
      Parameters:
      time - the new finish time
    • hasStartedSomeCloudlet

      public boolean hasStartedSomeCloudlet()
      Checks if the VM has ever started some Cloudlet.
      Returns:
      true if the VM has started some Cloudlet, false otherwise
    • getMips

      public double getMips()
      Specified by:
      getMips in interface Machine<Resource>
      Returns:
      the individual MIPS capacity of any machine's Pe, considering that all PEs have the same capacity.
    • setMips

      protected final void setMips(double mips)
      Sets the individual MIPS capacity of any VM's PE, considering that all PEs have the same capacity.
      Parameters:
      mips - the new mips for every VM's PE
    • getPesNumber

      public long getPesNumber()
      Specified by:
      getPesNumber in interface Machine<Resource>
      Returns:
      the overall number of Pes the machine has, that include PEs of all statuses, including failed PEs.
    • setPesNumber

      protected void setPesNumber(long pesNumber)
    • setRam

      public final Vm setRam(long ramCapacity)
      Description copied from interface: Vm
      Sets RAM capacity in Megabytes.
      Specified by:
      setRam in interface Vm
      Parameters:
      ramCapacity - new RAM capacity
      Returns:
    • setBw

      public final Vm setBw(long bwCapacity)
      Description copied from interface: Vm
      Sets the bandwidth capacity (in Megabits/s)
      Specified by:
      setBw in interface Vm
      Parameters:
      bwCapacity - new BW capacity (in Megabits/s)
      Returns:
    • setStorage

      protected void setStorage(@NonNull @NonNull SimpleStorage storage)
      Sets a new SimpleStorage resource for the Vm.
      Parameters:
      storage - the storage resource to set
    • setSize

      public final Vm setSize(long size)
      Description copied from interface: Vm
      Sets the storage size (capacity) of the VM image in Megabytes.
      Specified by:
      setSize in interface Vm
      Parameters:
      size - new storage size
      Returns:
    • setHost

      public Vm setHost(@NonNull @NonNull Host host)
      Sets the PM that hosts the VM.
      Parameters:
      host - Host to run the VM
      Returns:
      this Vm
    • setCloudletScheduler

      public final Vm setCloudletScheduler(@NonNull @NonNull CloudletScheduler cloudletScheduler)
      Description copied from interface: Vm
      Sets the Cloudlet scheduler the Vm uses to schedule cloudlets execution. It also sets the Vm itself to the given scheduler.
      Specified by:
      setCloudletScheduler in interface Vm
      Parameters:
      cloudletScheduler - the cloudlet scheduler to set
      Returns:
    • updateMigrationStartListeners

      public void updateMigrationStartListeners(Host targetHost)
      Notifies the listeners when the VM starts migration to a target Host.
      Parameters:
      targetHost - the Host the VM is migrating to
    • updateMigrationFinishListeners

      public void updateMigrationFinishListeners(Host targetHost)
      Notifies the listeners when the VM finishes migration to a target Host.
      Parameters:
      targetHost - the Host the VM has just migrated to
    • isSuitableForCloudlet

      public boolean isSuitableForCloudlet(Cloudlet cloudlet)
      Description copied from interface: Vm
      Checks if the VM has enough capacity to run a Cloudlet.
      Specified by:
      isSuitableForCloudlet in interface Vm
      Parameters:
      cloudlet - the candidate Cloudlet to run inside the VM
      Returns:
      true if the VM can run the Cloudlet, false otherwise TODO the Method is not being called anywhere to check if a VM has enough capacity to run a Cloudlet
    • setCreated

      public void setCreated(boolean requestCreation)
      Changes the created status of the Vm inside the Host.
      Parameters:
      requestCreation - true to indicate the VM was created inside the Host; false otherwise
      See Also:
    • setStartTime

      public Startable setStartTime(double startTime)
      Description copied from interface: Startable
      Sets the current entity startup time. The value Startable.NOT_ASSIGNED means it was not started yet.
      Specified by:
      setStartTime in interface Startable
      Overrides:
      setStartTime in class StartableAbstract
      Parameters:
      startTime - the start time to set (in seconds)
      Returns:
      this entity
    • getStateHistory

      public List<VmStateHistoryEntry> getStateHistory()
      Description copied from interface: Vm
      Gets a read-only list with the history of requests and allocation of MIPS for this VM. The VM state history is just collected and stored if the Host is storing such a data.
      Specified by:
      getStateHistory in interface Vm
      Returns:
      the state history
      See Also:
    • addStateHistoryEntry

      public void addStateHistoryEntry(VmStateHistoryEntry entry)
      Description copied from interface: Vm
      Adds a VM state history entry.
      Specified by:
      addStateHistoryEntry in interface Vm
      Parameters:
      entry - the data about the state of the VM at given time
    • getResources

      public List<ResourceManageable> getResources()
      Specified by:
      getResources in interface Resourceful
      Returns:
      a read-only list of resources the machine has.
      See Also:
    • getResource

      public ResourceManageable getResource(Class<? extends ResourceManageable> resourceClass)
      Description copied from interface: Resourceful
      Gets a given Resource, such as Ram or Bandwidth, from the List of the Machine's resources.
      Specified by:
      getResource in interface Resourceful
      Parameters:
      resourceClass - the class of resource to get
      Returns:
      the Resource corresponding to the given class
    • addOnHostAllocationListener

      public Vm addOnHostAllocationListener(@NonNull @NonNull EventListener<VmHostEventInfo> listener)
      Description copied from interface: Vm
      Adds a listener object that will be notified when a Host is allocated to the Vm, that is, when the Vm is placed into a given Host. That happens when the VM is placed for the first time into a Host or when it's migrated to another Host.
      Specified by:
      addOnHostAllocationListener in interface Vm
      Parameters:
      listener - the listener to add
      Returns:
      See Also:
    • addOnMigrationStartListener

      public Vm addOnMigrationStartListener(@NonNull @NonNull EventListener<VmHostEventInfo> listener)
      Description copied from interface: Vm
      Adds a listener object that will be notified when a VM starts migrating to a target Host. When the listener is notified, it receives a VmHostEventInfo object informing the target Host where the VM is being migrated.
      Specified by:
      addOnMigrationStartListener in interface Vm
      Parameters:
      listener - the listener to add
      Returns:
      See Also:
    • addOnMigrationFinishListener

      public Vm addOnMigrationFinishListener(@NonNull @NonNull EventListener<VmHostEventInfo> listener)
      Description copied from interface: Vm
      Adds a listener object that will be notified when a VM finishes migrating to a target Host. When the listener is notified, it receives a VmHostEventInfo object informing the target Host where the VM has just migrated.
      Specified by:
      addOnMigrationFinishListener in interface Vm
      Parameters:
      listener - the listener to add
      Returns:
    • addOnHostDeallocationListener

      public Vm addOnHostDeallocationListener(@NonNull @NonNull EventListener<VmHostEventInfo> listener)
      Description copied from interface: Vm
      Adds a listener object that will be notified when the Vm is moved/removed from a Host.
      Specified by:
      addOnHostDeallocationListener in interface Vm
      Parameters:
      listener - the listener to add
      Returns:
    • addOnCreationFailureListener

      public Vm addOnCreationFailureListener(@NonNull @NonNull EventListener<VmDatacenterEventInfo> listener)
      Description copied from interface: Vm
      Adds a listener object that will be notified when the Vm fail in being placed, due to lack of a Host with enough resources in a specific Datacenter.

      The DatacenterBroker is accountable for receiving the notification from the Datacenter and notifying the Listeners.

      Specified by:
      addOnCreationFailureListener in interface Vm
      Parameters:
      listener - the listener to add
      Returns:
      See Also:
    • addOnUpdateProcessingListener

      public Vm addOnUpdateProcessingListener(@NonNull @NonNull EventListener<VmHostEventInfo> listener)
      Description copied from interface: Vm
      Adds a listener object that will be notified every time when the processing of the Vm is updated in its Host.
      Specified by:
      addOnUpdateProcessingListener in interface Vm
      Parameters:
      listener - the listener to add
      Returns:
      See Also:
    • removeOnCreationFailureListener

      public boolean removeOnCreationFailureListener(@NonNull @NonNull EventListener<VmDatacenterEventInfo> listener)
      Description copied from interface: Vm
      Removes a listener from the onVmCreationFailureListener List.
      Specified by:
      removeOnCreationFailureListener in interface Vm
      Parameters:
      listener - the listener to remove
      Returns:
      true if the listener was found and removed, false otherwise
    • removeOnUpdateProcessingListener

      public boolean removeOnUpdateProcessingListener(@NonNull @NonNull EventListener<VmHostEventInfo> listener)
      Description copied from interface: Vm
      Removes a listener from the onUpdateVmProcessingListener List.
      Specified by:
      removeOnUpdateProcessingListener in interface Vm
      Parameters:
      listener - the listener to remove
      Returns:
      true if the listener was found and removed, false otherwise
    • removeOnHostAllocationListener

      public boolean removeOnHostAllocationListener(@NonNull @NonNull EventListener<VmHostEventInfo> listener)
      Description copied from interface: Vm
      Removes a listener from the onHostAllocationListener List.
      Specified by:
      removeOnHostAllocationListener in interface Vm
      Parameters:
      listener - the listener to remove
      Returns:
      true if the listener was found and removed, false otherwise
    • removeOnHostDeallocationListener

      public boolean removeOnHostDeallocationListener(@NonNull @NonNull EventListener<VmHostEventInfo> listener)
      Description copied from interface: Vm
      Removes a listener from the onHostDeallocationListener List.
      Specified by:
      removeOnHostDeallocationListener in interface Vm
      Parameters:
      listener - the listener to remove
      Returns:
      true if the listener was found and removed, false otherwise
    • setFailed

      public void setFailed(boolean failed)
      Description copied from interface: Vm
      Sets the status of VM to FAILED.
      Specified by:
      setFailed in interface Vm
      Parameters:
      failed - true to indicate that the VM is failed, false to indicate it is working
    • setCloudletsToFailed

      public void setCloudletsToFailed()
    • isWorking

      public boolean isWorking()
      Description copied from interface: Vm
      Checks if the Vm is working or failed.
      Specified by:
      isWorking in interface Vm
      Returns:
      See Also:
    • setSubmissionDelay

      public final void setSubmissionDelay(double submissionDelay)
      Description copied from interface: SubmissionDelayable
      Sets a relative time (in seconds), from current simulation time, that a DatacenterBroker will wait to submit the entity to a Datacenter, in order to request the creation of the object. This is a relative time from the current simulation time.
      Specified by:
      setSubmissionDelay in interface SubmissionDelayable
      Parameters:
      submissionDelay - the number of seconds from the current simulation time that the object will wait to be submitted
    • isSubmissionDelayed

      public boolean isSubmissionDelayed()
      Specified by:
      isSubmissionDelayed in interface SubmissionDelayable
      Returns:
      true if this object has a submission delay, false otherwise
    • notifyOnHostAllocationListeners

      public void notifyOnHostAllocationListeners()
      Description copied from interface: Vm
      Notifies all registered listeners when a Host is allocated to the Vm.

      This method is used just internally and must not be called directly.

      Specified by:
      notifyOnHostAllocationListeners in interface Vm
    • notifyOnHostDeallocationListeners

      public void notifyOnHostDeallocationListeners(@NonNull @NonNull Host deallocatedHost)
      Description copied from interface: Vm
      Notifies all registered listeners when the Vm is moved/removed from a Host.

      This method is used just internally and must not be called directly.

      Specified by:
      notifyOnHostDeallocationListeners in interface Vm
      Parameters:
      deallocatedHost - the Host the Vm was moved/removed from
    • notifyOnUpdateProcessingListeners

      public void notifyOnUpdateProcessingListeners()
      Notifies all registered listeners when the processing of the Vm is updated in its Host.
    • notifyOnCreationFailureListeners

      public void notifyOnCreationFailureListeners(@NonNull @NonNull Datacenter failedDatacenter)
      Description copied from interface: Vm
      Notifies all registered listeners when the Vm fail in being placed for lack of a Host with enough resources in a specific Datacenter.

      This method is used just internally and must not be called directly.

      Specified by:
      notifyOnCreationFailureListeners in interface Vm
      Parameters:
      failedDatacenter - the Datacenter where the VM creation failed
    • removeOnMigrationStartListener

      public boolean removeOnMigrationStartListener(@NonNull @NonNull EventListener<VmHostEventInfo> listener)
      Description copied from interface: Vm
      Removes a listener from the onMigrationStartListener List.
      Specified by:
      removeOnMigrationStartListener in interface Vm
      Parameters:
      listener - the listener to remove
      Returns:
      true if the listener was found and removed, false otherwise
    • removeOnMigrationFinishListener

      public boolean removeOnMigrationFinishListener(@NonNull @NonNull EventListener<VmHostEventInfo> listener)
      Description copied from interface: Vm
      Removes a listener from the onMigrationFinishListener List.
      Specified by:
      removeOnMigrationFinishListener in interface Vm
      Parameters:
      listener - the listener to remove
      Returns:
      true if the listener was found and removed, false otherwise
    • setHorizontalScaling

      public final Vm setHorizontalScaling(HorizontalVmScaling horizontalScaling) throws IllegalArgumentException
      Description copied from interface: Vm
      Sets a HorizontalVmScaling that will check if the Vm is overloaded, based on some conditions defined by a Predicate given to the HorizontalVmScaling, and then request the creation of new VMs to horizontally scale the Vm.
      Specified by:
      setHorizontalScaling in interface Vm
      Parameters:
      horizontalScaling - the HorizontalVmScaling to set
      Returns:
      Throws:
      IllegalArgumentException - if the given VmScaling is already linked to a Vm. Each VM must have its own HorizontalVmScaling object or none at all.
    • setRamVerticalScaling

      public final Vm setRamVerticalScaling(VerticalVmScaling ramVerticalScaling) throws IllegalArgumentException
      Description copied from interface: Vm
      Sets a VerticalVmScaling that will check if the Vm's Ram is under or overloaded, based on some conditions defined by Predicates given to the VerticalVmScaling, and then request the RAM up or down scaling.
      Specified by:
      setRamVerticalScaling in interface Vm
      Parameters:
      ramVerticalScaling - the VerticalVmScaling to set
      Returns:
      Throws:
      IllegalArgumentException - if the given VmScaling is already linked to a Vm. Each VM must have its own VerticalVmScaling objects or none at all.
    • setBwVerticalScaling

      public final Vm setBwVerticalScaling(VerticalVmScaling bwVerticalScaling) throws IllegalArgumentException
      Description copied from interface: Vm
      Sets a VerticalVmScaling that will check if the Vm's Bandwidth is under or overloaded, based on some conditions defined by Predicates given to the VerticalVmScaling, and then request the Bandwidth up or down scaling.
      Specified by:
      setBwVerticalScaling in interface Vm
      Parameters:
      bwVerticalScaling - the VerticalVmScaling to set
      Returns:
      Throws:
      IllegalArgumentException - if the given VmScaling is already linked to a Vm. Each VM must have its own VerticalVmScaling objects or none at all.
    • setPeVerticalScaling

      public final Vm setPeVerticalScaling(VerticalVmScaling peVerticalScaling) throws IllegalArgumentException
      Description copied from interface: Vm
      Sets a VerticalVmScaling that will check if the Vm's Pe is under or overloaded, based on some conditions defined by Predicates given to the VerticalVmScaling, and then request the Pe up or down scaling.

      The Pe scaling is performed by adding or removing PEs to/from the VM. Added PEs will have the same MIPS than the already existing ones.

      Specified by:
      setPeVerticalScaling in interface Vm
      Parameters:
      peVerticalScaling - the VerticalVmScaling to set
      Returns:
      Throws:
      IllegalArgumentException - if the given VmScaling is already linked to a Vm. Each VM must have its own VerticalVmScaling objects or none at all.
    • enableUtilizationStats

      public void enableUtilizationStats()
      Description copied from interface: Vm
      Enables the data collection and computation of utilization statistics. If you enable the statistics for the Host where the VM is placed, that will automatically enable the statistics for every VM on that Host.
      Specified by:
      enableUtilizationStats in interface ResourceStatsComputer<VmResourceStats>
      Specified by:
      enableUtilizationStats in interface Vm
      See Also:
    • setTimeZone

      public 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
      Parameters:
      timeZone - the new expected time zone offset
      Returns:
    • isFinished

      public boolean isFinished()
      Specified by:
      isFinished in interface Startable
      Returns:
      true if this entity has finished execution; false otherwise
    • getRam

      public Ram getRam()
      Description copied from interface: Vm
      Gets the RAM resource assigned to the Vm, allowing to check its capacity (in Megabytes) and usage.
      Specified by:
      getRam in interface Machine<Resource>
      Specified by:
      getRam in interface Vm
      Returns:
      the RAM resource
    • setDescription

      public Vm setDescription(String description)
      Description copied from interface: Vm
      Sets the Vm description, an optional text which can be used to provide details about this VM.
      Specified by:
      setDescription in interface Vm
      Parameters:
      description - the Vm description to set
    • setVmm

      public Vm setVmm(String vmm)
    • setGroup

      public Vm setGroup(VmGroup group)
    • setInMigration

      public Vm setInMigration(boolean inMigration)
      Description copied from interface: Vm
      Defines if the VM is in migration process or not.
      Specified by:
      setInMigration in interface Vm
      Parameters:
      inMigration - true to indicate the VM is migrating into a Host, false otherwise
    • setAllocatedMips

      public Vm setAllocatedMips(MipsShare allocatedMips)
    • setRequestedMips

      public Vm setRequestedMips(MipsShare requestedMips)
    • shutdown

      public void shutdown()
      Description copied from interface: ExecDelayable
      Sends a request to shut down the entity.
      Specified by:
      shutdown in interface ExecDelayable
      Specified by:
      shutdown in interface Vm
      See Also: