Energy-Aware VM Initial Placement Strategy Based on BPSO in Cloud Computing

In recent years, high energy consumption has gradually become a prominent problem in a data center. With the advent of cloud computing, computing and storage resources are bringing greater challenges to energy consumption. Virtual machine (VM) initial placement plays an important role in affecting the size of energy consumption. In this paper, we use binary particle swarm optimization (BPSO) algorithm to design a VM placement strategy for low energy consumption measured by proposed energy efficiency fitness, and this strategy needs multiple iterations and updates for VM placement. Finally, the strategy proposed in this paper is compared with other four strategies through simulation experiments.The results show that our strategy for VM placement has better performance in reducing energy consumption than the other four strategies, and it can use less active hosts than others.


Introduction
As a new commercial calculation model, cloud computing is the evolution of distributed computing, parallel computing, and grid computing.With the advent of the era of big data, data has become a strategic resource of information society, and cloud computing can be more economical, effective, and efficient for mining data value, which has a revolutionary impact on human economic and social development.However, problems of high energy consumption have been given more and more attentions by enterprises and experts when the scale of data centers is constantly expanding.The increasing scale of data center mainly causes two kinds of serious energy problems.On the one hand, increasing physical servers can bring about more energy consumption; on the other hand, if a server loads few virtual machines or has few demands for resources, it will result in low utilization of server's resources, which will cause a huge waste of electric power.At present, rapid development of virtualization technology provides a new solution for power consumption in a data center.In particular, when cloud computing becomes a main developing direction in the future, due to its own server consolidation, online migration, isolation, high availability, flexible deployment, low administrative overhead, and other advantages, there is more space for the development of virtualization.Cloud computing uses mature virtualization technology, which makes resources it uses required in the form of virtual machines and then allocates servers' part resources to them to perform corresponding tasks, so resource-scheduling process can be converted into the search process of virtual machines [1].Because data centers in cloud computing have begun to widely use virtualization technology, exploring a VM placement strategy for low energy consumption in a cloud data center provides a new research direction for improving energy efficiency in a data center.VM initial placement according to the optimal goal can be used to reduce energy consumption and reduce the number of active servers after the completion of cloud computing platform in a certain degree, and it has a positive effect on the operation and subsequent optimization for VM consolidation of the cloud computing platform.
In this paper, we use binary particle swarm optimization (BPSO) to implement VM initial placement with comprehensive consideration of CPU and disk, then we use model of energy efficiency fitness to adjust each particle's velocity and displacement within the scope of certain iterations, update each particle's VM placement according to consideration of the globally optimal displacement and locally optimal displacement, and finally we can get a best VM placement which has the minimum energy consumption.
The rest of this paper is organized as follows: Section 2 discusses related work of VM placement.Section 3 discusses proposed model of energy efficiency fitness.Section 4 discusses VM placement strategy based on BPSO.Section 5 contains details of our algorithm.Section 6 is experiments.At last, Section 7 is the summary of this paper.

