Interface Datacenter
- All Superinterfaces:
Comparable<SimEntity>,Identifiable,Nameable,PowerAware<PowerModelDatacenter>,Runnable,SimEntity,Sizeable,TimeZoned
- All Known Implementing Classes:
DatacenterSimple,NetworkDatacenter
public interface Datacenter
extends SimEntity, PowerAware<PowerModelDatacenter>, TimeZoned, Sizeable
An interface to be implemented by each class that provides Datacenter features.
- Since:
- CloudSim Plus 1.0
- Author:
- Rodrigo N. Calheiros, Anton Beloglazov, Manoel Campos da Silva Filho
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cloudsimplus.core.SimEntity
SimEntity.State -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleThe default percentage ([0..1]) of bandwidth allocated for VM migration if a value is not set.static final org.slf4j.Loggerstatic final DatacenterA property that implements the Null Object Design Pattern forDatacenterobjects.Fields inherited from interface org.cloudsimplus.datacenters.TimeZoned
MAX_TIME_ZONE_OFFSET, MIN_TIME_ZONE_OFFSET -
Method Summary
Modifier and TypeMethodDescription<T extends Host>
DatacenteraddHost(T host) Physically expands the Datacenter by adding a newHost(physical machine) to it.<T extends Host>
DatacenteraddHostList(List<T> hostList) Physically expands the Datacenter by adding a List of newHosts (physical machines) to it.addOnHostAvailableListener(EventListener<HostEventInfo> listener) Adds aEventListenerobject that will be notified every time a new Host is available for the Datacenter during simulation runtime.Adds aEventListenerobject that will be notified every time a VM migration is finished either successfully or not.Disable VM migrations.Enable VM migrations.longdoublegetHost(int index) Returns a Host in a given position inside the Host List.getHostById(long id) Gets a Host from its id.Returns an unmodifiable host list.doubleGets the time interval before trying to find suitable Hosts to migrate VMs from an under or overload Host again.doubleGets the scheduling interval to process each event received by the Datacenter (in seconds).boolean<T extends Host>
DatacenterremoveHost(T host) Removes a Host from its Datacenter.voidrequestVmMigration(Vm sourceVm) voidrequestVmMigration(Vm sourceVm, Host targetHost) voidsetBandwidthPercentForMigration(double bandwidthPercentForMigration) Sets the percentage of the bandwidth allocated to a Host to migrate VMs.setCharacteristics(DatacenterCharacteristics characteristics) Sets the Datacenter characteristics.voidsetDatacenterStorage(DatacenterStorage datacenterStorage) Sets the storage device of the Datacenter.setHostSearchRetryDelay(double delay) Sets the time interval before trying to find suitable Hosts to migrate VMs from an under or overload Host again.setSchedulingInterval(double schedulingInterval) Sets the scheduling delay to process each event received by the Datacenter.longsize()Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.cloudsimplus.core.Identifiable
getIdMethods inherited from interface org.cloudsimplus.power.PowerAware
getPowerModel, setPowerModelMethods inherited from interface org.cloudsimplus.core.SimEntity
getShutdownTime, getSimulation, getStartTime, getState, isAlive, isFinished, isStarted, processEvent, run, schedule, schedule, schedule, schedule, schedule, schedule, schedule, setName, setState, shutdown, startMethods inherited from interface org.cloudsimplus.datacenters.TimeZoned
distance, getTimeZone, setTimeZone, validateTimeZone
-
Field Details
-
LOGGER
static final org.slf4j.Logger LOGGER -
NULL
A property that implements the Null Object Design Pattern forDatacenterobjects. -
DEF_BW_PERCENT_FOR_MIGRATION
static final double DEF_BW_PERCENT_FOR_MIGRATIONThe default percentage ([0..1]) of bandwidth allocated for VM migration if a value is not set.- See Also:
-
-
Method Details
-
requestVmMigration
Sends an event to request the migration of aVmto a given targetHoston this Datacenter. If you want VM migrations to be performed automatically, use aVmAllocationPolicyMigration.- Parameters:
sourceVm- the VM to be migratedtargetHost- the target Host to migrate the VM to- See Also:
-
requestVmMigration
Sends an event to request the migration of aVmto some suitableHoston this Datacenter. A suitable Host will try to be found when the Datacenter processes the migration request message. If you want VM migrations to be performed automatically, use aVmAllocationPolicyMigration.- Parameters:
sourceVm- the VM to be migrated- See Also:
-
getHostList
-
getActiveHostStream
-
getHost
Returns a Host in a given position inside the Host List.- Parameters:
index- the position of the List to get the Host- Returns:
- a Host in a given position inside the Host List
-
getActiveHostsNumber
long getActiveHostsNumber()- Returns:
- the current number of Hosts that are powered-on inside the Datacenter.
- See Also:
-
size
-
getHostById
-
addHostList
Physically expands the Datacenter by adding a List of newHosts (physical machines) to it. Hosts can be added before or after the simulation has started. If a Host is added during simulation execution, in case VMs are added dynamically too, they may be allocated to this new Host, depending on theVmAllocationPolicy.If an ID is not assigned to a Host, the method assigns one.
- Parameters:
hostList- the List of new hosts to be added- Returns:
- this Datacenter
- See Also:
-
addHost
Physically expands the Datacenter by adding a newHost(physical machine) to it. Hosts can be added before or after the simulation has started. If a Host is added during simulation execution, in case VMs are added dynamically too, they may be allocated to this new Host, depending on theVmAllocationPolicy.If an ID is not assigned to the given Host, the method assigns one.
- Parameters:
host- the new host to be added- Returns:
- this Datacenter
- See Also:
-
removeHost
Removes a Host from its Datacenter.- Parameters:
host- the new host to be removed from its assigned Datacenter- Returns:
- this Datacenter
-
getVmAllocationPolicy
VmAllocationPolicy getVmAllocationPolicy()- Returns:
- the policy to be used by the Datacenter to allocate VMs into hosts.
- See Also:
-
getSchedulingInterval
double getSchedulingInterval()Gets the scheduling interval to process each event received by the Datacenter (in seconds). This value defines the interval in which processing ofCloudlets will be updated. The interval doesn't affect the processing of such Cloudlets, but it only defines in which interval the processing will be updated. For instance, if it is set an interval of 10 seconds, the processing of Cloudlets will be updated at every 10 seconds.The default value is zero, which indicates no scheduling interval is set, and the simulation state is updated only when a Cloudlet is finished. That ensures the highest performance but may not be desired if you want to collect some simulation data in a defined time interval.
- Returns:
- the scheduling interval (in seconds)
-
setSchedulingInterval
Sets the scheduling delay to process each event received by the Datacenter.- Parameters:
schedulingInterval- the new scheduling interval (in seconds)- Returns:
- this Datacenter
- See Also:
-
getCharacteristics
DatacenterCharacteristics getCharacteristics()- Returns:
- the Datacenter characteristics.
-
setCharacteristics
Sets the Datacenter characteristics.- Parameters:
characteristics- the characteristics to set
-
getDatacenterStorage
DatacenterStorage getDatacenterStorage()- Returns:
- the storage device of the Datacenter.
-
setDatacenterStorage
Sets the storage device of the Datacenter.- Parameters:
datacenterStorage- the new storage
-
getBandwidthPercentForMigration
double getBandwidthPercentForMigration()- Returns:
- the percentage of the bandwidth allocated to a Host to migrate VMs. It's a value between [0 and 1] (where 1 is 100%). The default value is 0.5, meaning only 50% of the bandwidth will be allowed for migration, while the remaining will be used for VM services.
- See Also:
-
setBandwidthPercentForMigration
void setBandwidthPercentForMigration(double bandwidthPercentForMigration) Sets the percentage of the bandwidth allocated to a Host to migrate VMs. It's a value between [0 and 1] (where 1 is 100%). The default value is 0.5, meaning only 50% of the bandwidth will be allowed for migration, while the remaining will be used for VM services.- Parameters:
bandwidthPercentForMigration- the bandwidth migration percentage to set
-
addOnHostAvailableListener
Adds aEventListenerobject that will be notified every time a new Host is available for the Datacenter during simulation runtime. If theaddHost(Host)oraddHostList(List)is called before the simulation starts, the listeners will not be notified.- Parameters:
listener- the event listener to add- Returns:
- this Datacenter
-
addOnVmMigrationFinishListener
Adds aEventListenerobject that will be notified every time a VM migration is finished either successfully or not.- Parameters:
listener- the event listener to add- Returns:
- this Datacenter
-
isMigrationsEnabled
boolean isMigrationsEnabled()- Returns:
- true, if migrations are enabled; false otherwise
-
enableMigrations
-
disableMigrations
-
getHostSearchRetryDelay
double getHostSearchRetryDelay()Gets the time interval before trying to find suitable Hosts to migrate VMs from an under or overload Host again.- Returns:
- the Host search delay (in seconds)
-
setHostSearchRetryDelay
Sets the time interval before trying to find suitable Hosts to migrate VMs from an under or overload Host again.- Parameters:
delay- the new delay to set (in seconds). Give a positive value to define an actual delay or a negative value to indicate a new Host search for VM migration must be tried as soon as possible- Returns:
- this Datacenter
-