4.2. Data center internal processing
Processing of task units is handled by the respective VMs; therefore, their progress must be continuously
updated and monitored at every simulation step. For handling this, an internal event is generated
to inform the DataCenter entity that a task unit completion is expected in the near future. Thus,
at each simulation step, each DataCenter entity invokes a method called updateVMsProcessing()
for every host that it manages. Following this, the contacted VMs update processing of currently
active tasks with the host. The input parameter type for this method is the current simulation time
and the return parameter type is the next expected completion time of a task currently running in
one of the VMs on that host. The next internal event time is the least time among all the finish
times, which are returned by the hosts.
At the host level, invocation of updateVMsProcessing() triggers an updateCloudletsProcessing()
method that directs every VM to update its tasks unit status (finish, suspended, executing) with
the Datacenter entity. This method implements a similar logic as described previously for updateVMsProcessing()
but at the VM level. Once this method is called, VMs return the next expected
completion time of the task units currently managed by them. The least completion time among
all the computed values is sent to the Datacenter entity. As a result, completion times are kept
in a queue that is queried by Datacenter after each event processing step. The completed tasks
waiting in the finish queue that are directly returned concern CloudBroker or CloudCoordinator.
This process is depicted in Figure 8 in the form of a sequence diagram.