# Modeling and Evaluation of Power-Aware Software Rejuvenation in Cloud Systems
## 5 The Proposed Model
Assuming that \(VMM_{i}\) is selected to serve the migrating VM, if the VM is small, output gate \(OG_{Mig_{S_{i}}}\) is enabled, and the number of active VMs and the age of that VMM increases by one. If the migrating VM is large, output gate \(OG_{Mig_{S_{i}}}\) is enabled, the number of active VMs running on \(VMM_{i}\) increases by one, and the age of the corresponding VMM increases by two. The completion rate of activity \(TA_{Mig}\) depends on the number of VMs that can be assigned to all available VMMs and the number of VMs waiting for migration in place \(P_{Mig}\), whichever is smaller, and the migration rate of a VM is called \(\lambda_{vmg}\)[40]. The rate of activity \(TA_{Mig}\) is demonstrated in Table 1. We also assumed a constant number for probability of failure of a VM migration task. Therefore, we assumed that output gate \(OG_{MigFailed}\) is enabled with probability \(p_{vmf}\). In this output gate, the removed token from place \(P_{Mig}\) turns back to place \(P_{Mig}\). Using this mechanism, the migration of a VM fails and should be retried. The predicate and function corresponding to the input gate of the migration sub-model are presented in row 3 of Table 2, and the output functions of the output gates of this sub-model are presented in rows 3-5 of Table 3.  
In Figure 2c, timed activity \(TA_{VMTurnOffi}\) models the serving process of a VM on the VMMi. Upon completion of activity \(TA_{VMTurnOffi}\) the number of tokens in place \(P_{CurrentVM_{S_{i}}}\) decreases by one. The tokens in place \(P_{CurrentVM_{S_{i}}}\) represent the number of active VMs on the VMMi. When there is no token in place \(P_{CurrentVM_{S_{i}}}\), input gate \(IG_{TurnOffi}\) disables time activity \(TA_{VMTurnOffi}\). Serving individual VMs occurs at rate \(\lambda_{vt}\), so the actual service rate of all VMs running on a VMM during the execution of timed activity \(TA_{VMTurnOffi}\) is equal to \(\lambda_{vt}*Mark\Big{(}P_{CurrentVM_{S_{i}}}\Big{)}\), where \(Mark(P_{CurrentVM_{S_{i}}})\) indicates the number of tokens inside place \(P_{CurrentVM_{S_{i}}}\). In other words, the actual service rate of VMs running on a VMM is the product of the \(\lambda_{vt}\) and the number of active VMs running on that VMM. Timed activity \(TA_{WakUp}\), with completion rate \(\lambda_{pw}\), models the PM wakeup process. The tokens inside place \(P_{Idle}\) represent the number of inactive or switched-off VMs in the system. Right after system start up, all PMs are assumed to be switched off, so place \(P_{Idle}\) holds as many tokens as there are PMs in the cloud data center. Upon completion of activity \(TA_{WakUp}\), a token is removed from place \(P_{Idle}\) by input gate \(IG_{WakUp}\). If there is no token in places \(P_{Ini}\) or \(P_{Mig}\), input gate \(IG_{WakUp}\) prevents the completion of activity \(TA_{WakUp}\). If more than one token exists in place \(P_{Idle}\), representing several switched-off PMs in the system, one token is randomly chosen by timed activity \(TA_{WakUp}\). In this case, \(\text{PM}_{\text{i}}\) is activated by enabling output gate \(OG_{WakUpi}\) and becomes ready for accepting VMs. Instantaneous activity \(IA_{Idlei}\) models the shutdown process of the active \(VMM_{i}\) that is lightly loaded or has no workload. When other active VMMs have enough free capacity to accept all VMs running on top of \(VMM_{i}\), the VMs are placed into the migration queue, and then \(VMM_{i}\) and its hosting PM are switched off. Upon completion of instantaneous activity \(IA_{Idlei}\), the number of tokens in place \(P_{Idle}\) increases by one, and the number of tokens in place \(P_{CurrentVM_{S_{i}}}\) is set to zero. If the tokens in place \(P_{CurrentVM_{S_{i}}}\) cannot be moved to places \(P_{CurrentVM_{S_{i}}}\) (\(i\
eq\text{j}\)), input gate \(IG_{Idlei}\) prevents instantaneous activity \(IA_{Idlei}\) from completion because other VMMs are unable to accept VMs running on \(VMM_{i}\).