HostSimple

public class HostSimple implements Host

A Host class that implements the most basic features of a Physical Machine (PM) inside a Datacenter. It executes actions related to management of virtual machines (e.g., creation and destruction). A host has a defined policy for provisioning memory and bw, as well as an allocation policy for PEs to virtual machines. A host is associated to a Datacenter and can host virtual machines.

Author:Rodrigo N. Calheiros, Anton Beloglazov

Constructors

HostSimple

public HostSimple(long ram, long bw, long storage, List<Pe> peList)

Creates a Host without a pre-defined ID and using a ResourceProvisionerSimple RAM and Bandwidth. It also sets a VmSchedulerSpaceShared as default. The ID is automatically set when a List of Hosts is attached to a Datacenter.

Parameters:
  • ram – the RAM capacity in Megabytes
  • bw – the Bandwidth (BW) capacity in Megabits/s
  • storage – the storage capacity in Megabytes
  • peList – the host’s Pe list

See also: ChangeableId.setId(long), .setRamProvisioner(ResourceProvisioner), .setBwProvisioner(ResourceProvisioner), .setVmScheduler(VmScheduler)

HostSimple

public HostSimple(ResourceProvisioner ramProvisioner, ResourceProvisioner bwProvisioner, long storage, List<Pe> peList, VmScheduler vmScheduler)

Creates a Host with the given parameters.

Parameters:
  • ramProvisioner – the ram provisioner with capacity in Megabytes
  • bwProvisioner – the bw provisioner with capacity in Megabits/s
  • storage – the storage capacity in Megabytes
  • peList – the host’s PEs list
  • vmScheduler – the vm scheduler

Methods

addMigratingInVm

public boolean addMigratingInVm(Vm vm)

addOnUpdateProcessingListener

public Host addOnUpdateProcessingListener(EventListener<HostUpdatesVmsProcessingEventInfo> listener)

addVmMigratingOut

public boolean addVmMigratingOut(Vm vm)

addVmToCreatedList

protected void addVmToCreatedList(Vm vm)

addVmToList

protected void addVmToList(Vm vm)

compareTo

public int compareTo(Host o)

Compare this Host with another one based on getTotalMipsCapacity().

Parameters:
  • o – the Host to compare to
Returns:

{@inheritDoc}

createTemporaryVm

public boolean createTemporaryVm(Vm vm)

createVm

public boolean createVm(Vm vm)

deallocatePesForVm

public void deallocatePesForVm(Vm vm)

deallocateResourcesOfAllVms

protected void deallocateResourcesOfAllVms()

Deallocate all resources that all VMs were using.

deallocateResourcesOfVm

protected void deallocateResourcesOfVm(Vm vm)

Deallocate all resources that a VM was using.

Parameters:
  • vm – the VM

destroyAllVms

public void destroyAllVms()

destroyTemporaryVm

public void destroyTemporaryVm(Vm vm)

destroyVm

public void destroyVm(Vm vm)

disableStateHistory

public void disableStateHistory()

enableStateHistory

public void enableStateHistory()

equals

public boolean equals(Object o)

getAllocatedMipsForVm

public List<Double> getAllocatedMipsForVm(Vm vm)

getAvailableMips

public double getAvailableMips()

getAvailableStorage

public long getAvailableStorage()

getBuzyPeList

public List<Pe> getBuzyPeList()

getBw

public Resource getBw()

getBwProvisioner

public ResourceProvisioner getBwProvisioner()

getDatacenter

public Datacenter getDatacenter()

getFinishedVms

public List<Vm> getFinishedVms()

getFreePeList

public List<Pe> getFreePeList()

getId

public long getId()

getMaxAvailableMips

public double getMaxAvailableMips()

getMips

public double getMips()

getNumberOfFailedPes

public long getNumberOfFailedPes()

getNumberOfFreePes

public int getNumberOfFreePes()

getNumberOfPes

public long getNumberOfPes()

{@inheritDoc}

Returns:{@inheritDoc}

See also: .getNumberOfWorkingPes(), .getNumberOfFreePes(), .getNumberOfFailedPes()

getNumberOfWorkingPes

public long getNumberOfWorkingPes()

getPeList

public List<Pe> getPeList()

getPowerModel

public PowerModel getPowerModel()

getPreviousUtilizationOfCpu

public double getPreviousUtilizationOfCpu()

getProvisioner

public ResourceProvisioner getProvisioner(Class<? extends ResourceManageable> resourceClass)

getRam

public Resource getRam()

getRamProvisioner

public ResourceProvisioner getRamProvisioner()

getResources

public List<ResourceManageable> getResources()

getShutdownTime

public double getShutdownTime()

getSimulation

public Simulation getSimulation()

getStartTime

public double getStartTime()

getStateHistory

public List<HostStateHistoryEntry> getStateHistory()

getStorage

public Resource getStorage()

getTotalAllocatedMipsForVm

public double getTotalAllocatedMipsForVm(Vm vm)

getTotalMipsCapacity

public double getTotalMipsCapacity()

getUtilizationHistory

public SortedMap<Double, DoubleSummaryStatistics> getUtilizationHistory()

getUtilizationHistorySum

public SortedMap<Double, Double> getUtilizationHistorySum()

getUtilizationOfBw

public long getUtilizationOfBw()

getUtilizationOfCpu

public double getUtilizationOfCpu()

getUtilizationOfCpuMips

public double getUtilizationOfCpuMips()

getUtilizationOfRam

public long getUtilizationOfRam()

getVm

public Vm getVm(int vmId, int brokerId)

getVmCreatedList

public <T extends Vm> List<T> getVmCreatedList()

getVmList

public <T extends Vm> List<T> getVmList()

getVmScheduler

public VmScheduler getVmScheduler()

getVmsMigratingIn

public <T extends Vm> Set<T> getVmsMigratingIn()

getVmsMigratingOut

public Set<Vm> getVmsMigratingOut()

getWorkingPeList

public List<Pe> getWorkingPeList()

hashCode

public int hashCode()

isActive

public boolean isActive()

isFailed

public boolean isFailed()

isStateHistoryEnabled

public boolean isStateHistoryEnabled()

isSuitableForVm

public boolean isSuitableForVm(Vm vm)

reallocateMigratingInVms

public void reallocateMigratingInVms()

removeMigratingInVm

public void removeMigratingInVm(Vm vm)

removeOnUpdateProcessingListener

public boolean removeOnUpdateProcessingListener(EventListener<HostUpdatesVmsProcessingEventInfo> listener)

removeVmMigratingIn

public boolean removeVmMigratingIn(Vm vm)

removeVmMigratingOut

public boolean removeVmMigratingOut(Vm vm)

setActive

public final Host setActive(boolean active)

setBwProvisioner

public final Host setBwProvisioner(ResourceProvisioner bwProvisioner)

setDatacenter

public final void setDatacenter(Datacenter datacenter)

setFailed

public final boolean setFailed(boolean failed)

setId

public final void setId(long id)

setPeList

protected final Host setPeList(List<Pe> peList)

Sets the pe list.

Parameters:
  • peList – the new pe list

setPowerModel

public Host setPowerModel(PowerModel powerModel)

setRamProvisioner

public final Host setRamProvisioner(ResourceProvisioner ramProvisioner)

setShutdownTime

public void setShutdownTime(double shutdownTime)

setSimulation

public final Host setSimulation(Simulation simulation)

setStartTime

public void setStartTime(double startTime)

setVmScheduler

public final Host setVmScheduler(VmScheduler vmScheduler)

toString

public String toString()

updateProcessing

public double updateProcessing(double currentTime)