Related Work
With the rapid development of cloud computing, data centers also expand, as well as the energy consumption caused by data centers, which results in high operation costs.Therefore, reducing energy consumption of data centers is a problem that needs to be solved urgently.The energy consumption in a data center has a close relationship with utilization of resources; thus we should improve the utilization of resources to reduce energy consumption in order to reduce operation cost of data centers.At present, the most effective method to achieve the goal is to use virtualization technology, which can make better use of server resources.
Improving utilization of resources by using virtualization technology is mainly divided into two types: initial placement [2,3] and dynamic VM consolidation [4,5].A lot of research on VM placement has been done by domestic and overseas scholars.Many studies have modeled VM placement as packing problems [6,7].The purpose of optimization of VM placement is to use the least amount of physical resources to meet demands of all virtual machines, which can improve efficiency and reduce energy consumption.Many works consider load condition or resource competition in terms of servers of CPU, memory, disk, network bandwidth, and so on.Because various factors should be considered to obtain the optimal solution of multiple dimensions, VM placement has been proved to be an NP-hard problem.The most basic method of VM placement is to use heuristic algorithms, such as best fit algorithm and first fit algorithm.Beloglazov and Buyya [8] have put forward MBFD (modified best fit decrease) algorithm which is used to consolidate virtual machines; the main idea of this literature is reallocating virtual machines which need to be migrated to servers to minimize the energy consumption.These simple methods fall into locally optimal solution because of less thought, resulting in extra waste of resources and increasing SLA violation, which has an effect on QoS as well.Therefore, we need to improve or replace heuristic algorithm.
Chen et al. [5] have described VM placement as a stochastic optimization problem.However, this approach is too simple, which only considers CPU and does not consider other resources.Li et al. [9] have proposed heuristic binary search algorithm, which places virtual machines in a few number of servers as far as possible to reduce energy consumption of the whole data center, and virtual machines of the same tenant are placed in the same server that can reduce the network consumption.The practicality of this algorithm is not good because only one resource type is considered.
Some scholars adopt intelligent algorithm to solve the problem of VM placement.Xu and Fortes [10] have used genetic algorithm to solve the problem of VM placement, but this method does not consider the overhead of VM migration, so it does not have good practicability.Li et al. [11] have proposed a strategy for VM placement that is based on multiobjective genetic algorithm; however the strategy cannot be applied to solve the problem of power consumption.In addition, it does not combine resource control and energy consumption.Farahnakian et al. [12] have used ant colony algorithm for VM consolidation, which can ensure the relatively better original performance and reduce energy consumption at the same time, but this algorithm is too complex, and the speed of its convergence is slow; therefore it is difficult to be implemented.
In recent years, particle swarm optimization (PSO) algorithm has drawn more and more attention from the researchers, because it is similar to genetic algorithm in terms of function, and it has many other advantages: quicker convergence, less parameters, easier operation.In addition, BPSO can be applied to solve the problem of VM placement.In this article, we present an energy-aware strategy for VM initial placement based on BPSO.We first design a multiresource model of energy efficiency fitness and then use BPSO to place virtual machines based on this model.After comparing BPSO with some heuristic algorithms and GA through experiments, we obtained the experimental results, which show that our proposed VM placement strategy not only effectively reduces energy consumption of servers, but also reduces the number of active physical machines as well as the proportion of SLA violation in a certain extent.

Energy Efficiency Fitness Model
3.1.Fitting Distance.Every cloud data center will hold the pool of servers, where there are a large number of physical machines.And each physical machine can load virtual machines of different numbers and different specifications; task requests from users and applications are sent by virtual machines.In a data center, utilization of resources such as CPU, disk, memory, bandwidth has an important implication to servers.Because user requests and the sizes of applications are different, their consumption of different types of resources varies, some requests need to consume more CPU resources, and some tasks need more disk utilization, while others consume more bandwidth.In this article, we consider two types of resources: CPU and disk.
Current CPU utilization in a server can be achieved by calculating the sum of CPU utilization in virtual machines running on the server.Similarly, utilization of disk in a server can be achieved by calculating the sum of used disk in virtual machines running on the server.The utilization of CPU and disk affects the energy consumption.Srikantaiah et al. [13] have studied the relationship between energy consumption and utilization of resources.In the literature, results of many Scientific Programming 3 experiment shows that, when CPU utilization rate of a server reaches 70% and disk utilization rate reaches 50% at the same time, servers can not only get the minimum value of energy consumption, but also ensure a good performance.Therefore, in this literature, 70% and 50% can be seen as the optimal point for CPU utilization rate and disk utilization rate, respectively, in a server.Two values in the optimal point here are different from that considered separately, so we need to combine two parameters together when solving the problem of VM placement.
Next, we set up a fitness model.We put forward fitness distance Fit  (k denotes k servers) to analyze the fitness of servers quantitatively; fitness distance can be gotten from Euclidean distance of resource utilization between current server and the optimal point.The function is shown as follows: where   is th resource utilization rate in server k,   represents optimal utilization of th resource, and n is the number of resource types; since CPU and disk are considered here, n is 2. Fit  is the fitness distance of server k, it is a quantitative representation of energy efficiency fitness.When a server is placed with a running VM, Fit  is the Euclidean distance of resource utilization from the optimal point in server k.When a server is an idle server, which means no VM is deployed on this server and its fitness distance is 0, then energy efficiency fitness of the whole data center is shown as follows: It represents the sum of Euclidean distance in each server.Because the model refers to optimal point [13] and this adaptive point has confirmed its high energy efficiency through many experiments, it is of great value to VM placement by using BPSO.And due to the availability of resource parameters, the model is of high practicability.

