Energy-Aware Virtual Machine Allocation in DVFS-Enabled Cloud Data Centers

Energy management is considered the major concern in cloud computing, which supports the rapid growth of data centers and computing centers; therefore, energy and load balancing have become crucial issues in cloud data centers. To address this issue, the present paper proposed a two-phase energy-aware load balancing (EALB) scheduling algorithm using the virtual machine migration through the Particle Swarm Optimization (PSO) algorithm to be applicable to dynamic voltage frequency scaling-enabled cloud data centers, which is called EALBPSO. In the first phase, an objective function was employed to deactivate a large number of physical machines in order to reduce energy consumption. The main idea of the algorithm was to maximize load balancing in the second phase, in which the remaining virtual and physical machines were used as the PSO inputs, and an objective function was also defined to distribute the load appropriately among the physical machines. In addition, a dataset was developed to test different parameters and scenarios with the aim of assessing the effectiveness of the proposed EALBPSO algorithm in comparison with other algorithms already proposed in the literature for similar purposes. The experimental results demonstrated that the proposed algorithm was capable of saving up to 0.896%, 9.716%, and 10.8% energy compared with the MDPSO algorithm, Kumar et al.’s algorithm, and Dahsti et al.’s algorithm, respectively, and also it showed 5.91%, 16%, and 16.267% improvements for the number of virtual machines migrations, and 3.867%, 8.623%, and 6.953% improvements for the deviation of processors, all compared with their competitors stated above, respectively.

VOLUME XX, 2017 1 infrastructure-based services. The rapid increase in the users' computational needs has led to enormous consumption of energy in green data centers. As the number and dimensions of cloud data centers have grown, the energy consumption problem has become one of the most important issues, which increases the energy costs of service providers, thereby playing a central role in increasing the emission of CO2 and greenhouse gases polluting the environment [1], [2].
Therefore, many methods have been suggested in the literature to decrease the energy consumption rate.
Researchers have recently been interested in solving this problem by decreasing the number of physical machines through virtual machine (VM) migration. In fact, the migration of virtual machines can have a significant effect on the reduction of energy consumption [4].
Distributed load balancing is of high importance in physical machines because maintaining the Service Level Agreement (SLA) is a major problem in servicing cloud clients. Load balancing is used as a technique for distributing workload fairly among computing resources in the cloud environment [5], [6]. It is an essential method used to achieve the optimal efficiency of resources, increasing throughput in the shortest response time and decreasing the task completion time in the cloud environment. Analyses have shown that cloud datacenter nodes typically become unbalanced during an operation process, which can reduce the efficiency level.
Thus, load balancing is essential for maintaining the cloud efficient and effective.
The challenge is that energy consumption minimization and The contributions of this paper are as follow: • A system is proposed for power-aware virtual machine allocation (EALBPSO) in cloud data centers.
• The paper proposes two novel fitness functions based on our defined term energy, which can effectively reduce the overall energy consumption and maximize the load balancing of processors in Standard Deviation • Based on an evolutionary algorithm, we introduce a comprehensive VM allocation approach that can efficiently converge to a VM-to-PM mapping with best possible energy efficiency.
• A novel optimization approach, called EALBPSO, is proposed for initial placement of virtual machines, which aims to lower power consumption and maximize the load balancing of the data center processors.
The rest of the paper is organized as follows. Section 2 reviews the related work. Section 3 introduces the system model. Section 4 describes the proposed algorithm and discusses the way it performs the defined tasks. Section 5 presents the experimental setup and reports the simulation results compared with other algorithms already presented in the literature. Finally, Section 6 presents the conclusion.

II. Related Work
Generally, in data centers, one of the challenging issues is VOLUME XX, 2017 1 how to allocate energy resources in a most efficient way.
Note that the NP-hardness of the VM allocation problem has been already proved in the literature [5], [8]. Accordingly, it can be inferred that an optimal arrangement is not achievable in a deterministic polynomial time.
Garg [1] proposed an innovative penalty-guided hybrid approach, called the PSO-GA algorithm, which was introduced for the purpose of solving the constrained optimization problems. In PSO-GA, first, PSO is implemented to find the problem solution; after that, the best solution found in the current population executes the GA formulas.
An intelligent cloud workflow scheduling system was introduced by Jia et al. Dahsti et al. [12] proposed hieratical architecture to meet the needs of both providers and consumers in these technologies.
In that research, a novel service was also designed in the Xiong et al. [13] proposed an energy-efficient VM allocation Due to the quick growth of cloud computing systems, more and more data centers are required, which results in the surge of energy consumption in cloud data centers. Even more significant challenges have been posed on energy consumption due to the advent of cloud computing. Fu et al. [18] proposed the binary PSO (BPSO) algorithm with the aim of designing VMP strategies in a way to decrease the power consumption that was measured using an energy efficiency fitness function proposed in that study. It requires multiple iterations and updates for the VMP process.
Ebadifard et al. [19] proposed Rajasree and Beegom [20] proposed a discrete version of PSO, called Integer-PSO. It is applicable to task scheduling within cloud computing environments. It is also able to optimize both single-objective and multiple-objective functions. To find the optimum schedule in a reasonable time, it is necessary to take into account several factors, including energy, cost, execution time, profit, and other QoS parameters at the user side.
Garg and Sharma [21] proposed the multi-objective reliability redundancy allocation problem of a series system.
In this problem, providing a reliable system with saving no designing cost is taken into consideration as two different aims. Because of the non-stochastic, uncertain, and conflicting factors, it is not simple to decrease the system costs and, at the same time, to enhance the system's reliability. Such conditions make the decision-making process so difficult, and due to the existence of several objectives at one time, the fuzzy multi-objective optimization VOLUME XX, 2017 1 problem (FMOOP) comes to exist, which necessitates the Pareto optimal solutions instead of a single optimal solution.
In the study of Khosravi

