public interface Host extends Machine, Comparable<Host>
NullPointerException
when using the NULL
object instead
of attributing null
to Host
variables.Modifier and Type | Field and Description |
---|---|
static Host |
NULL
An attribute that implements the Null Object Design Pattern for
Host
objects. |
Modifier and Type | Method and Description |
---|---|
boolean |
addMigratingInVm(Vm vm)
Try to add a VM migrating into the current host
if there is enough resources for it.
|
Host |
addOnUpdateProcessingListener(EventListener<HostUpdatesVmsProcessingEventInfo> listener)
Adds a listener object that will be notified every time when
the host updates the processing of all its
VMs . |
boolean |
addVmMigratingOut(Vm vm)
Adds a
Vm to the list of VMs migrating out from the Host. |
boolean |
allocatePesForVm(Vm vm,
List<Double> mipsShare)
Allocates PEs for a VM.
|
boolean |
createTemporaryVm(Vm vm)
Try to allocate resources to a new temporary VM in the Host.
|
boolean |
createVm(Vm vm)
Try to allocate resources to a new VM in the Host.
|
void |
deallocatePesForVm(Vm vm)
Releases PEs allocated to a VM.
|
void |
destroyAllVms()
Destroys all VMs running in the host and remove them from the
getVmList() . |
void |
destroyTemporaryVm(Vm vm)
Destroys a temporary VM created into the Host to book resources.
|
void |
destroyVm(Vm vm)
Destroys a VM running in the host and removes it from the
getVmList() . |
List<Double> |
getAllocatedMipsForVm(Vm vm)
Gets the MIPS share of each Pe that is allocated to a given VM.
|
double |
getAvailableMips()
Gets the current amount of available MIPS at the host.
|
long |
getAvailableStorage()
Gets the total free storage available at the host in Megabytes.
|
ResourceProvisioner |
getBwProvisioner()
Gets the bandwidth (BW) provisioner with capacity in Megabits/s.
|
Datacenter |
getDatacenter()
Gets the Datacenter where the host is placed.
|
double |
getMaxAvailableMips()
Returns the maximum available MIPS among all the PEs of the host.
|
long |
getNumberOfFailedPes()
Gets the number of PEs that have failed.
|
int |
getNumberOfFreePes()
Gets the free pes number.
|
long |
getNumberOfWorkingPes()
Gets the number of PEs that are working.
|
List<Pe> |
getPeList()
Gets the list of all Processing Elements (PEs) of the host,
including failed PEs.
|
ResourceProvisioner |
getProvisioner(Class<? extends ResourceManageable> resourceClass)
|
ResourceProvisioner |
getRamProvisioner()
Gets the ram provisioner with capacity in Megabytes.
|
double |
getTotalAllocatedMipsForVm(Vm vm)
Gets the total allocated MIPS for a VM along all its PEs.
|
double |
getTotalMipsCapacity()
Gets total MIPS capacity of PEs which are not
Pe.Status.FAILED . |
long |
getUtilizationOfBw()
Gets the current utilization of bw (in absolute values).
|
double |
getUtilizationOfCpu()
Gets current utilization of CPU in percentage (between [0 and 1]),
considering the usage of all its PEs..
|
double |
getUtilizationOfCpuMips()
Gets the current total utilization of CPU in MIPS,
considering the usage of all its PEs.
|
long |
getUtilizationOfRam()
Gets the current utilization of memory (in absolute values).
|
Vm |
getVm(int vmId,
int brokerId)
Gets a VM by its id and user.
|
<T extends Vm> |
getVmList()
Gets a read-only list of VMs assigned to the host.
|
VmScheduler |
getVmScheduler()
Gets the policy for allocation of host PEs to VMs in order to schedule VM execution.
|
<T extends Vm> |
getVmsMigratingIn()
Gets the list of VMs migrating into this host.
|
Set<Vm> |
getVmsMigratingOut()
Gets a read-only list of VMs migrating out from the Host.
|
List<Pe> |
getWorkingPeList()
Gets the list of working Processing Elements (PEs) of the host,
which excludes failed PEs.
|
boolean |
isActive()
Checks if the Host is powered-on or not.
|
boolean |
isFailed()
Checks if the host is working properly or has failed.
|
boolean |
isSuitableForVm(Vm vm)
Checks if the host active and is suitable for vm.
|
void |
reallocateMigratingInVms()
Reallocate VMs migrating into the host.
|
void |
removeMigratingInVm(Vm vm)
Removes a migrating in vm.
|
boolean |
removeOnUpdateProcessingListener(EventListener<HostUpdatesVmsProcessingEventInfo> listener)
Removes a listener object from the OnUpdateProcessingListener List.
|
boolean |
removeVmMigratingIn(Vm vm)
Adds a
Vm to the list of VMs migrating into the Host. |
boolean |
removeVmMigratingOut(Vm vm)
Adds a
Vm to the list of VMs migrating out from the Host. |
Host |
setActive(boolean active)
Sets the powered state of the Host, to indicate if it's powered on or off.
|
Host |
setBwProvisioner(ResourceProvisioner bwProvisioner)
Sets the bandwidth (BW) provisioner with capacity in Megabits/s.
|
void |
setDatacenter(Datacenter datacenter)
Sets the Datacenter where the host is placed.
|
boolean |
setFailed(boolean failed)
Sets the Host state to "failed" or "working".
|
boolean |
setPeStatus(int peId,
Pe.Status status)
Sets the particular Pe status on the host.
|
Host |
setRamProvisioner(ResourceProvisioner ramProvisioner)
Sets the ram provisioner with capacity in Megabytes.
|
Host |
setSimulation(Simulation simulation)
Sets the CloudSim instance that represents the simulation the Entity is related to.
|
Host |
setVmScheduler(VmScheduler vmScheduler)
Sets the policy for allocation of host PEs to VMs in order to schedule VM
execution.
|
double |
updateProcessing(double currentTime)
Updates the processing of VMs running on this Host,
that makes the processing of cloudlets inside such VMs to be updated.
|
getBw, getMips, getNumberOfPes, getRam, getSimulation, getStorage
setId
getId
getResource, getResources
compareTo
Datacenter getDatacenter()
void setDatacenter(Datacenter datacenter)
datacenter
- the new data center to move the hostboolean isSuitableForVm(Vm vm)
vm
- the vmboolean isActive()
Host setActive(boolean active)
If it is set to powered off while VMs are running inside it, it is simulated a scheduled shutdown, so that, all running VMs will finish, but not more VMs will be submitted to this Host.
active
- true to set the Host as powered on, false as powered off<T extends Vm> Set<T> getVmsMigratingIn()
T
- the generic typeboolean addMigratingInVm(Vm vm)
getVmsMigratingIn()
List.
Otherwise, the VM is not added.vm
- the vmSet<Vm> getVmsMigratingOut()
boolean addVmMigratingOut(Vm vm)
Vm
to the list of VMs migrating out from the Host.vm
- the vm to be addedboolean removeVmMigratingIn(Vm vm)
Vm
to the list of VMs migrating into the Host.vm
- the vm to be addedboolean removeVmMigratingOut(Vm vm)
Vm
to the list of VMs migrating out from the Host.vm
- the vm to be addedvoid reallocateMigratingInVms()
double getTotalMipsCapacity()
Pe.Status.FAILED
.getTotalMipsCapacity
in interface Machine
void removeMigratingInVm(Vm vm)
vm
- the vmboolean allocatePesForVm(Vm vm, List<Double> mipsShare)
vm
- the vmmipsShare
- the list of MIPS share to be allocated to the VMvoid deallocatePesForVm(Vm vm)
vm
- the vmList<Double> getAllocatedMipsForVm(Vm vm)
vm
- the vmdouble getTotalAllocatedMipsForVm(Vm vm)
vm
- the vmList<Pe> getPeList()
getWorkingPeList()
List<Pe> getWorkingPeList()
int getNumberOfFreePes()
boolean setPeStatus(int peId, Pe.Status status)
peId
- the pe idstatus
- the new Pe statuslong getNumberOfWorkingPes()
long getNumberOfFailedPes()
double getAvailableMips()
double getMaxAvailableMips()
long getAvailableStorage()
ResourceProvisioner getBwProvisioner()
Host setBwProvisioner(ResourceProvisioner bwProvisioner)
bwProvisioner
- the new bw provisionerResourceProvisioner getRamProvisioner()
Host setRamProvisioner(ResourceProvisioner ramProvisioner)
ramProvisioner
- the new ram provisionerVm getVm(int vmId, int brokerId)
vmId
- the vm idbrokerId
- ID of VM's owner<T extends Vm> List<T> getVmList()
T
- The generic typeVmScheduler getVmScheduler()
VmScheduler
Host setVmScheduler(VmScheduler vmScheduler)
vmScheduler
- the vm scheduler to setboolean isFailed()
boolean setFailed(boolean failed)
failed
- true to set the Host to "failed", false to set to "working"double updateProcessing(double currentTime)
currentTime
- the current timeDouble.MAX_VALUE
if there is no next Cloudlet to executeboolean createVm(Vm vm)
vm
- Vm being startedvoid destroyVm(Vm vm)
getVmList()
.vm
- the VMboolean createTemporaryVm(Vm vm)
vm
- Vm being startedvoid destroyTemporaryVm(Vm vm)
vm
- the VMcreateTemporaryVm(Vm)
void destroyAllVms()
getVmList()
.Host addOnUpdateProcessingListener(EventListener<HostUpdatesVmsProcessingEventInfo> listener)
VMs
.listener
- the OnUpdateProcessingListener to addupdateProcessing(double)
boolean removeOnUpdateProcessingListener(EventListener<HostUpdatesVmsProcessingEventInfo> listener)
listener
- the listener to removeupdateProcessing(double)
Host setSimulation(Simulation simulation)
Datacenter
that the host belongs to.simulation
- The CloudSim instance that represents the simulation the Entity is related toResourceProvisioner getProvisioner(Class<? extends ResourceManageable> resourceClass)
resourceClass
- the class of the resource to get its provisionerResourceProvisioner
for the given resource classdouble getUtilizationOfCpu()
double getUtilizationOfCpuMips()
long getUtilizationOfBw()
long getUtilizationOfRam()
Copyright © 2015–2017 Systems, Security and Image Communication Lab - Instituto de Telecomunicações (IT) - Universidade da Beira Interior (UBI) - Instituto Federal de Educação Ciência e Tecnologia do Tocantins (IFTO). All rights reserved.