Class VmAbstract
java.lang.Object
org.cloudsimplus.core.StartableAbstract
org.cloudsimplus.core.ExecDelayableAbstract
org.cloudsimplus.core.CustomerEntityAbstract
org.cloudsimplus.vms.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
A base class for implementing
Vms.- Since:
- CloudSim Plus 8.3.0
- Author:
- Manoel Campos da Silva Filho
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected @NonNull MipsShareprotected Stringprotected longprotected longprotected final List<EventListener<VmDatacenterEventInfo>> protected final List<EventListener<VmHostEventInfo>> protected final List<EventListener<VmHostEventInfo>> protected final List<EventListener<VmHostEventInfo>> protected final List<EventListener<VmHostEventInfo>> protected final List<EventListener<VmHostEventInfo>> protected final Processorprotected @NonNull MipsShareprotected List<ResourceManageable> protected final List<VmStateHistoryEntry> Fields inherited from interface org.cloudsimplus.core.Startable
NOT_ASSIGNEDFields inherited from interface org.cloudsimplus.datacenters.TimeZoned
MAX_TIME_ZONE_OFFSET, MIN_TIME_ZONE_OFFSET -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedVmAbstract(long id, long mipsCapacity, long pesNumber) protectedVmAbstract(long id, long mipsCapacity, long pesNumber, CloudletScheduler cloudletScheduler) VmAbstract(Vm sourceVm) A copy constructor that creates a VM based on the configuration of another one. -
Method Summary
Modifier and TypeMethodDescriptionaddExpectedFreePesNumber(long pesToAdd) Adds a given number of expected free PEs to the total number of expected free PEs.addOnCreationFailureListener(@NonNull EventListener<VmDatacenterEventInfo> listener) Adds a listener object that will be notified when the Vm fail in being placed, due to lack of aHostwith enough resources in a specificDatacenter.addOnHostAllocationListener(@NonNull EventListener<VmHostEventInfo> listener) Adds a listener object that will be notified when aHostis allocated to the Vm, that is, when the Vm is placed into a given Host.addOnHostDeallocationListener(@NonNull EventListener<VmHostEventInfo> listener) Adds a listener object that will be notified when the Vm is moved/removed from aHost.addOnMigrationFinishListener(@NonNull EventListener<VmHostEventInfo> listener) Adds a listener object that will be notified when a VM finishes migrating to a targetHost.addOnMigrationStartListener(@NonNull EventListener<VmHostEventInfo> listener) Adds a listener object that will be notified when a VM starts migrating to a targetHost.addOnUpdateProcessingListener(@NonNull EventListener<VmHostEventInfo> listener) Adds a listener object that will be notified every time when the processing of the Vm is updated in itsHost.voidAdds a VM state history entry.voidEnables the data collection and computation of utilization statistics.doubleGets the percentage of CPU capacity (MIPS %) requested by all Cloudlets running on this VM at the current time.doublegetCpuPercentRequested(double time) Gets the percentage of CPU capacity (MIPS %) requested by all Cloudlets running on this VM at the given time.doubleGets the current percentage of CPU capacity (MIPS %) used by all Cloudlets running on this VM.doublegetCpuPercentUtilization(double time) Gets the percentage of CPU capacity (MIPS %) used by all Cloudlets running on this VM at the given time.longGets the current requested bw.Gets a copy list of current requested MIPS of each virtualPe, avoiding the original list to be changed.longGets the current requested ram (in Megabytes).doublegetExpectedHostCpuUtilization(double vmCpuUtilizationPercent) 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.static <T> VmAbstractgetFirstVm(T vmOrList) Accepts a Vm orList<Vm>.doubleComputes the relative percentage of the Bandwidth the VM is using from the Host's total capacity for the current simulation time.doublegetHostCpuUtilization(double time) Computes the relative percentage of the CPU the VM is using from the Host's total MIPS capacity for the current simulation time.doubleComputes the relative percentage of the RAM the VM is using from the Host's total Capacity for the current simulation time.getList(T vmOrList) Accepts a Vm orList<Vm>and return aList<Vm>doublegetMips()longgetRam()Gets the RAM resource assigned to the Vm, allowing to check its capacity (in Megabytes) and usage.getResource(Class<? extends ResourceManageable> resourceClass) Gets a read-only list with the history of requests and allocation of MIPS for this VM.doubleGets the current requested total MIPS.doubleGets the current total CPU MIPS utilization of all PEs from all cloudlets running on this VM.doublegetTotalCpuMipsUtilization(double time) Gets the total CPU MIPS utilization of all PEs from all cloudlets running on this VM at the given time.doublestatic <T> intgetVmCount(T vmOrList) Accepts a single Vm object or aList<Vm>and returns the number of Vms in the given object.booleanChecks if the VM has ever started some Cloudlet.booleanbooleanbooleanisSuitableForCloudlet(Cloudlet cloudlet) Checks if the VM has enough capacity to run a Cloudlet.static <T> booleanisVmList(T vmOrList) Checks if an object is a Vm orList<Vm>.booleanChecks if the Vm is working or failed.protected voidvoidnotifyOnCreationFailureListeners(@NonNull Datacenter failedDatacenter) Notifies all registered listeners when the Vm fail in being placed for lack of aHostwith enough resources in a specificDatacenter.voidvoidnotifyOnHostDeallocationListeners(@NonNull Host deallocatedHost) voidNotifies all registered listeners when the processing of the Vm is updated in itsHost.protected voidonFinish(double time) Notifies when the entity is actually finished.protected voidonStart(double time) Notifies when the entity is actually started.removeExpectedFreePesNumber(long pesToRemove) Adds a given number of expected free PEs to the total number of expected free PEs.booleanremoveOnCreationFailureListener(@NonNull EventListener<VmDatacenterEventInfo> listener) Removes a listener from the onVmCreationFailureListener List.booleanremoveOnHostAllocationListener(@NonNull EventListener<VmHostEventInfo> listener) Removes a listener from the onHostAllocationListener List.booleanremoveOnHostDeallocationListener(@NonNull EventListener<VmHostEventInfo> listener) Removes a listener from the onHostDeallocationListener List.booleanremoveOnMigrationFinishListener(@NonNull EventListener<VmHostEventInfo> listener) Removes a listener from the onMigrationFinishListener List.booleanremoveOnMigrationStartListener(@NonNull EventListener<VmHostEventInfo> listener) Removes a listener from the onMigrationStartListener List.booleanremoveOnUpdateProcessingListener(@NonNull EventListener<VmHostEventInfo> listener) Removes a listener from the onUpdateVmProcessingListener List.setAllocatedMips(MipsShare allocatedMips) final VmsetBw(long bwCapacity) Sets the bandwidth capacity (in Megabits/s)final VmsetBwVerticalScaling(VerticalVmScaling bwVerticalScaling) Sets aVerticalVmScalingthat will check if the Vm'sBandwidthis under or overloaded, based on some conditions defined byPredicates given to the VerticalVmScaling, and then request the Bandwidth up or down scaling.final VmsetCloudletScheduler(@NonNull CloudletScheduler cloudletScheduler) Sets the Cloudlet scheduler the Vm uses to schedule cloudlets execution.voidvoidsetCreated(boolean requestCreation) Changes the created status of the Vm inside the Host.static voidsetDefaultBwCapacity(long defaultCapacity) Sets the Default Bandwidth capacity (in Mbps) for creating VMs.static voidsetDefaultRamCapacity(long defaultCapacity) Sets the Default RAM capacity (in MB) for creating VMs.static voidsetDefaultStorageCapacity(long defaultCapacity) Sets the Default Storage capacity (in MB) for creating VMs.setDescription(String description) Sets the Vm description, an optional text which can be used to provide details about this VM.voidsetFailed(boolean failed) Sets the status of VM to FAILED.setFreePesNumber(long freePesNumber) Sets the current number of free PEs.final VmsetHorizontalScaling(HorizontalVmScaling horizontalScaling) Sets aHorizontalVmScalingthat will check if the Vm is overloaded, based on some conditions defined by aPredicategiven to the HorizontalVmScaling, and then request the creation of new VMs to horizontally scale the Vm.Sets the PM that hosts the VM.setInMigration(boolean inMigration) Defines if the VM is in migration process or not.protected final voidsetMips(double mips) Sets the individual MIPS capacity of any VM's PE, considering that all PEs have the same capacity.protected voidsetPesNumber(long pesNumber) final VmsetPeVerticalScaling(VerticalVmScaling peVerticalScaling) Sets aVerticalVmScalingthat will check if the Vm'sPeis under or overloaded, based on some conditions defined byPredicates given to the VerticalVmScaling, and then request the Pe up or down scaling.final VmsetRam(long ramCapacity) Sets RAM capacity in Megabytes.final VmsetRamVerticalScaling(VerticalVmScaling ramVerticalScaling) Sets aVerticalVmScalingthat will check if the Vm'sRamis under or overloaded, based on some conditions defined byPredicates given to the VerticalVmScaling, and then request the RAM up or down scaling.setRequestedMips(MipsShare requestedMips) final VmsetSize(long size) Sets the storage size (capacity) of the VM image in Megabytes.setStartTime(double startTime) Sets the current entity startup time.protected voidsetStorage(@NonNull SimpleStorage storage) Sets a newSimpleStorageresource for the Vm.final voidsetSubmissionDelay(double submissionDelay) Sets a relative time (in seconds), from current simulation time, that aDatacenterBrokerwill wait to submit the entity to a Datacenter, in order to request the creation of the object.setTimeZone(double timeZone) Sets the time zone offset between [TimeZoned.MIN_TIME_ZONE_OFFSETandTimeZoned.MAX_TIME_ZONE_OFFSET].voidshutdown()Sends a request to shut down the entity.voidupdateMigrationFinishListeners(Host targetHost) Notifies the listeners when the VM finishes migration to a target Host.voidupdateMigrationStartListeners(Host targetHost) Notifies the listeners when the VM starts migration to a target Host.doubleupdateProcessing(double currentTime, @NonNull MipsShare mipsShare) Updates the processing of cloudlets running on this VM.doubleupdateProcessing(MipsShare mipsShare) Updates the processing of cloudlets running on this VM at the current simulation time.Methods inherited from class org.cloudsimplus.core.CustomerEntityAbstract
getCreationWaitTime, getSimulation, getUid, setCreationTime, setCreationTime, setLifeTimeMethods inherited from class org.cloudsimplus.core.ExecDelayableAbstract
isShuttingDown, setShutDownDelay, setStartupDelayMethods inherited from class org.cloudsimplus.core.StartableAbstract
getTotalExecutionTime, setFinishTimeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cloudsimplus.core.ChangeableId
setIdMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.cloudsimplus.core.CustomerEntity
getBrokerArrivalTime, getCreationTime, getCreationWaitTime, getFinishTime, getLastTriedDatacenter, setBrokerArrivalTime, setLastTriedDatacenterMethods inherited from interface org.cloudsimplus.core.ExecDelayable
getRemainingStartupTime, getShutdownBeginTime, getShutDownDelay, getStartupCompletionTime, getStartupDelay, isShutDownDelayed, isShuttingDown, isStartupDelayed, setShutdownBeginTime, setShutDownDelayMethods inherited from interface org.cloudsimplus.core.Identifiable
getIdMethods inherited from interface org.cloudsimplus.core.Lifetimed
isLifeTimeReachedMethods inherited from interface org.cloudsimplus.core.Machine
getIdleInterval, getLastBusyTime, getSimulation, isIdleMethods inherited from interface org.cloudsimplus.core.ResourceStatsComputer
getCpuUtilizationStatsMethods inherited from interface org.cloudsimplus.core.Startable
getStartTime, hasStarted, setFinishTime, setLastBusyTimeMethods inherited from interface org.cloudsimplus.core.SubmissionDelayable
getSubmissionDelayMethods inherited from interface org.cloudsimplus.datacenters.TimeZoned
distance, validateTimeZoneMethods inherited from interface org.cloudsimplus.core.UniquelyIdentifiable
getUidMethods inherited from interface org.cloudsimplus.vms.Vm
getBootModel, getBroker, getBw, getBwVerticalScaling, getCloudletScheduler, getDescription, getExpectedFreePesNumber, getFreePesNumber, getGroup, getHorizontalScaling, getHost, getHostCpuUtilization, getLifeTime, getPeVerticalScaling, getProcessor, getRamVerticalScaling, getStorage, getTimeZone, getTotalExecutionTime, getVmm, isCreated, isFailed, isIdleEnough, isInMigration, isStartingUp, setBootModel, setBroker, setLifeTime, setStartupDelay
-
Field Details
-
processor
-
stateHistory
- See Also:
-
onMigrationStartListeners
-
onMigrationFinishListeners
-
onHostAllocationListeners
-
onHostDeallocationListeners
-
onUpdateProcessingListeners
-
onCreationFailureListeners
-
resources
-
description
-
freePesNumber
protected long freePesNumber -
expectedFreePesNumber
protected long expectedFreePesNumber -
allocatedMips
-
requestedMips
-
-
Constructor Details
-
VmAbstract
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 defaultCloudletSchedulerand noDatacenterBroker.- 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
Accepts a Vm orList<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 orList<Vm>- Parameters:
vmOrList- a single Vm object or aList<Vm>- Returns:
- the Vm object or the first Vm inside the List (according to the given parameter)
-
getList
Accepts a Vm orList<Vm>and return aList<Vm>- Type Parameters:
T- the type of the parameter, which may be a Vm orList<Vm>- Parameters:
vmOrList- a single Vm object or aList<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 orList<Vm>.- Type Parameters:
T- the type of the parameter, which may be a Vm orList<Vm>- Parameters:
vmOrList- a VmList<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 aList<Vm>and returns the number of Vms in the given object.- Type Parameters:
T- the type of the parameter, which may be a Vm orList<Vm>- Parameters:
vmOrList- a VmList<Vm>- Returns:
- 1 if the given object is a single Vm object,
List.size()if it's a List.
-
mutableAttributesInit
protected void mutableAttributesInit() -
setFreePesNumber
Sets the current number of free PEs.- Returns:
- the new free pes number
-
addExpectedFreePesNumber
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
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:VmGets 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:
getCpuPercentUtilizationin interfaceVm- Returns:
- total CPU utilization percentage (between [0 and 1]) for the current time
-
getCpuPercentUtilization
public double getCpuPercentUtilization(double time) Description copied from interface:VmGets 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:
getCpuPercentUtilizationin interfaceVm- 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:VmGets 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:
getCpuPercentRequestedin interfaceVm- Returns:
- the percentage (between [0 and 1]) of CPU capacity requested
- See Also:
-
getCpuPercentRequested
public double getCpuPercentRequested(double time) Description copied from interface:VmGets 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:
getCpuPercentRequestedin interfaceVm- 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:VmComputes 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:
getHostCpuUtilizationin interfaceVm- 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:VmComputes 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:
getExpectedHostCpuUtilizationin interfaceVm- 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:VmComputes the relative percentage of the RAM the VM is using from the Host's total Capacity for the current simulation time.- Specified by:
getHostRamUtilizationin interfaceVm- Returns:
- the relative VM RAM usage percent (from 0 to 1)
-
getHostBwUtilization
public double getHostBwUtilization()Description copied from interface:VmComputes the relative percentage of the Bandwidth the VM is using from the Host's total capacity for the current simulation time.- Specified by:
getHostBwUtilizationin interfaceVm- Returns:
- the relative VM BW usage percent (from 0 to 1)
-
getTotalCpuMipsUtilization
public double getTotalCpuMipsUtilization()Description copied from interface:VmGets the current total CPU MIPS utilization of all PEs from all cloudlets running on this VM.- Specified by:
getTotalCpuMipsUtilizationin interfaceVm- Returns:
- total CPU utilization in MIPS
- See Also:
-
getTotalCpuMipsUtilization
public double getTotalCpuMipsUtilization(double time) Description copied from interface:VmGets the total CPU MIPS utilization of all PEs from all cloudlets running on this VM at the given time.- Specified by:
getTotalCpuMipsUtilizationin interfaceVm- Parameters:
time- the time to get the utilization- Returns:
- total CPU utilization in MIPS
- See Also:
-
getTotalCpuMipsRequested
public double getTotalCpuMipsRequested()Description copied from interface:VmGets the current requested total MIPS. It is the sum of MIPS capacity requested for every virtualPe.- Specified by:
getTotalCpuMipsRequestedin interfaceVm- Returns:
- the current requested total MIPS
- See Also:
-
getCurrentRequestedMips
Description copied from interface:VmGets a copy list of current requested MIPS of each virtualPe, avoiding the original list to be changed.- Specified by:
getCurrentRequestedMipsin interfaceVm- Returns:
- the current requested MIPS of each Pe
-
getCurrentRequestedBw
public long getCurrentRequestedBw()Description copied from interface:VmGets the current requested bw.- Specified by:
getCurrentRequestedBwin interfaceVm- Returns:
- the current requested bw
-
getTotalMipsCapacity
public double getTotalMipsCapacity()- Specified by:
getTotalMipsCapacityin interfaceMachine<Resource>- Returns:
- total MIPS capacity across all PEs of the machine.
-
getCurrentRequestedRam
public long getCurrentRequestedRam()Description copied from interface:VmGets the current requested ram (in Megabytes).- Specified by:
getCurrentRequestedRamin interfaceVm- Returns:
-
onStart
protected void onStart(double time) Description copied from class:StartableAbstractNotifies when the entity is actually started.- Specified by:
onStartin classStartableAbstract- Parameters:
time- the new start time
-
onFinish
protected void onFinish(double time) Description copied from class:StartableAbstractNotifies when the entity is actually finished.- Specified by:
onFinishin classStartableAbstract- 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
-
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:
getPesNumberin interfaceMachine<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
-
setBw
-
setStorage
Sets a newSimpleStorageresource for the Vm.- Parameters:
storage- the storage resource to set
-
setSize
-
setHost
-
setCloudletScheduler
Description copied from interface:VmSets the Cloudlet scheduler the Vm uses to schedule cloudlets execution. It also sets the Vm itself to the given scheduler.- Specified by:
setCloudletSchedulerin interfaceVm- Parameters:
cloudletScheduler- the cloudlet scheduler to set- Returns:
-
updateMigrationStartListeners
Notifies the listeners when the VM starts migration to a target Host.- Parameters:
targetHost- the Host the VM is migrating to
-
updateMigrationFinishListeners
Notifies the listeners when the VM finishes migration to a target Host.- Parameters:
targetHost- the Host the VM has just migrated to
-
isSuitableForCloudlet
Description copied from interface:VmChecks if the VM has enough capacity to run a Cloudlet.- Specified by:
isSuitableForCloudletin interfaceVm- 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
Description copied from interface:StartableSets the current entity startup time. The valueStartable.NOT_ASSIGNEDmeans it was not started yet.- Specified by:
setStartTimein interfaceStartable- Overrides:
setStartTimein classStartableAbstract- Parameters:
startTime- the start time to set (in seconds)- Returns:
- this entity
-
getStateHistory
Description copied from interface:VmGets 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:
getStateHistoryin interfaceVm- Returns:
- the state history
- See Also:
-
addStateHistoryEntry
Description copied from interface:VmAdds a VM state history entry.- Specified by:
addStateHistoryEntryin interfaceVm- Parameters:
entry- the data about the state of the VM at given time
-
getResources
- Specified by:
getResourcesin interfaceResourceful- Returns:
- a read-only list of resources the machine has.
- See Also:
-
getResource
Description copied from interface:Resourceful- Specified by:
getResourcein interfaceResourceful- Parameters:
resourceClass- the class of resource to get- Returns:
- the
Resourcecorresponding to the given class
-
addOnHostAllocationListener
Description copied from interface:VmAdds a listener object that will be notified when aHostis 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:
addOnHostAllocationListenerin interfaceVm- Parameters:
listener- the listener to add- Returns:
- See Also:
-
addOnMigrationStartListener
Description copied from interface:VmAdds a listener object that will be notified when a VM starts migrating to a targetHost. When the listener is notified, it receives aVmHostEventInfoobject informing the target Host where the VM is being migrated.- Specified by:
addOnMigrationStartListenerin interfaceVm- Parameters:
listener- the listener to add- Returns:
- See Also:
-
addOnMigrationFinishListener
Description copied from interface:VmAdds a listener object that will be notified when a VM finishes migrating to a targetHost. When the listener is notified, it receives aVmHostEventInfoobject informing the target Host where the VM has just migrated.- Specified by:
addOnMigrationFinishListenerin interfaceVm- Parameters:
listener- the listener to add- Returns:
-
addOnHostDeallocationListener
Description copied from interface:VmAdds a listener object that will be notified when the Vm is moved/removed from aHost.- Specified by:
addOnHostDeallocationListenerin interfaceVm- Parameters:
listener- the listener to add- Returns:
-
addOnCreationFailureListener
public Vm addOnCreationFailureListener(@NonNull @NonNull EventListener<VmDatacenterEventInfo> listener) Description copied from interface:VmAdds a listener object that will be notified when the Vm fail in being placed, due to lack of aHostwith enough resources in a specificDatacenter.The
DatacenterBrokeris accountable for receiving the notification from the Datacenter and notifying the Listeners.- Specified by:
addOnCreationFailureListenerin interfaceVm- Parameters:
listener- the listener to add- Returns:
- See Also:
-
addOnUpdateProcessingListener
Description copied from interface:VmAdds a listener object that will be notified every time when the processing of the Vm is updated in itsHost.- Specified by:
addOnUpdateProcessingListenerin interfaceVm- Parameters:
listener- the listener to add- Returns:
- See Also:
-
removeOnCreationFailureListener
public boolean removeOnCreationFailureListener(@NonNull @NonNull EventListener<VmDatacenterEventInfo> listener) Description copied from interface:VmRemoves a listener from the onVmCreationFailureListener List.- Specified by:
removeOnCreationFailureListenerin interfaceVm- 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:VmRemoves a listener from the onUpdateVmProcessingListener List.- Specified by:
removeOnUpdateProcessingListenerin interfaceVm- 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:VmRemoves a listener from the onHostAllocationListener List.- Specified by:
removeOnHostAllocationListenerin interfaceVm- 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:VmRemoves a listener from the onHostDeallocationListener List.- Specified by:
removeOnHostDeallocationListenerin interfaceVm- Parameters:
listener- the listener to remove- Returns:
- true if the listener was found and removed, false otherwise
-
setFailed
-
setCloudletsToFailed
public void setCloudletsToFailed() -
isWorking
-
setSubmissionDelay
public final void setSubmissionDelay(double submissionDelay) Description copied from interface:SubmissionDelayableSets a relative time (in seconds), from current simulation time, that aDatacenterBrokerwill 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:
setSubmissionDelayin interfaceSubmissionDelayable- 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:
isSubmissionDelayedin interfaceSubmissionDelayable- Returns:
- true if this object has a submission delay, false otherwise
-
notifyOnHostAllocationListeners
public void notifyOnHostAllocationListeners()Description copied from interface:VmNotifies all registered listeners when aHostis allocated to theVm.This method is used just internally and must not be called directly.
- Specified by:
notifyOnHostAllocationListenersin interfaceVm
-
notifyOnHostDeallocationListeners
Description copied from interface:VmNotifies all registered listeners when theVmis moved/removed from aHost.This method is used just internally and must not be called directly.
- Specified by:
notifyOnHostDeallocationListenersin interfaceVm- Parameters:
deallocatedHost- theHosttheVmwas moved/removed from
-
notifyOnUpdateProcessingListeners
public void notifyOnUpdateProcessingListeners()Notifies all registered listeners when the processing of the Vm is updated in itsHost. -
notifyOnCreationFailureListeners
Description copied from interface:VmNotifies all registered listeners when the Vm fail in being placed for lack of aHostwith enough resources in a specificDatacenter.This method is used just internally and must not be called directly.
- Specified by:
notifyOnCreationFailureListenersin interfaceVm- Parameters:
failedDatacenter- the Datacenter where the VM creation failed
-
removeOnMigrationStartListener
public boolean removeOnMigrationStartListener(@NonNull @NonNull EventListener<VmHostEventInfo> listener) Description copied from interface:VmRemoves a listener from the onMigrationStartListener List.- Specified by:
removeOnMigrationStartListenerin interfaceVm- 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:VmRemoves a listener from the onMigrationFinishListener List.- Specified by:
removeOnMigrationFinishListenerin interfaceVm- 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:VmSets aHorizontalVmScalingthat will check if the Vm is overloaded, based on some conditions defined by aPredicategiven to the HorizontalVmScaling, and then request the creation of new VMs to horizontally scale the Vm.- Specified by:
setHorizontalScalingin interfaceVm- 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:VmSets aVerticalVmScalingthat will check if the Vm'sRamis under or overloaded, based on some conditions defined byPredicates given to the VerticalVmScaling, and then request the RAM up or down scaling.- Specified by:
setRamVerticalScalingin interfaceVm- 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:VmSets aVerticalVmScalingthat will check if the Vm'sBandwidthis under or overloaded, based on some conditions defined byPredicates given to the VerticalVmScaling, and then request the Bandwidth up or down scaling.- Specified by:
setBwVerticalScalingin interfaceVm- 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:VmSets aVerticalVmScalingthat will check if the Vm'sPeis under or overloaded, based on some conditions defined byPredicates 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:
setPeVerticalScalingin interfaceVm- 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:VmEnables 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:
enableUtilizationStatsin interfaceResourceStatsComputer<VmResourceStats>- Specified by:
enableUtilizationStatsin interfaceVm- See Also:
-
setTimeZone
Description copied from interface:VmSets the time zone offset between [TimeZoned.MIN_TIME_ZONE_OFFSETandTimeZoned.MAX_TIME_ZONE_OFFSET]. That is the timezone in which the VM is expected to be placed (if there is aDatacenterwith enough capacity available at that timezone).- Specified by:
setTimeZonein interfaceTimeZoned- Specified by:
setTimeZonein interfaceVm- Parameters:
timeZone- the new expected time zone offset- Returns:
-
isFinished
public boolean isFinished()- Specified by:
isFinishedin interfaceStartable- Returns:
- true if this entity has finished execution; false otherwise
-
getRam
-
setDescription
Description copied from interface:VmSets the Vm description, an optional text which can be used to provide details about this VM.- Specified by:
setDescriptionin interfaceVm- Parameters:
description- the Vm description to set
-
setVmm
-
setGroup
-
setInMigration
Description copied from interface:VmDefines if the VM is in migration process or not.- Specified by:
setInMigrationin interfaceVm- Parameters:
inMigration- true to indicate the VM is migrating into a Host, false otherwise
-
shutdown
public void shutdown()Description copied from interface:ExecDelayableSends a request to shut down the entity.- Specified by:
shutdownin interfaceExecDelayable- Specified by:
shutdownin interfaceVm- See Also:
-