VmSimple¶
-
public class
VmSimple
implements Vm¶ Implements the basic features of a Virtual Machine (VM) that runs inside a
Host
that may be shared among other VMs. It processescloudlets
. This processing happens according to a policy, defined by theCloudletScheduler
. Each VM has a owner (user), which can submit cloudlets to the VM to execute them.Author: Rodrigo N. Calheiros, Anton Beloglazov
Constructors¶
VmSimple¶
-
public
VmSimple
(int id, long mipsCapacity, long numberOfPes)¶ Creates a Vm with 1024 MEGA of RAM, 1000 Megabits/s of Bandwidth and 1024 MEGA of Storage Size. To change these values, use the respective setters. While the Vm
is being instantiated
, such values can be changed freely.Parameters:
VmSimple¶
-
public
VmSimple
(long mipsCapacity, long numberOfPes)¶ Creates a Vm with 1024 MEGA of RAM, 1000 Megabits/s of Bandwidth and 1024 MEGA of Storage Size. To change these values, use the respective setters. While the Vm
is being instantiated
, such values can be changed freely.It is not defined an id for the Vm. The id is defined when the Vm is submitted to a
DatacenterBroker
.Parameters:
VmSimple¶
-
public
VmSimple
(int id, double mipsCapacity, long numberOfPes)¶ Creates a Vm with 1024 MEGA of RAM, 1000 Megabits/s of Bandwidth and 1024 MEGA of Storage Size. To change these values, use the respective setters. While the Vm
is being instantiated
, such values can be changed freely.It receives the amount of MIPS as a double value but converts it internally to a long. The method is just provided as a handy-way to create a Vm using a double value for MIPS that usually is generated from some computations.
Parameters:
Methods¶
addOnCreationFailureListener¶
-
public Vm
addOnCreationFailureListener
(EventListener<VmDatacenterEventInfo> listener)¶
addOnHostAllocationListener¶
-
public Vm
addOnHostAllocationListener
(EventListener<VmHostEventInfo> listener)¶
addOnHostDeallocationListener¶
-
public Vm
addOnHostDeallocationListener
(EventListener<VmHostEventInfo> listener)¶
addOnUpdateProcessingListener¶
-
public Vm
addOnUpdateProcessingListener
(EventListener<VmHostEventInfo> listener)¶
addStateHistoryEntry¶
-
public void
addStateHistoryEntry
(VmStateHistoryEntry entry)¶
allocateResource¶
-
public void
allocateResource
(Class<? extends ResourceManageable> resourceClass, long newTotalResourceAmount)¶
compareTo¶
-
public int
compareTo
(Vm o)¶ Compare this Vm with another one based on
getTotalMipsCapacity()
.Parameters: - o – the Vm to compare to
Returns:
deallocateResource¶
-
public void
deallocateResource
(Class<? extends ResourceManageable> resourceClass)¶
getBroker¶
-
public DatacenterBroker
getBroker
()¶
getBwVerticalScaling¶
-
public VerticalVmScaling
getBwVerticalScaling
()¶
getCloudletScheduler¶
-
public CloudletScheduler
getCloudletScheduler
()¶
getHorizontalScaling¶
-
public HorizontalVmScaling
getHorizontalScaling
()¶
getPeVerticalScaling¶
-
public VerticalVmScaling
getPeVerticalScaling
()¶
getRamVerticalScaling¶
-
public VerticalVmScaling
getRamVerticalScaling
()¶
getResources¶
-
public List<ResourceManageable>
getResources
()¶
getSimulation¶
-
public Simulation
getSimulation
()¶
getStateHistory¶
-
public List<VmStateHistoryEntry>
getStateHistory
()¶
getUtilizationHistory¶
-
public UtilizationHistory
getUtilizationHistory
()¶
notifyOnCreationFailureListeners¶
-
public void
notifyOnCreationFailureListeners
(Datacenter failedDatacenter)¶
notifyOnHostDeallocationListeners¶
notifyOnUpdateProcessingListeners¶
removeOnCreationFailureListener¶
-
public boolean
removeOnCreationFailureListener
(EventListener<VmDatacenterEventInfo> listener)¶
removeOnHostAllocationListener¶
-
public boolean
removeOnHostAllocationListener
(EventListener<VmHostEventInfo> listener)¶
removeOnHostDeallocationListener¶
-
public boolean
removeOnHostDeallocationListener
(EventListener<VmHostEventInfo> listener)¶
removeOnUpdateProcessingListener¶
-
public boolean
removeOnUpdateProcessingListener
(EventListener<VmHostEventInfo> listener)¶
setBroker¶
-
public final Vm
setBroker
(DatacenterBroker broker)¶
setBwVerticalScaling¶
-
public final Vm
setBwVerticalScaling
(VerticalVmScaling bwVerticalScaling)¶
setCloudletScheduler¶
-
public final Vm
setCloudletScheduler
(CloudletScheduler cloudletScheduler)¶
setHorizontalScaling¶
-
public final Vm
setHorizontalScaling
(HorizontalVmScaling horizontalScaling)¶
setId¶
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
setPeVerticalScaling¶
-
public final Vm
setPeVerticalScaling
(VerticalVmScaling peVerticalScaling)¶
setRamVerticalScaling¶
-
public final Vm
setRamVerticalScaling
(VerticalVmScaling ramVerticalScaling)¶