## 4 Application of HS to VM Consolidation
### Harmony Search for VM Consolidation
#### 4.2.2 Pitch Adjustments of HS for VM Consolidation  
For HS, the most influential operator that creates a significant neighboring solution is the PA. The HMC is the standard for neighborhood search, and randomization contributes to avoiding the local solution. Their suitable combination plays an important role in creating an improved solution. The PA is designed to demonstrate high performance and search for an efficient solution for the VM consolidation model. In VM consolidation, VM migration occurs when either overload or underload of the PM workload is detected. The contrapositive of the proposition mentioned above becomes \"if overload or underload of the PM workload does not occur, then VM migration is not necessary\". Ultimately, if the PM workload remains constant, the VM need not migrate. As shown in Figure 6, if a VM with the inverse workload is combined, the PM workload remains constant, and the VM can achieve sustainable operation by minimizing DC power consumption and VM migration, which is the objective of VM consolidation. The measure indicating the degree of stability of the PM workload is calculated as the standard deviation of the workload time-series data. The closer the standard deviation is to 0, the more stable is the workload.  
When generating a new HM, the first random number is generated based on the length of the VM, and whether MC or randomization is performed is determined collectively. Next, the MC generates a second random number for the determined VM index and determines whether it is a PA. Applying PA to the corresponding VM means selecting the VM to be migrated, which corresponds to VM selection in VM placement. The VM selection consists of three cases.  
First, a VM allocated to a PM with detected overload is selected. When PM overload occurs, it violates the SLA, so the VM of the PM must be migrated. For this reason, the VM located in the PM where overload is to be detected is always selected. Second, a VM allocated to a PM that can be idle is selected probabilistically. Since VM consolidation aims to minimize the power consumption of the DC, it is necessary to select a PM that can idle the server. A PM capable of idle conversion is a PM that has an assigned number of VMs of 1 or less or is classified as underload by a specific condition (THR, MAD, IQR, etc.), and a VM assigned to the corresponding PM is selected probabilistically. Third, when a specific VM is migrated, a VM with high workload stability is selected probabilistically. When the VM is migrated to each PM, the PM stability (\(varz\)) measure calculates the workload of the PM (\(z_{it}\)) by summing the workload of the VMs (\(c_{ft}\)) assigned to each PM as shown in Equation (12), the average of the workload for all PMs (\(\overline{Z}\)) as shown in Equation (13), and  
Figure 6: VM consolidation with stable PM workload.  
is calculated as the standard deviation between each workload and the average as shown in Equation (14).  
\[z_{it}=\sum_{j=1}^{V}\left(c_{ji}\cdot x^{\prime}{}_{ij}\right) \tag{12}\]  
\[\overline{Z}=\sum_{i=1}^{P}\sum_{t=1}^{T}z_{it}/T \tag{13}\]  
\[varz=\frac{\sum_{t=1}^{T}\left(z_{it}-\overline{Z}\right)^{2}}{T} \tag{14}\]  
The smaller the value, the higher is the stability measure, and it is considered a VM with a higher priority to migrate to another PM. Among the VMs that can be migrated, a higher level VM with a high stability measure is randomly selected. This VM selection rule was defined as a stability correlation (SC) policy. A second random number is generated for the VM index selected under the above three conditions, compared with PAR, and whether or not the PA is determined.  
The VM whose PA is determined generates a neighboring solution by adding the values in the BW, which is the same as the concept of migrating the VM to the destination PM. The feasible PM list that can migrate the VM thus becomes the bandwidth, and the roulette-wheel-based weighted selection is made based on the stability measure.