III. Proposed System Model
This section proposes the formal models of the proposed system architecture, energy consumption, migration overhead energy, as well as the constraints on the problem formulation.
For the better understanding of the systems model and the proposed algorithm, the various parameters used in this paper along with a brief description are summarized in Table   2. Generating and distributing tasks among the existing VMs Q(i) The task queue of the ith VM

B. Energy Consumption Model
In physical machines, energy consumption depends on the processor and memory usage rates. In fact, a processor is the major energy consumption factor in these machines.
Accordingly, using the resources of a physical machine is where E represents the energy consumption of a physical machine within [t1, t2], and P(u(t)) shows the power consumption at t and is calculated using Equation (2): where indicates the amount of power consumed when

C. Problem definition
In the cloud computing architecture, during an operation, larger number of VMs. The total energy consumption of a datacenter can be obtained from Equation (3), as follows:

D. Migration Overhead Energy
The migration of VMs can result in a considerable energy overhead. A linear model was proposed in this paper to show the migration energy consumption, which depends on the copied memory capacity of the VM from a physical host in the source to a physical host in the destination. Equation (6) calculates the energy consumed during the migration process: Where α and β are constant parameters, and signifies the amount of memory that should be transferred during the VM migration.
In case of migration of virtual machines, we set the value of parameter β as one and otherwise zero. Also, considering the environment that may be homogeneous or heterogeneous, The α parameter is set to one for a heterogeneous environment and 0.8 for homogeneous environments.
The VM migration is performed through several steps.
First, the entire RAM content is transferred from a physical host in the source to a physical host in the destination. After that, the RAM pages, which are rewritten and changed by the host during migration, are sent. The number of these pages depends on the VM memory usage model and is measured by the page dirty rate (d). If every page size is assumed bytes with the previous interval assumed to be ti-1, the time spent calculating the memory transferred in the ith interval ( . ) can be calculated using Equation (7): where ti-1 can be obtained by Equation (8): where b shows the network bandwidth, and , −1 indicates the transferred memory within the (i-1)th interval.
The entire memory consists of the summation of pieces of memory transferred in each interval. The final step is called the termination-copy phase in which it is impossible to make the page dirty and to write in the memory so that the final pages could be copied. As a result, the total memory transferred for one VM can be obtained by Equation (9): Where n+1 denotes the number of steps required to transfer the memory of a VM from a physical machine in the source to another in the destination. In fact, the extra 1 indicates the final step in the termination-copy phase.

IV. Proposed Method
The NP-Hardness of the Energy-aware VM aggregation problem has been confirmed in the literature. Therefore, finding the best model for the aggregation of VMs is an optimization problem, where the total energy consumption and the migration overhead energy need to be minimized in VOLUME XX, 2017 a cloud datacenter. This section presents the details of the EALBPSO-DVFS algorithm proposed in this paper to schedule the dependent tasks with the aim of decreasing energy consumption and increasing load balancing.
Considering the efficiency and energy models presented in Section 3, the impacts of the proposed method with the expected objectives could be discussed. The proposed algorithm involves two phases each of which is analyzed in the following subsections.

Consumption Reduction
In the first phase, a method is proposed to minimize the total energy consumption and the migration energy

1) CALCULATING THE POSITION AND VELOCITY OF EACH PARTICLE
The position of a particle in iteration t is calculated as a vector calculated by Equation (10): Moreover, each particle has a velocity shown by a vector obtained from Equation (11) in iteration t: In each iteration, every particle has a memory of its best previous position, which is shown by vector L obtained by Equation (12): The best current position experienced by all particles of a swarm is shown by vector G in Equation (13): The position and velocity of each member are updated using Equations (14) and (15) .

