Interface Vm
- All Superinterfaces:
ChangeableId,Comparable<Vm>,CustomerEntity,ExecDelayable,Identifiable,Lifetimed,Machine<Resource>,Resourceful,ResourceStatsComputer<VmResourceStats>,Startable,SubmissionDelayable,TimeZoned,UniquelyIdentifiable
- All Known Implementing Classes:
NetworkVm,VmAbstract,VmGroup,VmSimple
NullPointerException when
using the NULL object instead of attributing null to
Vm variables.- Since:
- CloudSim Plus 1.0
- Author:
- Rodrigo N. Calheiros, Anton Beloglazov, Manoel Campos da Silva Filho
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.slf4j.Loggerstatic final VmAn attribute that implements the Null Object Design Pattern forVmobjects.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 -
Method Summary
Modifier and TypeMethodDescriptionAdds a listener object that will be notified when the Vm fail in being placed, due to lack of aHostwith enough resources in a specificDatacenter.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.Adds a listener object that will be notified when the Vm is moved/removed from aHost.Adds a listener object that will be notified when a VM finishes migrating to a targetHost.Adds a listener object that will be notified when a VM starts migrating to a targetHost.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.Returns the VM boot model.Gets theDatacenterBrokerthat represents the owner of this Vm.getBw()Gets bandwidth resource (in Megabits/s) assigned to the Vm, allowing to check its capacity and usage.Gets aVerticalVmScalingthat will check if the Vm's Bandwidth is overloaded, based on some conditions defined by aPredicategiven to the VerticalVmScaling, and then request the BW up scaling.Gets the Cloudlet scheduler the VM uses to schedule cloudlets execution.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).Gets the Vm description, an optional text which can be used to provide details about this VM.longGets the expected free pes number before the VM starts executing.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.longGets the current number of free PEs.getGroup()Gets thegroupthis Vm belongs toGets 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.getHost()Gets theHostwhere the Vm is or will be placed.doubleComputes the relative percentage of the Bandwidth the VM is using from the Host's total capacity for the current simulation time.default doubleComputes the current relative percentage of the CPU the VM is using from the Host's total MIPS capacity.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.doubleGets the Vm Gets lifetime which indicates the maximum execution timeGets aVerticalVmScalingthat will check if the Vm'sPeis overloaded, based on some conditions defined by aPredicategiven to the VerticalVmScaling, and then request the RAM up scaling.Gets theProcessorof this VM.getRam()Gets the RAM resource assigned to the Vm, allowing to check its capacity (in Megabytes) and usage.Gets aVerticalVmScalingthat will check if the Vm's RAM is overloaded, based on some conditions defined by aPredicategiven to the VerticalVmScaling, and then request the RAM up scaling.Gets a read-only list with the history of requests and allocation of MIPS for this VM.Gets the storage device of the VM, which represents the VM image, allowing to check its capacity (in Megabytes) and usage.doubleGets the time zone offset, a value between [TimeZoned.MIN_TIME_ZONE_OFFSETandTimeZoned.MAX_TIME_ZONE_OFFSET], in which the object is physically located.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.doubleGets the total time (in seconds) the Vm spent executing.getVmm()Gets the Virtual Machine Monitor (VMM) that manages the VM.booleanChecks if the VM was created and placed inside theHost.booleanisFailed()Checks if the Vm is failed or not.default booleanisIdleEnough(double time) Checks if the Machine has been idle for a given amount of time (in seconds).booleanChecks if the VM is in migration process or not, that is, if it is migrating in or out of a Host.default booleanReturns true or false.booleanisSuitableForCloudlet(Cloudlet cloudlet) Checks if the VM has enough capacity to run a Cloudlet.booleanChecks if the Vm is working or failed.voidnotifyOnCreationFailureListeners(Datacenter failedDatacenter) Notifies all registered listeners when the Vm fail in being placed for lack of aHostwith enough resources in a specificDatacenter.voidvoidnotifyOnHostDeallocationListeners(Host deallocatedHost) booleanRemoves a listener from the onVmCreationFailureListener List.booleanRemoves a listener from the onHostAllocationListener List.booleanRemoves a listener from the onHostDeallocationListener List.booleanRemoves a listener from the onMigrationFinishListener List.booleanRemoves a listener from the onMigrationStartListener List.booleanRemoves a listener from the onUpdateVmProcessingListener List.setBootModel(BootModel model) Sets a model which defines how the VM uses resources such as RAM, CPU and BW during the boot process.setBroker(DatacenterBroker broker) Sets aDatacenterBrokerthat represents the owner of this Vm.setBw(long bwCapacity) Sets the bandwidth capacity (in Megabits/s)setBwVerticalScaling(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.setCloudletScheduler(CloudletScheduler cloudletScheduler) Sets the Cloudlet scheduler the Vm uses to schedule cloudlets execution.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.setHorizontalScaling(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.setInMigration(boolean migrating) Defines if the VM is in migration process or not.setLifeTime(double lifeTime) Sets the Vm Sets the lifetime which indicates the maximum execution time.setPeVerticalScaling(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.setRam(long ramCapacity) Sets RAM capacity in Megabytes.setRamVerticalScaling(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.setSize(long size) Sets the storage size (capacity) of the VM image in Megabytes.setStartupDelay(double delay) Set the time (in seconds) for the entity to finish starting up.setTimeZone(double timeZone) Sets the time zone offset between [TimeZoned.MIN_TIME_ZONE_OFFSETandTimeZoned.MAX_TIME_ZONE_OFFSET].voidshutdown()Sends a request to the Datacenter to shut down (destroy) the VM.doubleupdateProcessing(double currentTime, 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 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, getMips, getPesNumber, getSimulation, getTotalMipsCapacity, isIdleMethods inherited from interface org.cloudsimplus.resources.Resourceful
getResource, getResourcesMethods inherited from interface org.cloudsimplus.core.ResourceStatsComputer
getCpuUtilizationStatsMethods inherited from interface org.cloudsimplus.core.Startable
getStartTime, hasStarted, isFinished, setFinishTime, setLastBusyTime, setStartTimeMethods inherited from interface org.cloudsimplus.core.SubmissionDelayable
getSubmissionDelay, isSubmissionDelayed, setSubmissionDelayMethods inherited from interface org.cloudsimplus.datacenters.TimeZoned
distance, validateTimeZoneMethods inherited from interface org.cloudsimplus.core.UniquelyIdentifiable
getUid
-
Field Details
-
LOGGER
static final org.slf4j.Logger LOGGER -
NULL
-
-
Method Details
-
getDescription
String getDescription()Gets the Vm description, an optional text which can be used to provide details about this VM.- Returns:
-
setDescription
-
getGroup
-
addStateHistoryEntry
Adds a VM state history entry.- Parameters:
entry- the data about the state of the VM at given time
-
getCloudletScheduler
CloudletScheduler getCloudletScheduler()Gets the Cloudlet scheduler the VM uses to schedule cloudlets execution.- Returns:
- the cloudlet scheduler
-
getFreePesNumber
long getFreePesNumber()Gets the current number of free PEs.- Returns:
- the current free pes number
-
getExpectedFreePesNumber
long getExpectedFreePesNumber()Gets the expected free pes number before the VM starts executing. This value is updated as cloudlets are assigned to VMs but not submitted to the broker yet for running.- Returns:
- the expected free pes number
-
getCurrentRequestedBw
long getCurrentRequestedBw()Gets the current requested bw.- Returns:
- the current requested bw
-
getCurrentRequestedMips
-
getCurrentRequestedRam
long getCurrentRequestedRam()Gets the current requested ram (in Megabytes).- Returns:
-
getTotalCpuMipsRequested
double getTotalCpuMipsRequested()Gets the current requested total MIPS. It is the sum of MIPS capacity requested for every virtualPe.- Returns:
- the current requested total MIPS
- See Also:
-
getHost
Host getHost()Gets theHostwhere the Vm is or will be placed. To know if the Vm was already created inside this Host, call theisCreated()method.- Returns:
- the Host
- See Also:
-
addOnHostAllocationListener
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. That happens when the VM is placed for the first time into a Host or when it's migrated to another Host.- Parameters:
listener- the listener to add- Returns:
- See Also:
-
addOnMigrationStartListener
Adds 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.- Parameters:
listener- the listener to add- Returns:
- See Also:
-
addOnMigrationFinishListener
Adds 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.- Parameters:
listener- the listener to add- Returns:
-
addOnHostDeallocationListener
Adds a listener object that will be notified when the Vm is moved/removed from aHost.- Parameters:
listener- the listener to add- Returns:
-
addOnCreationFailureListener
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.The
DatacenterBrokeris accountable for receiving the notification from the Datacenter and notifying the Listeners.- Parameters:
listener- the listener to add- Returns:
- See Also:
-
addOnUpdateProcessingListener
Adds a listener object that will be notified every time when the processing of the Vm is updated in itsHost.- Parameters:
listener- the listener to add- Returns:
- See Also:
-
notifyOnHostAllocationListeners
-
notifyOnHostDeallocationListeners
-
notifyOnCreationFailureListeners
Notifies 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.
- Parameters:
failedDatacenter- the Datacenter where the VM creation failed
-
removeOnMigrationStartListener
Removes a listener from the onMigrationStartListener List.- Parameters:
listener- the listener to remove- Returns:
- true if the listener was found and removed, false otherwise
-
removeOnMigrationFinishListener
Removes a listener from the onMigrationFinishListener List.- Parameters:
listener- the listener to remove- Returns:
- true if the listener was found and removed, false otherwise
-
removeOnUpdateProcessingListener
Removes a listener from the onUpdateVmProcessingListener List.- Parameters:
listener- the listener to remove- Returns:
- true if the listener was found and removed, false otherwise
-
removeOnHostAllocationListener
Removes a listener from the onHostAllocationListener List.- Parameters:
listener- the listener to remove- Returns:
- true if the listener was found and removed, false otherwise
-
removeOnHostDeallocationListener
Removes a listener from the onHostDeallocationListener List.- Parameters:
listener- the listener to remove- Returns:
- true if the listener was found and removed, false otherwise
-
removeOnCreationFailureListener
Removes a listener from the onVmCreationFailureListener List.- Parameters:
listener- the listener to remove- Returns:
- true if the listener was found and removed, false otherwise
-
getBw
-
getRam
-
getStorage
Resource getStorage()Gets the storage device of the VM, which represents the VM image, allowing to check its capacity (in Megabytes) and usage.- Specified by:
getStoragein interfaceMachine<Resource>- Returns:
- the storage resource
-
getStateHistory
List<VmStateHistoryEntry> getStateHistory()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.- Returns:
- the state history
- See Also:
-
getCpuPercentUtilization
double getCpuPercentUtilization(double time) 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.- Parameters:
time- the time to get the CPU utilization percentage- Returns:
- total CPU utilization percentage (between [0 and 1])
-
getCpuPercentUtilization
double getCpuPercentUtilization()Gets the current percentage of CPU capacity (MIPS %) used by all Cloudlets running on this VM. It represents the actual percentage of MIPS allocated.- Returns:
- total CPU utilization percentage (between [0 and 1]) for the current time
-
getCpuPercentRequested
double getCpuPercentRequested(double time) 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.- 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:
-
getCpuPercentRequested
double getCpuPercentRequested()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.- Returns:
- the percentage (between [0 and 1]) of CPU capacity requested
- See Also:
-
enableUtilizationStats
void enableUtilizationStats()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:
enableUtilizationStatsin interfaceResourceStatsComputer<VmResourceStats>- See Also:
-
getHostRamUtilization
double getHostRamUtilization()Computes the relative percentage of the RAM the VM is using from the Host's total Capacity for the current simulation time.- Returns:
- the relative VM RAM usage percent (from 0 to 1)
-
getHostBwUtilization
double getHostBwUtilization()Computes the relative percentage of the Bandwidth the VM is using from the Host's total capacity for the current simulation time.- Returns:
- the relative VM BW usage percent (from 0 to 1)
-
getHostCpuUtilization
default double getHostCpuUtilization()Computes the current relative percentage of the CPU the VM is using from the Host's total MIPS capacity. If the capacity is 1000 MIPS and the VM is using 250 MIPS, it's equivalent to 25% of the Host's capacity.- Returns:
- the relative VM CPU usage percent (from 0 to 1)
- See Also:
-
getHostCpuUtilization
double getHostCpuUtilization(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. If the capacity is 1000 MIPS and the VM is using 250 MIPS, it's equivalent to 25% of the Host's capacity.- Parameters:
time- the time to get the relative VM CPU utilization- Returns:
- the relative VM CPU usage percent (from 0 to 1)
-
getExpectedHostCpuUtilization
double getExpectedHostCpuUtilization(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.- Parameters:
vmCpuUtilizationPercent- the VM's CPU utilization percentage for a given time- Returns:
- the relative VM CPU usage percent (from 0 to 1)
-
getTotalCpuMipsUtilization
double getTotalCpuMipsUtilization()Gets the current total CPU MIPS utilization of all PEs from all cloudlets running on this VM.- Returns:
- total CPU utilization in MIPS
- See Also:
-
getTotalCpuMipsUtilization
double getTotalCpuMipsUtilization(double time) Gets the total CPU MIPS utilization of all PEs from all cloudlets running on this VM at the given time.- Parameters:
time- the time to get the utilization- Returns:
- total CPU utilization in MIPS
- See Also:
-
getVmm
-
isCreated
boolean isCreated()Checks if the VM was created and placed inside theHost. If so, resources required by the Vm already were provisioned.- Returns:
- true, if it was created inside the Host, false otherwise
-
isSuitableForCloudlet
Checks if the VM has enough capacity to run a Cloudlet.- 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
-
isInMigration
boolean isInMigration()Checks if the VM is in migration process or not, that is, if it is migrating in or out of a Host.- Returns:
-
setInMigration
Defines if the VM is in migration process or not.- Parameters:
migrating- true to indicate the VM is migrating into a Host, false otherwise
-
setBw
Sets the bandwidth capacity (in Megabits/s)- Parameters:
bwCapacity- new BW capacity (in Megabits/s)- Returns:
-
setRam
Sets RAM capacity in Megabytes.- Parameters:
ramCapacity- new RAM capacity- Returns:
-
setSize
Sets the storage size (capacity) of the VM image in Megabytes.- Parameters:
size- new storage size- Returns:
-
setCloudletScheduler
Sets the Cloudlet scheduler the Vm uses to schedule cloudlets execution. It also sets the Vm itself to the given scheduler.- Parameters:
cloudletScheduler- the cloudlet scheduler to set- Returns:
-
setFailed
void setFailed(boolean failed) Sets the status of VM to FAILED.- Parameters:
failed- true to indicate that the VM is failed, false to indicate it is working
-
isFailed
boolean isFailed()Checks if the Vm is failed or not.- Returns:
- See Also:
-
isWorking
boolean isWorking()Checks if the Vm is working or failed.- Returns:
- See Also:
-
isIdleEnough
default boolean isIdleEnough(double time) Description copied from interface:MachineChecks if the Machine has been idle for a given amount of time (in seconds).- Specified by:
isIdleEnoughin interfaceMachine<Resource>- Parameters:
time- the time interval to check if the Machine has been idle (in seconds). If time is zero, it will be checked if the Machine is currently idle. If it's negative, even if the Machine is idle, it's considered that it isn't idle enough. This is useful if you don't want to perform any operation when the machine becomes idle (for instance, if idle machines might be shut down and a negative value is given, they won't).- Returns:
- true if the Machine has been idle as long as the given time; false if it's active or isn't idle long enough
-
getHorizontalScaling
HorizontalVmScaling getHorizontalScaling()Gets 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.If no HorizontalVmScaling is set, the
Brokerwill not dynamically create VMs to balance arrived Cloudlets.- Returns:
-
setHorizontalScaling
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.- 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
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.- 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
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.- 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
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.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.
- 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.
-
getRamVerticalScaling
VerticalVmScaling getRamVerticalScaling()Gets aVerticalVmScalingthat will check if the Vm's RAM is overloaded, based on some conditions defined by aPredicategiven to the VerticalVmScaling, and then request the RAM up scaling.- Returns:
-
getBwVerticalScaling
VerticalVmScaling getBwVerticalScaling()Gets aVerticalVmScalingthat will check if the Vm's Bandwidth is overloaded, based on some conditions defined by aPredicategiven to the VerticalVmScaling, and then request the BW up scaling.- Returns:
-
getPeVerticalScaling
VerticalVmScaling getPeVerticalScaling()Gets aVerticalVmScalingthat will check if the Vm'sPeis overloaded, based on some conditions defined by aPredicategiven to the VerticalVmScaling, and then request the RAM up scaling.- Returns:
-
getProcessor
-
getBroker
DatacenterBroker getBroker()Gets theDatacenterBrokerthat represents the owner of this Vm.- Specified by:
getBrokerin interfaceCustomerEntity- Returns:
- the broker or
DatacenterBroker.NULLif a broker has not been set yet
-
setBroker
Sets aDatacenterBrokerthat represents the owner of this Vm.- Specified by:
setBrokerin interfaceCustomerEntity- Parameters:
broker- theDatacenterBrokerto set
-
getTotalExecutionTime
double getTotalExecutionTime()Gets the total time (in seconds) the Vm spent executing. It considers the entire VM execution even if in different Hosts it has possibly migrated.- Specified by:
getTotalExecutionTimein interfaceStartable- Returns:
- the VM total execution time if the VM has stopped, the time executed so far if the VM is running yet, or 0 if it hasn't started.
-
getTimeZone
double getTimeZone()Gets the time zone offset, a value between [TimeZoned.MIN_TIME_ZONE_OFFSETandTimeZoned.MAX_TIME_ZONE_OFFSET], in which the object is physically located. That is the timezone in which the VM is expected to be placed (if there is aDatacenterwith enough capacity available at that timezone).To know the actual timezone where the VM is placed, check the
timezone of the Datacenter of the Host where this is VM placed.- Specified by:
getTimeZonein interfaceTimeZoned- Returns:
- the expected timezone to place this VM
-
setTimeZone
Sets 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- Parameters:
timeZone- the new expected time zone offset- Returns:
-
getLifeTime
double getLifeTime()Gets the Vm Gets lifetime which indicates the maximum execution time.- Specified by:
getLifeTimein interfaceLifetimed- Returns:
- the lifeTime (in seconds) or
Double.MAX_VALUEindicating no lifeTime is set - See Also:
-
getBootModel
BootModel getBootModel()Returns the VM boot model. It defines how the VM uses resources such as RAM, CPU and BW during the boot process.- Returns:
- the VM boot model
- See Also:
-
setBootModel
Sets a model which defines how the VM uses resources such as RAM, CPU and BW during the boot process.If a model is not set, no resources are used during the boot time, which is just simulated if a
startup delayis set.- Parameters:
model- the boot model to set- Returns:
- this
-
setLifeTime
Sets the Vm Sets the lifetime which indicates the maximum execution time. The lifetime must be larger thanDatacenter.getSchedulingInterval()..The Vm will finish execution as soon as possible, after the given lifeTime has passed, since its
Startable.getStartTime()start time}.NOTE: If the VM has a lifeTime set, and it's smaller than the Cloudlet lifeTime, the VM lifeTime is used instead of the Cloudlet one.
- Specified by:
setLifeTimein interfaceLifetimed- Parameters:
lifeTime- lifeTime to set (in seconds) orDouble.MAX_VALUEto indicate there is no lifeTime- Returns:
-
setStartupDelay
Set the time (in seconds) for the entity to finish starting up. This is the time the VM takes to boot up.INFO: When setting this attribute, call
setBootModel(BootModel)first.- Specified by:
setStartupDelayin interfaceExecDelayable- Parameters:
delay-- Returns:
- See Also:
-
isStartingUp
default boolean isStartingUp()Returns true or false. whether the VM is booting up or not.- Specified by:
isStartingUpin interfaceExecDelayable- Returns:
- true or false
-
shutdown
void shutdown()Sends a request to the Datacenter to shut down (destroy) the VM.- Specified by:
shutdownin interfaceExecDelayable- See Also:
-