Problem Formulation.
Since the value of energy efficiency fitness in a whole data center is closely related to VM deployment in servers, to obtain the lowest value of energy efficiency fitness, a strategy for VM placement is proposed to make CPU utilization rate and disk utilization rate of each server with one or more virtual machines run closer to optimal point to a great extent; then we can achieve best energy efficiency in the whole data center.The following is problem formulation.
Suppose that a data center has  virtual machines that need to be deployed on M servers ( ∈ ,  ∈ , where K is the set of servers and I is the set of virtual machines), and virtual machines in each server need enough resources to keep a stable state.   denotes nth resource demand of VM i, and    denotes the capacity of resource n in server k.And resources of each server are limited; to guarantee resource utilization of each server in a proper range and ensure that the efficiency of each server is not too bad, we define a set of high and low threshold values of resource utilization:  hig  represents the maximum utilization of resource n in a server that hosted one or more virtual machines; on the contrary,  low  represents the minimum utilization.The two thresholds play a decisive role in VM placement.Once the value of resource utilization is no longer within these two thresholds, virtual machines need to be migrated.Then we define two binary variables:   represents the existence of VM  in server k, and 1 denotes that VM i is placed on server k;   decides server k is idle or not, and if the value is 0, that means server k is in the idle state and needs to be adjusted to obtain a state of low energy consumption.The goal of this article is to obtain the minimum energy efficiency fitness; the formula is as follows: and constraints are as follows: where   is the optimal point mentioned in the previous section.

Energy-Aware VM Initial Placement Strategy Based on BPSO
4.1.Introduction to BPSO.PSO is an intelligent optimization algorithm which was proposed originally by Eberhart and Kennedy according to the laws of some animals' foodsearching [14,15].Subsequently, Zhang et al. improved this algorithm, added a dynamic weight to prevent too fast convergence which could lead to locally optimal solution, and then added the exploration of the PSO algorithm [16].
Compared to ant colony algorithm [12,17,18], genetic algorithm [7,19,20], and many other intelligent algorithm, PSO algorithm has fewer parameters, faster convergence, simpler code, easier operation, and so on, so it is of high practicability.
Standard PSO algorithm is only suitable for solving problems of continuous space; however, the problem of VM placement is a discrete optimization problem, so this algorithm cannot be directly applied to it.Improvement of PSO algorithm is necessary, and this improvement can be applied to solve optimization problems in the discrete space.
Then Kennedy and Eberhart designed corresponding binary version of PSO (BPSO) in 1997 [21], which is used to solve optimization problems in discrete space.
BPSO is similar to the original PSO; the difference is that its particles are composed of binary code.Each particle represents two variables: velocity and displacement.Each particle also stores the two values after each round of iteration: its own locally optimal location (  ) and globally optimal location of the whole particle swarm ().The two values are used to provide the basis of changes for the particle's velocity; the formula is as follows: ( is a dynamic weight, which is used to adjust the speed of convergence.And  1 and  2 represent learning factors, which can be called acceleration constants as well, both of which are usually set to 2;   () is a random number, its value is in the range of [0, 1].  and   are, respectively, locally optimal and globally optimal locations of server d in particle .In order to guarantee the probability that the value of each bit in displacement is only 1 or 0, the sigmoid function is adopted: Particles change their value by

