Class HostAbstract
java.lang.Object
org.cloudsimplus.core.StartableAbstract
org.cloudsimplus.core.ExecDelayableAbstract
org.cloudsimplus.hosts.HostAbstract
- All Implemented Interfaces:
Comparable<Host>,ChangeableId,ExecDelayable,Identifiable,Machine<FileStorage>,PhysicalMachine,ResourceStatsComputer<HostResourceStats>,Startable,Host,PowerAware<PowerModelHost>,Resourceful
- Direct Known Subclasses:
HostSimple
A base class for implementing
Hosts.- Since:
- CloudSim Plus 8.3.0
- Author:
- Manoel Campos da Silva Filho
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanIndicate whether the Host must be automatically started up when the assigned Datacenter is initialized or not.protected final Bandwidthprotected HostResourceStatsprotected Datacenterprotected static longThe Default Bandwidth capacity (in Mbps) for creating Hosts.protected static longThe Default RAM capacity (in MB) for creating Hosts.protected static longThe Default Storage capacity (in MB) for creating Hosts.protected final HarddriveStorageprotected longprotected doubleprotected booleanprotected final List<EventListener<HostEventInfo>> protected final List<EventListener<HostEventInfo>> protected final Set<EventListener<HostUpdatesVmsProcessingEventInfo>> protected PowerModelHostprotected List<ResourceProvisioner> protected final Ramprotected List<ResourceManageable> protected final List<HostStateHistoryEntry> Fields inherited from interface org.cloudsimplus.hosts.Host
DEF_IDLE_SHUTDOWN_DEADLINE, LOGGER, NULLFields inherited from interface org.cloudsimplus.core.Startable
NOT_ASSIGNED -
Constructor Summary
ConstructorsModifierConstructorDescriptionHostAbstract(long ram, long bw, long storage, List<Pe> peList) protectedHostAbstract(long ram, long bw, @NonNull HarddriveStorage storage, List<Pe> peList) protectedHostAbstract(long ram, long bw, @NonNull HarddriveStorage storage, List<Pe> peList, boolean activate) HostAbstract(List<Pe> peList) HostAbstract(List<Pe> peList, boolean activate) HostAbstract(ResourceProvisioner ramProvisioner, ResourceProvisioner bwProvisioner, long storage, List<Pe> peList) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddMigratingInVm(Vm vm) Try to add a Vm migrating into the current Host if there are enough resources for it.addOnShutdownListener(@NonNull EventListener<HostEventInfo> listener) Adds a listener object that will be notified every time the host is powered off.addOnStartupListener(@NonNull EventListener<HostEventInfo> listener) Adds a listener object that will be notified every time the host is powered on.addOnUpdateProcessingListener(@NonNull EventListener<HostUpdatesVmsProcessingEventInfo> listener) Adds a listener object that will be notified every time the host updates the processing of all itsVMs.booleanaddVmMigratingOut(@NonNull Vm vm) Adds aVmto the list of VMs migrating out this Host.protected voidaddVmToCreatedList(@NonNull Vm vm) protected voidaddVmToList(@NonNull Vm vm) createTemporaryVm(Vm vm) Try to allocate resources to a new temporary VM in the Host.Try to allocate resources to a new VM in the Host.protected voidDeallocate all resources that a Vm was using.voidDestroys all Vm's running in the Host and removes them from thegetVmList().voiddestroyTemporaryVm(Vm vm) Destroys a temporary Vm created into the Host to book resources.voidDestroys a Vm running in the Host and removes it from thegetVmList().voiddestroyVmInternal(@NonNull Vm vm) voidEnables the data collection and computation of utilization statistics.protected MipsSharelongdoubledoublegetBusyPesPercent(boolean hundredScale) Gets the current percentage of used (busy)Pes, according to thetotal number of PEs.getBw()longdoubledoubledoubledoublegetMips()longgetProvisioner(Class<? extends ResourceManageable> resourceClass) getRam()longgetSuitabilityFor(Vm vm) Checks if the host is suitable for a Vm (if it has enough resources to meet the Vm requirements) and the Host has not failed, providing fine-grained information about the suitability of each Host resource.doubledoubleReturns the total allocated MIPS for a VM across all its PEs.doubledoubledoubleReturns the total time (in seconds) the Host stayed active (powered on).doubleReturns the total time (in hours) the Host stayed active (powered on).doubledoubleGets a read-only list of all VMs that have been created into the Host during the entire simulation.Gets a list of VMs currently assigned to the Host.Gets the list of VMs migrating into this host.booleanbooleanprotected voidincBusyPesNumber(int inc) Updates the number of busyPes, decreasing it if a negative number is given, or increasing otherwise.protected voidincFailedPesNumber(int inc) Updates the number of failed (and working)Pes, decreasing it if a negative number is given, or increasing otherwise.protected voidincFreePesNumber(int inc) Updates the number of freePes, decreasing it if a negative number is given, or increasing otherwise.booleanbooleanisSuitableForVm(Vm vm) Checks if the Host is suitable for a Vm (if it has enough resources to meet the Vm requirements) and the Host has not failed.protected voidonFinish(double time) Notifies when the entity is actually finished.voidonStart(double startTime) Notifies when the entity is actually started.voidprocessActivation(boolean activate) Process an event for actually powering theHoston or off after any defined startup/shutdown delay (if some delay is set).voidReallocate VMs migrating into this Host.voidremoveMigratingInVm(@NonNull Vm vm) Removes a VM migrating into this Host from the migrating-in list, so that the VM can be actually placed into the Host and the migration process finished.booleanremoveOnShutdownListener(@NonNull EventListener<HostEventInfo> listener) Removes a Listener object from the OnShutdown List.booleanremoveOnStartupListener(@NonNull EventListener<HostEventInfo> listener) Removes a Listener object from the OnStartup List.booleanremoveOnUpdateProcessingListener(@NonNull EventListener<HostUpdatesVmsProcessingEventInfo> listener) Removes a Listener object from the OnUpdateProcessing List.booleanremoveVmMigratingOut(@NonNull Vm vm) Removes aVmfrom the list of VMs migrating out this Host.final HostsetActive(boolean activate) Requests the Host to be powered on or off.final HostsetBwProvisioner(ResourceProvisioner bwProvisioner) Sets the bandwidth (BW) provisioner with capacity in Megabits/s.final voidsetDatacenter(@NonNull Datacenter datacenter) Sets theDatacenterwhere the host is placed.static voidsetDefaultBwCapacity(long defaultCapacity) Sets the Default Bandwidth capacity (in Mbps) for creating Hosts.static voidsetDefaultRamCapacity(long defaultCapacity) Sets the Default RAM capacity (in MB) for creating Hosts.static voidsetDefaultStorageCapacity(long defaultCapacity) Sets the Default Storage capacity (in MB) for creating Hosts.final booleansetFailed(boolean failed) Sets the Host state to "failed" or "working".protected voidSets thePelist.final voidsetPeStatus(List<Pe> peList, Pe.Status newStatus) Sets the status of a given (sub)list ofPes to a new status.final PowerAware<PowerModelHost> setPowerModel(PowerModelHost powerModel) Sets thePowerModelHostused by the Host to define how it consumes power.final HostsetRamProvisioner(ResourceProvisioner ramProvisioner) Sets the ram provisioner with capacity in Megabytes.final HostsetVmScheduler(VmScheduler vmScheduler) Sets the policy for allocation of hostPes to VMs to schedule VM execution.voidshutdown()Sends a request to shut down the entity.doubleupdateProcessing(double currentTime) Updates the processing of VMs running on this Host, that makes the processing of Cloudlets inside such VMs to be updated.protected doubleupdateVmProcessing(Vm vm, double currentTime, double nextSimulationDelay) Methods inherited from class org.cloudsimplus.core.ExecDelayableAbstract
isShuttingDown, setShutDownDelay, setStartupDelayMethods inherited from class org.cloudsimplus.core.StartableAbstract
getTotalExecutionTime, setFinishTime, setStartTimeMethods 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.ExecDelayable
getRemainingStartupTime, getShutdownBeginTime, getShutDownDelay, getStartupCompletionTime, getStartupDelay, isShutDownDelayed, isShuttingDown, isStartingUp, isStartupDelayed, setShutdownBeginTime, setShutDownDelay, setStartupDelayMethods inherited from interface org.cloudsimplus.hosts.Host
getBusyPesNumber, getBwProvisioner, getCpuUtilizationStats, getDatacenter, getFailedPesNumber, getFinishTime, getFirstStartTime, getFreePesNumber, getIdleShutdownDeadline, getPeList, getPowerModel, getRamProvisioner, getVmScheduler, getWorkingPesNumber, isActive, isFailed, isLazySuitabilityEvaluation, isStateHistoryEnabled, setFinishTime, setIdleShutdownDeadline, setLazySuitabilityEvaluation, setSimulation, setStateHistoryEnabledMethods inherited from interface org.cloudsimplus.core.Identifiable
getIdMethods inherited from interface org.cloudsimplus.core.Machine
getIdleInterval, getLastBusyTime, getSimulation, isIdle, isIdleEnoughMethods inherited from interface org.cloudsimplus.core.PhysicalMachine
getExpectedRelativeCpuUtilization, getRelativeBwUtilization, getRelativeCpuUtilization, getRelativeMipsCapacityPercent, getRelativeRamUtilizationMethods inherited from interface org.cloudsimplus.resources.Resourceful
getResourceMethods inherited from interface org.cloudsimplus.core.Startable
getStartTime, getTotalExecutionTime, hasStarted, setLastBusyTime, setStartTime
-
Field Details
-
defaultRamCapacity
protected static long defaultRamCapacityThe Default RAM capacity (in MB) for creating Hosts. This value is used when the RAM capacity is not given in a Host constructor. -
defaultBwCapacity
protected static long defaultBwCapacityThe Default Bandwidth capacity (in Mbps) for creating Hosts. This value is used when the BW capacity is not given in a Host constructor. -
defaultStorageCapacity
protected static long defaultStorageCapacityThe Default Storage capacity (in MB) for creating Hosts. This value is used when the Storage capacity is not given in a Host constructor. -
ram
-
bw
-
disk
- See Also:
-
stateHistory
- See Also:
-
vmsMigratingIn
-
vmsMigratingOut
-
onUpdateProcessingListeners
- See Also:
-
onStartupListeners
- See Also:
-
onShutdownListeners
- See Also:
-
vmCreatedList
-
id
protected long id -
activateOnDatacenterStartup
protected boolean activateOnDatacenterStartupIndicate whether the Host must be automatically started up when the assigned Datacenter is initialized or not. -
powerModel
-
idleShutdownDeadline
protected double idleShutdownDeadline -
cpuUtilizationStats
-
resources
- See Also:
-
provisioners
-
lazySuitabilityEvaluation
protected boolean lazySuitabilityEvaluationIt's enabled by default.
-
datacenter
-
-
Constructor Details
-
HostAbstract
public HostAbstract(ResourceProvisioner ramProvisioner, ResourceProvisioner bwProvisioner, long storage, List<Pe> peList) -
HostAbstract
-
HostAbstract
protected HostAbstract(long ram, long bw, @NonNull @NonNull HarddriveStorage storage, List<Pe> peList) -
HostAbstract
-
HostAbstract
-
HostAbstract
protected HostAbstract(long ram, long bw, @NonNull @NonNull HarddriveStorage storage, List<Pe> peList, boolean activate)
-
-
Method Details
-
setDefaultRamCapacity
public static void setDefaultRamCapacity(long defaultCapacity) Sets the Default RAM capacity (in MB) for creating Hosts. This value is used when the RAM capacity is not given in a Host constructor. -
setDefaultBwCapacity
public static void setDefaultBwCapacity(long defaultCapacity) Sets the Default Bandwidth capacity (in Mbps) for creating Hosts. This value is used when the BW capacity is not given in a Host constructor. -
setDefaultStorageCapacity
public static void setDefaultStorageCapacity(long defaultCapacity) Sets the Default Storage capacity (in MB) for creating Hosts. This value is used when the Storage capacity is not given in a Host constructor. -
updateProcessing
public double updateProcessing(double currentTime) Description copied from interface:HostUpdates the processing of VMs running on this Host, that makes the processing of Cloudlets inside such VMs to be updated.- Specified by:
updateProcessingin interfaceHost- Parameters:
currentTime- the current time- Returns:
- the predicted completion time of the earliest finishing cloudlet
(which is a relative delay from the current simulation time),
or
Double.MAX_VALUEif there is no next Cloudlet to execute
-
updateVmProcessing
-
createVm
Description copied from interface:HostTry to allocate resources to a new VM in the Host.- Specified by:
createVmin interfaceHost- Parameters:
vm- Vm being started- Returns:
- a
HostSuitabilityto indicate if the Vm was placed into the host or not (if the Host doesn't have enough resources to allocate the Vm) - See Also:
-
createTemporaryVm
Description copied from interface:HostTry to allocate resources to a new temporary VM in the Host. The method is used only to book resources for a given VM. If Hosts are being chosen to migrate a set of VMs, when a Host is selected for a given VM, using this method: - the resources are reserved, - then, when the next Vm is selected for the same Host, the previous reserved resources were already reduced from the available amount. This way, if it was possible to place just one Vm into that Host, with the booking, no other VM will be selected to it.- Specified by:
createTemporaryVmin interfaceHost- Parameters:
vm- Vm being started- Returns:
- a
HostSuitabilityto indicate if the Vm was placed into the Host or not (if the Host doesn't have enough resources to allocate the Vm) TODO: https://github.com/cloudsimplus/cloudsimplus/issues/94
-
reallocateMigratingInVms
public void reallocateMigratingInVms()Description copied from interface:HostReallocate VMs migrating into this Host. Gets the VMs in the migrating-in queue and allocates them on the Host.- Specified by:
reallocateMigratingInVmsin interfaceHost
-
isSuitableForVm
Description copied from interface:HostChecks if the Host is suitable for a Vm (if it has enough resources to meet the Vm requirements) and the Host has not failed.- Specified by:
isSuitableForVmin interfaceHost- Parameters:
vm- the Vm to check- Returns:
- true if is suitable for Vm, false otherwise
- See Also:
-
getSuitabilityFor
Description copied from interface:HostChecks if the host is suitable for a Vm (if it has enough resources to meet the Vm requirements) and the Host has not failed, providing fine-grained information about the suitability of each Host resource.- Specified by:
getSuitabilityForin interfaceHost- Parameters:
vm- the Vm to check- Returns:
- a
HostSuitabilityobject indicating the Host's resources that are suitable or not for the given Vm. - See Also:
-
hasEverStarted
public boolean hasEverStarted()- Specified by:
hasEverStartedin interfaceHost- Returns:
- true if the Host has ever started sometime, i.e., if it was active sometime in the simulation execution; false otherwise.
-
setActive
Description copied from interface:HostRequests the Host to be powered on or off. If there is noExecDelayable.getStartupDelay()orExecDelayable.getShutDownDelay()(which is the default), those operations will happen immediately.If the Host is set to be powered off while it has VMs running, it is simulated a scheduled shutdown, so that those VMs will finish, but new ones won't be submitted to this Host.
-
shutdown
public void shutdown()Description copied from interface:ExecDelayableSends a request to shut down the entity.- Specified by:
shutdownin interfaceExecDelayable- Specified by:
shutdownin interfaceHost- See Also:
-
processActivation
public void processActivation(boolean activate) Process an event for actually powering theHoston or off after any defined startup/shutdown delay (if some delay is set).- Parameters:
activate- true to start the Host up, false to shut it down- See Also:
-
destroyVm
Destroys a Vm running in the Host and removes it from thegetVmList(). If the Vm was not created yet, this method has no effect.- Parameters:
vm- the VM to be destroyed
-
destroyTemporaryVm
Destroys a temporary Vm created into the Host to book resources.- Parameters:
vm- the Vm to be destroyed- See Also:
-
destroyVmInternal
-
deallocateResourcesOfVm
Deallocate all resources that a Vm was using.- Parameters:
vm- the VM to deallocate resources from
-
destroyAllVms
public void destroyAllVms()Destroys all Vm's running in the Host and removes them from thegetVmList(). -
addOnStartupListener
Description copied from interface:HostAdds a listener object that will be notified every time the host is powered on.- Specified by:
addOnStartupListenerin interfaceHost- Parameters:
listener- the Listener to add- Returns:
- this Host
-
removeOnStartupListener
Description copied from interface:HostRemoves a Listener object from the OnStartup List.- Specified by:
removeOnStartupListenerin interfaceHost- Parameters:
listener- the Listener to remove- Returns:
- true if the Listener was removed, false otherwise
-
addOnShutdownListener
Description copied from interface:HostAdds a listener object that will be notified every time the host is powered off.- Specified by:
addOnShutdownListenerin interfaceHost- Parameters:
listener- the Listener to add- Returns:
- this Host
-
removeOnShutdownListener
Description copied from interface:HostRemoves a Listener object from the OnShutdown List.- Specified by:
removeOnShutdownListenerin interfaceHost- Parameters:
listener- the Listener to remove- Returns:
- true if the Listener was removed, false otherwise
-
removeOnUpdateProcessingListener
public boolean removeOnUpdateProcessingListener(@NonNull @NonNull EventListener<HostUpdatesVmsProcessingEventInfo> listener) Description copied from interface:HostRemoves a Listener object from the OnUpdateProcessing List.- Specified by:
removeOnUpdateProcessingListenerin interfaceHost- Parameters:
listener- the listener to remove- Returns:
- true if the listener was found and removed, false otherwise
- See Also:
-
addOnUpdateProcessingListener
public Host addOnUpdateProcessingListener(@NonNull @NonNull EventListener<HostUpdatesVmsProcessingEventInfo> listener) Description copied from interface:HostAdds a listener object that will be notified every time the host updates the processing of all itsVMs.- Specified by:
addOnUpdateProcessingListenerin interfaceHost- Parameters:
listener- the OnUpdateProcessingListener to add- Returns:
- this Host
- See Also:
-
getPesNumber
public long getPesNumber()- Specified by:
getPesNumberin interfaceMachine<FileStorage>- Returns:
- the overall number of
Pes the machine has, that include PEs of all statuses, including failed PEs. - See Also:
-
getAllocatedMipsForVm
-
getMips
public double getMips()- Specified by:
getMipsin interfaceMachine<FileStorage>- Returns:
- the individual MIPS capacity of any machine's
Pe, considering that all PEs have the same capacity.
-
getTotalMipsCapacity
public double getTotalMipsCapacity()- Specified by:
getTotalMipsCapacityin interfaceHost- Specified by:
getTotalMipsCapacityin interfaceMachine<FileStorage>- Returns:
- total MIPS capacity of
Pes which are notPe.Status.FAILED.
-
getTotalAvailableMips
public double getTotalAvailableMips()- Specified by:
getTotalAvailableMipsin interfaceHost- Returns:
- the current total amount of available MIPS at the Host.
-
getTotalAllocatedMips
public double getTotalAllocatedMips()- Specified by:
getTotalAllocatedMipsin interfaceHost- Returns:
- the total allocated MIPS at the Host.
-
getTotalAllocatedMipsForVm
Description copied from interface:HostReturns the total allocated MIPS for a VM across all its PEs.- Specified by:
getTotalAllocatedMipsForVmin interfaceHost- Parameters:
vm- the Vm to get its total allocated MIPS- Returns:
- the total allocated MIPS for a VM across all its PEs
-
getBw
- Specified by:
getBwin interfaceMachine<FileStorage>- Returns:
- a resource representing the machine bandwidth (bw) in Megabits/s.
-
getRam
- Specified by:
getRamin interfaceMachine<FileStorage>- Returns:
- a resource representing the machine memory in Megabytes.
-
getStorage
- Specified by:
getStoragein interfaceMachine<FileStorage>- Returns:
- the storage device of the machine with capacity in Megabytes.
-
setRamProvisioner
Description copied from interface:HostSets the ram provisioner with capacity in Megabytes.- Specified by:
setRamProvisionerin interfaceHost- Parameters:
ramProvisioner- the new ram provisioner
-
setBwProvisioner
Description copied from interface:HostSets the bandwidth (BW) provisioner with capacity in Megabits/s.- Specified by:
setBwProvisionerin interfaceHost- Parameters:
bwProvisioner- the new bw provisioner
-
setVmScheduler
Description copied from interface:HostSets the policy for allocation of hostPes to VMs to schedule VM execution. The host also sets itself to the given scheduler. It also sets the Host itself to the given scheduler.- Specified by:
setVmSchedulerin interfaceHost- Parameters:
vmScheduler- the vm scheduler to set- Returns:
- this Host
-
onStart
public void onStart(double startTime) Description copied from class:StartableAbstractNotifies when the entity is actually started.- Specified by:
onStartin classStartableAbstract- Parameters:
startTime- 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
-
isFinished
public boolean isFinished()- Specified by:
isFinishedin interfaceHost- Specified by:
isFinishedin interfaceStartable- Returns:
- true if this entity has finished execution; false otherwise
- See Also:
-
getUpTime
-
getTotalUpTime
public double getTotalUpTime()Description copied from interface:HostReturns the total time (in seconds) the Host stayed active (powered on). Since the Host can be powered on and off according to the demand, this method returns the sum of all intervals the Host was active.- Specified by:
getTotalUpTimein interfaceHost- Returns:
- the total time (in seconds) the Host stayed active (powered on)
- See Also:
-
getUpTimeHours
public double getUpTimeHours()- Specified by:
getUpTimeHoursin interfaceHost- Returns:
- the elapsed time (in hours) since the last power on.
- See Also:
-
getTotalUpTimeHours
public double getTotalUpTimeHours()Description copied from interface:HostReturns the total time (in hours) the Host stayed active (powered on). Since the Host can be powered on and off according to the demand, this method returns the sum of all intervals the Host was active.- Specified by:
getTotalUpTimeHoursin interfaceHost- Returns:
- the total time (in hours) the Host stayed active (powered on)
- See Also:
-
setPeList
-
getVmList
-
getVmCreatedList
Description copied from interface:HostGets a read-only list of all VMs that have been created into the Host during the entire simulation. This way, this method returns a historic list of created VMs, including those already destroyed.- Specified by:
getVmCreatedListin interfaceHost- Type Parameters:
T- The Vm generic type- Returns:
- the read-only created VM historic list
-
addVmToList
-
addVmToCreatedList
-
setFailed
public final boolean setFailed(boolean failed) Description copied from interface:HostSets the Host state to "failed" or "working". -
setPeStatus
-
incFailedPesNumber
protected void incFailedPesNumber(int inc) Updates the number of failed (and working)Pes, decreasing it if a negative number is given, or increasing otherwise.- Parameters:
inc- the value to sum (positive or negative) to the number of busy PEs
-
incFreePesNumber
protected void incFreePesNumber(int inc) Updates the number of freePes, decreasing it if a negative number is given, or increasing otherwise.- Parameters:
inc- the value to sum (positive or negative) to the number of busy PEs
-
incBusyPesNumber
protected void incBusyPesNumber(int inc) Updates the number of busyPes, decreasing it if a negative number is given, or increasing otherwise.- Parameters:
inc- the value to sum (positive or negative) to the number of busy PEs
-
getVmsMigratingIn
Description copied from interface:HostGets the list of VMs migrating into this host.- Specified by:
getVmsMigratingInin interfaceHost- Type Parameters:
T- the generic type- Returns:
- the VMs migrating in
-
hasMigratingVms
public boolean hasMigratingVms()- Specified by:
hasMigratingVmsin interfaceHost- Returns:
- true if there is any VM migrating in or out this host; false otherwise.
-
addMigratingInVm
Description copied from interface:HostTry to add a Vm migrating into the current Host if there are enough resources for it. In this case, the resources are allocated and the Vm is added to theHost.getVmsMigratingIn()List. Otherwise, the Vm is not added.- Specified by:
addMigratingInVmin interfaceHost- Parameters:
vm- the Vm to add to the migrating-in list- Returns:
- true if the Vm was migrated in; false if the Host doesn't have enough resources to place the Vm
-
removeMigratingInVm
Description copied from interface:HostRemoves a VM migrating into this Host from the migrating-in list, so that the VM can be actually placed into the Host and the migration process finished.- Specified by:
removeMigratingInVmin interfaceHost- Parameters:
vm- the Vm to remove
-
getVmsMigratingOut
- Specified by:
getVmsMigratingOutin interfaceHost- Returns:
- a read-only list of VMs migrating out from the Host.
-
addVmMigratingOut
Description copied from interface:HostAdds aVmto the list of VMs migrating out this Host.- Specified by:
addVmMigratingOutin interfaceHost- Parameters:
vm- the Vm to be added- Returns:
- true if the Vm was added, false otherwise
-
removeVmMigratingOut
Description copied from interface:HostRemoves aVmfrom the list of VMs migrating out this Host.- Specified by:
removeVmMigratingOutin interfaceHost- Parameters:
vm- the Vm to be removed- Returns:
- true if the Vm was removed, false otherwise
-
setDatacenter
Description copied from interface:HostSets theDatacenterwhere the host is placed.- Specified by:
setDatacenterin interfaceHost- Parameters:
datacenter- the new data center to move the host
-
getAvailableStorage
public long getAvailableStorage()- Specified by:
getAvailableStoragein interfaceHost- Returns:
- the total free storage available at the Host in Megabytes.
-
getBusyPesPercent
public double getBusyPesPercent()- Specified by:
getBusyPesPercentin interfaceHost- Returns:
- the current percentage (from 0..1) of used (busy)
Pes, according to thetotal number of PEs. - See Also:
-
getBusyPesPercent
public double getBusyPesPercent(boolean hundredScale) Description copied from interface:HostGets the current percentage of used (busy)Pes, according to thetotal number of PEs.- Specified by:
getBusyPesPercentin interfaceHost- Parameters:
hundredScale- true for getting the return in the 0..100 scale; false for the 0..1 scale.- Returns:
- the percentage of busy PEs in the defined scale (according to the hundredScale parameter).
- See Also:
-
getResources
- Specified by:
getResourcesin interfaceResourceful- Returns:
- a read-only list of resources the machine has.
- See Also:
-
getProvisioner
Description copied from interface:Host- Specified by:
getProvisionerin interfaceHost- Parameters:
resourceClass- the class of the resource to get its provisioner- Returns:
- the
ResourceProvisionerfor the given resource class
-
getWorkingPeList
- Specified by:
getWorkingPeListin interfaceHost- Returns:
- the list of working (non-failed)
Pes of the Host.
-
getBusyPeList
- Specified by:
getBusyPeListin interfaceHost- Returns:
- the list of
Pes of the Host that arePe.Status.BUSY.
-
getFreePeList
- Specified by:
getFreePeListin interfaceHost- Returns:
- the list of free (non-failed)
Pes of the Host.
-
getCpuPercentUtilization
public double getCpuPercentUtilization()- Specified by:
getCpuPercentUtilizationin interfaceHost- Returns:
- the current percentage (between [0 and 1]) of CPU capacity (MIPS) used by all running VMs. It represents the actual percentage of MIPS allocated.
-
getCpuPercentRequested
public double getCpuPercentRequested()- Specified by:
getCpuPercentRequestedin interfaceHost- Returns:
- the percentage (between [0 and 1]) of CPU capacity (MIPS) requested by all running VMs 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.
-
getCpuMipsUtilization
public double getCpuMipsUtilization()- Specified by:
getCpuMipsUtilizationin interfaceHost- Returns:
- the current total utilization of CPU in MIPS, considering the usage of all its PEs.
-
getRamUtilization
public long getRamUtilization()- Specified by:
getRamUtilizationin interfaceHost- Returns:
- the current utilization of memory (in Megabytes).
-
getBwUtilization
public long getBwUtilization()- Specified by:
getBwUtilizationin interfaceHost- Returns:
- the current utilization of bw (in Megabits/s).
-
enableUtilizationStats
public void enableUtilizationStats()Description copied from interface:HostEnables the data collection and computation of utilization statistics. It iterates over all existing VMs, enabling the statistics computation on everyone. Keep in mind that when a Host is created, it has no VMs. Therefore, you need to call this method for every VM if you are enabling the computation before the simulation starts and VM placement is performed.- Specified by:
enableUtilizationStatsin interfaceHost- Specified by:
enableUtilizationStatsin interfaceResourceStatsComputer<HostResourceStats>- See Also:
-
setPowerModel
Description copied from interface:HostSets thePowerModelHostused by the Host to define how it consumes power. A Host just provides power usage data if a PowerModel is set.- Specified by:
setPowerModelin interfaceHost- Specified by:
setPowerModelin interfacePowerAware<PowerModelHost>- Parameters:
powerModel- thePowerModelHostto set
-
getFinishedVms
- Specified by:
getFinishedVmsin interfaceHost- Returns:
- the List of VMs that have finished executing.
-
getStateHistory
- Specified by:
getStateHistoryin interfaceHost- Returns:
- a read-only Host state history.
This List is just populated if
Host.isStateHistoryEnabled() - See Also:
-
getMigratableVms
- Specified by:
getMigratableVmsin interfaceHost- Returns:
- the list of VMs that can be migrated from the Host.
-