Package org.cloudbus.cloudsim.vms
Class VmGroup
java.lang.Object
org.cloudbus.cloudsim.core.CustomerEntityAbstract
org.cloudbus.cloudsim.vms.VmSimple
org.cloudbus.cloudsim.vms.VmGroup
- All Implemented Interfaces:
Comparable<Vm>
,AbstractMachine<Resource>
,ChangeableId
,CustomerEntity
,Delayable
,Identifiable
,ResourceStatsComputer<VmResourceStats>
,UniquelyIdentifiable
,TimeZoned
,Resourceful
,Vm
Represents a List of VMs that form a group,
so that should be placed together at the same,
according to resource availability.
This way, such an object is not an actual
Vm
,
but a mock used to check if all the resources
required by all VMs inside the group are available at a
single Host.
It assumes all VMs belong to the same DatacenterBroker
.
- Since:
- CloudSim Plus 4.6.0
- Author:
- Manoel Campos da Silva Filho
-
Field Summary
Fields inherited from interface org.cloudbus.cloudsim.datacenters.TimeZoned
MAX_TIME_ZONE_OFFSET, MIN_TIME_ZONE_OFFSET
-
Constructor Summary
ConstructorDescriptionCreates a VmGroup for a List of VMs to be placed at the datacenter closest to a given timezone.Creates a VmGroup for a List of VMs.Creates a VmGroup for a List of VMs to be placed at the datacenter closest to a given timezone. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Computes the relative percentage of the Bandwidth the VM is using from the Host's total capacity for the current simulation time.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.double
Computes the relative percentage of the RAM the VM is using from the Host's total Capacity for the current simulation time.Gets the List of VMs belonging to this group.final Vm
setTimeZone
(double timeZone) Sets the time zone offset between [TimeZoned.MIN_TIME_ZONE_OFFSET
andTimeZoned.MAX_TIME_ZONE_OFFSET
].int
size()
Gets the number of VMs in this group.double
updateProcessing
(double currentTime, MipsShare mipsShare) Updates the processing of cloudlets running on this VM.Methods inherited from class org.cloudbus.cloudsim.vms.VmSimple
addExpectedFreePesNumber, addOnCreationFailureListener, addOnHostAllocationListener, addOnHostDeallocationListener, addOnMigrationFinishListener, addOnMigrationStartListener, addOnUpdateProcessingListener, addStateHistoryEntry, compareTo, enableUtilizationStats, getAllocatedMips, getBw, getBwVerticalScaling, getCloudletScheduler, getCpuPercentRequested, getCpuPercentRequested, getCpuPercentUtilization, getCpuPercentUtilization, getCpuUtilizationStats, getCurrentRequestedBw, getCurrentRequestedMips, getCurrentRequestedRam, getDefaultBwCapacity, getDefaultRamCapacity, getDefaultStorageCapacity, getDescription, getExpectedFreePesNumber, getExpectedHostCpuUtilization, getFreePesNumber, getGroup, getHorizontalScaling, getHost, getLastBusyTime, getMips, getNumberOfPes, getPeVerticalScaling, getProcessor, getRam, getRamVerticalScaling, getRequestedMips, getResource, getResources, getStartTime, getStateHistory, getStopTime, getStorage, getSubmissionDelay, getTimeZone, getTotalCpuMipsRequested, getTotalCpuMipsUtilization, getTotalCpuMipsUtilization, getTotalExecutionTime, getTotalMipsCapacity, getVmm, hasStartedSomeCloudlet, isCreated, isDelayed, isFailed, isInMigration, isSuitableForCloudlet, isWorking, notifyOnCreationFailureListeners, notifyOnHostAllocationListeners, notifyOnHostDeallocationListeners, notifyOnUpdateProcessingListeners, removeExpectedFreePesNumber, removeOnCreationFailureListener, removeOnHostAllocationListener, removeOnHostDeallocationListener, removeOnMigrationFinishListener, removeOnMigrationStartListener, removeOnUpdateProcessingListener, setAllocatedMips, setBw, setBwVerticalScaling, setCloudletScheduler, setCloudletsToFailed, setCreated, setDefaultBwCapacity, setDefaultRamCapacity, setDefaultStorageCapacity, setDescription, setFailed, setFreePesNumber, setGroup, setHorizontalScaling, setHost, setInMigration, setMips, setPeVerticalScaling, setRam, setRamVerticalScaling, setRequestedMips, setSize, setStartTime, setStopTime, setSubmissionDelay, setVmm, toString, updateMigrationFinishListeners, updateMigrationStartListeners, updateProcessing
Methods inherited from class org.cloudbus.cloudsim.core.CustomerEntityAbstract
equals, getArrivedTime, getBroker, getCreationTime, getId, getLastTriedDatacenter, getSimulation, getUid, getWaitTime, hashCode, setArrivedTime, setBroker, setCreationTime, setCreationTime, setId, setLastTriedDatacenter
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.cloudbus.cloudsim.core.AbstractMachine
getIdleInterval, getSimulation, isIdle
Methods inherited from interface org.cloudbus.cloudsim.core.ChangeableId
setId
Methods inherited from interface org.cloudbus.cloudsim.core.CustomerEntity
getArrivedTime, getCreationTime, getLastTriedDatacenter, getSimulation, getWaitTime, setArrivedTime, setLastTriedDatacenter
Methods inherited from interface org.cloudbus.cloudsim.core.Identifiable
getId
Methods inherited from interface org.cloudbus.cloudsim.datacenters.TimeZoned
distance, validateTimeZone
Methods inherited from interface org.cloudbus.cloudsim.core.UniquelyIdentifiable
getUid
Methods inherited from interface org.cloudbus.cloudsim.vms.Vm
getBroker, getHostCpuUtilization, isIdleEnough, setBroker
-
Constructor Details
-
VmGroup
Creates a VmGroup for a List of VMs.- Parameters:
vmList
- the List of VMs to create the group
-
VmGroup
Creates a VmGroup for a List of VMs to be placed at the datacenter closest to a given timezone. All VMs will be changed to the given timezone.- Parameters:
vmList
- the List of VMs to create the grouptimeZone
- the timezone of the Datacenter where it's expected the VMs to be placed as close as possible- See Also:
-
VmGroup
Creates a VmGroup for a List of VMs to be placed at the datacenter closest to a given timezone. All VMs will be changed to the given timezone.- Parameters:
id
- the VmGroup IDvmList
- the List of VMs to create the grouptimeZone
- the timezone of the Datacenter where it's expected the VMs to be placed as close as possible- See Also:
-
-
Method Details
-
getHostCpuUtilization
public double getHostCpuUtilization(double time) Description copied from interface:Vm
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.- Specified by:
getHostCpuUtilization
in interfaceVm
- Overrides:
getHostCpuUtilization
in classVmSimple
- Parameters:
time
- the time to get the relative VM CPU utilization- Returns:
- the relative VM CPU usage percent (from 0 to 1)
-
getHostRamUtilization
public double getHostRamUtilization()Description copied from interface:Vm
Computes the relative percentage of the RAM the VM is using from the Host's total Capacity for the current simulation time.- Specified by:
getHostRamUtilization
in interfaceVm
- Overrides:
getHostRamUtilization
in classVmSimple
- Returns:
- the relative VM RAM usage percent (from 0 to 1)
-
getHostBwUtilization
public double getHostBwUtilization()Description copied from interface:Vm
Computes the relative percentage of the Bandwidth the VM is using from the Host's total capacity for the current simulation time.- Specified by:
getHostBwUtilization
in interfaceVm
- Overrides:
getHostBwUtilization
in classVmSimple
- Returns:
- the relative VM BW usage percent (from 0 to 1)
-
setTimeZone
Description copied from interface:Vm
Sets the time zone offset between [TimeZoned.MIN_TIME_ZONE_OFFSET
andTimeZoned.MAX_TIME_ZONE_OFFSET
]. That is the timezone in which the VM is expected to be placed (if there is aDatacenter
with enough capacity available at that timezone).- Specified by:
setTimeZone
in interfaceTimeZoned
- Specified by:
setTimeZone
in interfaceVm
- Overrides:
setTimeZone
in classVmSimple
- Parameters:
timeZone
- the new expected time zone offset- Returns:
-
getVmList
Gets the List of VMs belonging to this group.- Returns:
-
size
public int size()Gets the number of VMs in this group.- Returns:
-