VM Initial Placement Based on BPSO.
Since BPSO is suitable to solve discrete optimization problems and has advantages over other algorithms, we use it to solve the problem of VM initial placement.In order to better use BPSO, we need to describe the structure of parameters and operation instructions, which can make the strategy of VM initial placement clearer.BPSO has not been used to solve the problem of the energy consumption in cloud data centers by now, so an improved BPSO algorithm is proposed in this article to deal with the problem of high energy consumption, which is a totally new idea.

Parameters Used by BPSO
A Particle Displacement.We define a particle swarm that has L particles;    is the displacement of particle w (1 ≤  ≤ ), and  is the number of iterations.   is a -bit vector: Each bit corresponds to the status value of representative server; if one has a value of 1, it means corresponding server is in working status, and there is at least one VM in it; if the value is zero, the corresponding server does not have VMs and is in a state of low energy consumption.B Particle Velocity.It is the same as particle displacement;    is the velocity of particle .It is also a -bit vector: It decides whether the corresponding server of each bit needs to migrate VM or not.The initial state of each bit is 0.
C Locally Optimal Displacement and Globally Optimal Displacement.We use   to define locally optimal displacement of particle , which can get the best energy efficiency in particle  after iterations, and globally optimal displacement (), which represents the best displacement of all particles that can lead to the best energy efficiency fitness so far.These two parameters play a critical role in changes of particle velocity; in other words, they determine the next step of VM deployment in particles through their locally and globally optimal displacement.D Inertia Weight.In particle swarm, if there is no inertia weight, the speed of convergence in BPSO will be greatly reduced, so inertia weight in BPSO plays a key role in searching results.However, too fast convergence will easily lead to locally optimal solution rather than globally optimal solution.And in different conditions, appropriate adjustment of inertia weight is extremely important.The start of BPSO carries out a global search ability, where a large inertia weight is needed to quickly find all solutions whose energy efficiency fitness is better than others.After the global search, BPSO should decrease the value of inertia weight and converts from global search to local search, which can get globally optimal solution in these good solutions, so dynamic inertia weight is necessary to improve the search ability of BPSO algorithm.The change rule of inertia weight is shown in min is the lowest limit of inertia weight,  is the number of iterations, num is the total number of iterations, p is weight coefficient of changes, and r is the upper limit of weight adjustment.Overall, inertia weight gradually decreases by the increasing number of iterations, and, if needed, we can control the degree of urgency.
E Addition Operation and Subtraction Operation.Since original formula of BPSO algorithm is a one-dimension formula, we need to define some mathematical operations.Addition operation is used to add those variables in the same dimension; similarly, subtraction operation is the subtraction of variables in corresponding dimension.For example, (1, 0, 2, 1) + (2, 1, 0, 0) = (3, 1, 2, 1).F Function Mapping.Particle displacement needs a corresponding change according to particle velocity.Original BPSO is unlikely to converge to globally optimal particle, because if it converges to globally optimal particle, its velocity is zero, which will increase the possibility of changes in the corresponding bit; then the search will have more randomness and lack of direction.And original mapping does not conform to the problem of VM placement, because if particle velocity can lead to VM migration, it does not necessarily result in changes of particle displacement.For example, server A hosts VM{1, 2, 3}, and server B hosts VM{4}; then the value of the status in server A and B is (1, 1).If VM3 is migrated from server A to B, then server A hosts VM{1, 2} when server B hosts VM{3, 4}; the status still keeps unchanged.We have to improve the sigmoid function.
G Multiplication Operation.Multiplication operation updates particle displacement and denotes multiplication operation, and the formula is Both    ( + 1) and   () can only be assigned two values: 0 and 1.When the value of    ( + 1) is 1, we do not need to change the displacement of corresponding bit.On the contrary, if the value is 0, we need to observe the value of corresponding bit, namely,   (); if the value is 1, we need VM migrations; otherwise, the server can be used as a destination server, and virtual machines can be migrated to this server.