3) POSITION OF EVERY PARTICLE
The position of every particle is defined through the distribution vector of N VMs on M physical machines. In fact, if the position of a particle is shown as (1, 2, 3,…, k), it means that the first, second, third, and Nth VMs should be assigned to the first, second, third, and kth physical machines, respectively.

4) OBJECTIVE FUNCTION OF EACH PARTICLE
Since every particle is defined as an array, each dimension of a particle shows a physical machine; thus, the objective function equals the total energy consumption of machines existing in each dimension of the particle. The energy consumption of every particle can be obtained using Equation (17):

5) CALCULATING VELOCITY VECTOR
The velocity vector was defined to result in a new position vector when the position vector of a particle is applied at each step. In fact, the velocity V of each particle is defined as a sequence of "movement" of the position components of that particle, which is calculated by where ||v|| signifies the sequence length. The algorithm for the allocation of VMs using our EALBPSO is illustrated in Algorithm 1. If the stop condition is met, terminate the iteration process of the algorithm, and output the approximate optimal solution and related information. If not, repeat Steps 4 to 7 until the stop condition is met.

B. Second Phase of the Proposed Method
In this subsection, the second phase of the proposed method is analyzed. The first phase output was used as the input of the second phase. In the first phase, the number of VMs was reduced to decrease the energy consumption. The second phase aimed to place VMs on the remaining physical machines in a way to reduce the energy consumption. In this phase, the PSO algorithm was used; however, the objective function was designed for load distribution.

1) OBJECTIVE FUNCTION
In the second phase, the objective function is based on load distribution as expressed in Equation (19): where:

V. Performance evaluation with simulation
This section analyzes the results of simulating the proposed method and introduces the simulation environment. A few parameters are also presented to evaluate the proposed method. Finally, the methods are compared in the defined scenarios.

A. Simulation Steps
The simulations executed in the present study are performed on CloudSim toolkit [28] (based on Java) that MT-34, and Intel core i3-540, respectively [1], all well provided with the DVFS technology. Table 3 describes the three processor types in detail. In the simulation scenario of the proposed method, a few VMs were first assigned randomly to each of the physical machines. Each VM, based on the service type, made a request for an amount of memory and a percentage of processor. The task generator unit was employed to analyze the arrangement of VMs and the placement algorithm performance. VMs were analyzed in performance through load generation. The task generator unit generated the tasks at a random rate and put them in the queue of each VM.
After that, VMs received the tasks from their input queues in order and processed them. Figure 3 shows a schematic view of the simulation method, and Table 4 presents the concepts used in this phase.

Definition Notation
The ith physical machine Host(i) The ith VM VM(i) The ith task T(i) The task queue of the ith VM Q(i) Generating and distributing tasks among the existing VMs

C. Simulation Scenarios
For the efficiency analysis, the results obtained by the  [10], and Dahsti et al.' [12] algorithms. Accordingly, the parameters presented in Section 4.2 are measured.

 First Scenario: Changing the Number of VMs
The first scenario compares the effects of the number of VMs on the proposed method and those of the other three algorithms noted above. Table 5 shows the parameters used in this scenario.   Kumar et al.'s [10] Dahsti et al.'s [12] in the proposed method as opposed to the other approaches.
However, the larger the number of VMs, the larger the number of physical machines on which there are VMs. This is the reason for the ascending trends in the methods.
Nevertheless, the proposed method saved more energy due to performing the placement process more appropriately.
It can be concluded that the proposed method, using the least amount of available resources, causes significant energy storage, and is suitable for reducing energy  Table 7 shows a comparison between the four methods in terms of the processor usage standard deviation.  This scenario makes a comparison between the performance of the proposed method and that of the other approaches based on the type of homogeneous or heterogeneous physical machines by analyzing the consequent effects on the simulation parameters. Table 8 shows the parameters used in this scenario.

• Third Scenario: Changing the Algorithm Iterations
In this scenario, the four methods are compared in terms of algorithm iterations and consequent effects on the simulation parameters. Table 11 shows the parameters used in this scenario.   Kumar et al [10] Dahsti et al [12] Table 12 shows a comparison of the four methods in terms of energy consumption. The larger the algorithm iterations, the higher the probability of finding the correct layout for VMs. As a result, a larger number of physical machines would be switched off, and energy consumption would decrease.

Vi. Conclusion and Future Work
The energy-aware scheduling algorithm on DVFSenabled datacenters was found capable of reducing energy consumption and, consequently, reducing the operational cost, carbon footprint, and CO2 emissions in highperformance distributed computing systems (HPDCSs) while increasing the system reliability and availability. In In future work, we plan to continue our study into the optimum allocation and selection of VMs with the aim of improving the energy efficiency of data centers with taking into account both I/O-and CPU-intensive workloads.