Updating VM Deployment.
Based on the above, we can calculate particle velocity of each generation and determine the adjustment of particle displacement.When the transition of particle displacement takes 1, it means that there is no change in corresponding bit of particle displacement; on the contrary, if some bit of the transition is zero, corresponding bit of particle displacement needs to be adjusted, according to VM reallocation.
In this article, we use an updating strategy based on FFD (first fit decreasing), which can update VM displacement.
In order to get a better updating strategy, we need to adjust the server whose value of displacement is 0, and we get a new collection about the adjusted server, which has a two-dimension parameter.
We need to normalize these two parameters.We list all of virtual machines in  and form the collection VM  {VM 1 , . . ., VM  }.And each VM in VM  has a normalized performance; its formula is CPU max  is the maximum CPU in VM  , and CPU min  is the minimum.Similarly, DISK max  is the maximum disk of VMs in VM  , and DISK min  is the minimum.According to this formula, we can receive a collection of normalized performance VM  , then sort the element decreasingly, and, finally, leverage the normalized performance to reallocate VMs in VM  based on BFD; then we will get new VM placement in VM  .However, to prevent local optimum, we just use new VM placement in a certain probability.
We calculate two values of energy efficiency fitness according to formula (3), two values (Fit  and Fit ) denote the fitness of original VM placement and new VM placement in VM  , respectively.The probability of using new VM placement in VM  is as follows:

Algorithm
(1) []: it represents the total number of the particle swarms.
(2) : it represents the number of iterations in BPSO.
(3) V: it is a list of servers and stores the information of each server, such as id, CPU and disk, the velocity and displacement, the transitions value, and the collection of virtual machines.(4) : it stores all information of virtual machines, such as the label and demands for CPU and disk.
(5) []: it deposits optimal placement of each particle that obtains minimum energy efficiency fitness.( 6) V[]: it is the minimum energy efficiency fitness of current particle during the current iteration.( 7) : it is the optimal placement of the particle swarm that obtains minimum energy efficiency fitness.
end if (12)   =server.getTransition();(13) if (  < 0 and   () ≤   ) then   = 0 (14) else if (  > 0 and   () ≤   ) then   = 1 (15) end if (16) if (  = 0) then (17) RedeployServerList.add(server);(18) end if (19) end for (20)  At the start of experiments, VMs are assigned resources of different orders of magnitude according to the demands.In order to ensure that servers have enough resources to hold virtual machines, we decide that the numbers of servers and VMs are the same in each experiment.
The following is the analysis of experimental results.
A Energy Efficiency Fitness.First, we compare our proposed strategy to other four algorithms based on energy efficiency fitness.Figure 1 shows the energy efficiency fitness of five methods under the conditions that different numbers of servers and virtual machines are deployed.In this experiment, the population of BPSO is 50, and the number of iterations is 100.In order to eliminate the interference of other factors in the experiment, upper and lower thresholds are consistent.
The result from Figure 1 concludes that the proposed strategy based on BPSO can get the smallest energy efficiency fitness in all scales of servers and VMs, and compared to the other four algorithms, its control of energy efficiency fitness is very obvious, mainly because BPSO has an adjustment of globally optimal solution and locally optimal solution in each iteration, which can ensure less energy consumption.While three heuristic algorithms are simple greedy algorithms, which lack such adjustment, they can easily lead to larger energy efficiency fitness and more energy consumption; GA can get lower values as well than the other three heuristic algorithms; however, there is a high probability that the results it get may be a locally optimal solution, so its values of best fitness are higher than that gotten by our proposed algorithm.B Number of Active Servers.In addition to energy consumption, the number of active servers is also an important performance metric.We keep the parameters the same as what was set in the previous experiments and then compare numbers of active servers after initial VM placement based on five algorithms, respectively.Figure 2 is the result of experiments.BPSO used in experiments has 100 populations and 100 iterations.And other parameters are consistent.Evidently compared to the other four algorithms, our proposed strategy based on BPSO can produce relatively fewer active servers, because our proposed strategy reallocates VM placement of abnormal servers by using BFD during iterations, which also ensures that the number of active servers cannot be too large; this also shows that proposed strategy can take advantages of other algorithms to improve superiority by itself; this also shows that proposed strategy outperforms the other algorithms.
C Parameter Setting.According to BPSO algorithm introduced in this paper, some parameters need to be assigned suitable values.Next, we test the influence of BPSO caused by these parameters.
(A) High and Low Threshold of CPU and Disk.High and low threshold of CPU and disk may affect the status of VM placement; then we change them to observe changes of servers' energy efficiency fitness in this experiment, where the iterations are 200 and the number of VMs is 200. Figure 3 is the result of changes.We conclude from the figure that changes of energy efficiency fitness caused by two thresholds are not very evident; however there is a trend that when the high threshold is 0.85 and the low threshold is 0.1, we get the smallest value.And when the low threshold of CPU and disk is 0.1, values of energy efficiency fitness are smaller than those in other conditions.experimental results, 0.85 and 0.1 are set as the high and low thresholds of CPU and disk, respectively, and the number of generated virtual machines is 200, and the number of population is 50.Figure 4 shows that with the increase of iterations, the value of energy efficiency fitness is becoming more stable, and when the number of iterations is more than 200, the energy efficiency fitness is almost consistent.
The trend of changes of the fitness will not be affected when the number of VMs is changed.Figures 5 and 6 are the trends of energy efficiency fitness when a data center has 50 and 100 VMs, respectively.
Of course, changing the size of populations will not affect the trend of changes of fitness either.Figures 7 and 8    are the trends of energy efficiency fitness when the size of populations is 30 and 100, respectively.With the increase of populations, the range of energy efficiency fitness is getting smaller.
(C) The Number of Populations.The number of populations is also an important parameter that influences energy consumption.If the size of populations is too small, it will affect the performance of BPSO, the convergence, and the value of energy efficiency fitness.Figure 9 is the result of  energy efficiency fitness brought by different numbers of populations.The figure shows that energy efficiency fitness is in balance when the number of populations is more than 100.
To sum up, our proposed strategy based on BPSO is not only better than the other three heuristic algorithms (FF, FFD, BFD) and GA in terms of energy consumption gotten through value of energy efficiency fitness, but also better in other performances such as the number of active servers.In addition, this article finds through experiments that parameters in BPSO can affect the size of energy consumption, so we can adjust the various parameters to achieve optimal status of our proposed strategy.

Conclusion
With the rapid development of cloud computing, the demands of data centers are increasing.Larger scale of the cloud data center brings about enormous energy consumption, which cannot be ignored.Therefore, solving or alleviating energy problem becomes the urgency.VM initial placement is an important part of solution to reduce energy consumption.In this paper, we design energy-aware VM initial placement based on BPSO, which can obtain optimal VM placement that has a minimum energy consumption according to the adjustment of locally optimal placement and globally optimal placement.Through simulations and results, we can prove good performance of our proposed strategy based on BPSO.In addition, the influences of the performance caused by relevant parameters in BPSO are also discussed.In future work, we need to consider the best collocation of different parameters in detail and do further research about details of our proposed strategy based on BPSO.

Figure
Figure Number of active servers.
(B) Iterations.Next we do a research on energy consumption influenced by iterations.According to the previous

Figure 3 :
Figure 3: High and low threshold of CPU and disk.