Energy-Saving Virtual Machine Placement Method for User Experience in Cloud Environment

Green computing focuses on the energy consumption to minimize costs and adverse environmental impacts in data centers. Improving the utilization of host computers is one of the main green cloud computing strategies to reduce energy consumption, but the high utilization of the host CPU can affect user experience, reduce the quality of service, and even lead to service-level agreement (SLA) violations. In addition, the ant colony algorithm performs well in finding suitable computing resources in unknown networks. In this paper, an energy-saving virtual machine placement method (UE-ACO) is proposed based on the improved ant colony algorithm to reduce the energy consumption and satisfy users’ experience, which achieves the balance between energy consumption and user experience in data centers. We improve the pheromone and heuristic factors of the traditional ant colony algorithm, which can guarantee that the improved algorithm can jump out of the local optimum and enter the global optimal, avoiding the premature maturity of the algorithm. Experimental results show that compared to the traditional ant colony algorithm, min-min algorithm, and round-robin algorithm, the proposed algorithmUE-ACO can save up to 20%, 24%, and 30% of energy consumption while satisfying user experience.


Introduction
Cloud computing [1] is a further extension of distributed computing, parallel computing, and grid computing. It provides a variety of hardware services, infrastructure services, platform services, software services, and storage services through the Internet to achieve cloud computing. Cloud computing users can use it on demand, pay for it on demand, and have good scalability.
With the development of cloud services, data centers become extremely large and need to consume a lot of energy. In [2], the authors pointed out that according to the statistics of the U.S. Department of Energy, the annual power consumption of data centers has accounted for 1.5% of the annual power generation in the United States. It is estimated that the annual power consumption of China's data centers is roughly the same as that of the United States and has reached the annual power generation of the ree Gorges. Energy consumption has become the most challenging problem in the current data center, so how to reduce energy consumption is an urgent problem to be solved in cloud computing research.
Virtual machine consolidation is one of the common strategies to reduce energy consumption. e virtual machine consolidation includes host overload/underload detection, virtual machine selection, virtual machine placement [3][4][5], and virtual machine migration [6,7]. Virtual machine migration can take a certain amount of time, consume a lot of resources, and affect the operation of other virtual machines on the server, resulting in system performance degradation. In addition, additional network storage system and high-speed communication network are needed to realize virtual machine migration. If there are a large number of virtual machine migrations in the cloud computing system, it will lead to failure to meet the servicelevel agreement. erefore, the most direct way to reduce energy consumption in data centers is to optimize the initial placement of virtual machines, and in the placement process, in order to prevent excessively minimizing energy consumption and affecting the user experience, this article introduces user experience indicators as a constraint on the placement of energy-saving virtual machines [8].
Because the ant colony algorithm has a good positive feedback mechanism and a distributed search method, it is very good to find suitable computing resources in unknown networks. is paper proposes a method for placing energysaving virtual machines based on user experience. By modifying the pheromone and heuristic factor update methods and defining the parameter regulatory factor (RF), the improved roulette probability selection mechanism guides the ant to search, avoiding the algorithm to enter the local optimal due to premature convergence, and then finds the optimal solution for virtual machine placement, effectively reduces energy consumption, and achieves a balance between energy consumption and user experience.
On the basis of the above discussion, this paper optimizes the energy problem of dynamic virtual machine placement in the data center on the basis of satisfying the user experience. e contributions of our work to existing literature can be summarized as follows: (1) Considering the constraints of user experience while optimizing energy consumption, the energy-saving virtual machine placement system model of the cloud data center is established. (2) In order to adapt to the dynamic characteristics of cloud computing resources and meet user experience, solve cloud computing resource scheduling problems, and reduce data center power consumption, we propose a user experience-oriented energysaving virtual machine placement method (UE-ACO). (3) e advantage of this algorithm is that it has a positive feedback mechanism, fast convergence speed, and can effectively solve the problem that the traditional ant colony algorithm easily falls into a local optimum. e algorithm does a good job of finding suitable computing resources in unknown networks.

Related Works
Virtual machine placement is a way to dynamically map virtual machines to physical machines to optimize resource utilization. e virtual machine is placed reasonably to achieve energy-saving purposes by using different scheduling algorithms.
One kind of algorithm for the virtual machine placement problem is the heuristic algorithm. Yadav et al. [9] proposed three adaptive models regarding high energy consumption and service-level agreement violations. While minimizing energy consumption, the SLA violations when selecting virtual machines from overloaded hosts were considered. e method can reduce energy consumption. At the same time, cloud data center performance can be guaranteed. Zhang et al. [10] studied reducing the energy consumption of mobile cloud data centers during periods of insufficient and overloaded virtual machines. ey proposed an adaptive heuristic energy-aware algorithm that detects the history of CPU utilization for virtual machine selection and dynamic merging, which minimizes total energy consumption and improves service quality. In [11], when solving the problems of cloud data center energy consumption and SLA violations, compared with most of the current works, they considered two additional important factors: (1) analyzing the robustness of the upper threshold of CPU usage. (2) Based on the CPU utilization prediction, when selecting the virtual machine of the overloaded host, the performance degradation time and SLA violations are reduced. A heuristic algorithm is proposed to detect the least squares regression of the overloaded host and select the virtual machine from the overloaded host minimum utilization prediction to reduce energy consumption with minimal SLA cost. In [12], for the problem of virtual machine integration, an energy-aware dynamic virtual machine selection algorithm was proposed to merge virtual machines from overloaded or underloaded to minimize energy consumption and maximize service quality.
Another kind of algorithm used to solve the VM placement problem is the metaheuristic algorithm (such as ant colony algorithm and particle swarm optimization), which are considered as good candidates for finding the approximate optimal solution. Gao et al. [13] proposed an energy-saving ant colony algorithm for network-aware virtual machine placement. is algorithm comprehensively considers CPU, memory, and bandwidth resources. Under these three constraints, the maximum cost reduces energy costs. Liu et al. [14] combined the order exchange and migration local search technology and proposed a virtual machine placement based on the ant colony algorithm. Experiments have proved that it works well in both homogeneous and heterogeneous cloud environments. On the premise of not wasting power and maintaining resource utilization, J et al. [15] proposed a direct guide ant colony system to achieve maximum resource utilization and minimum energy consumption. e algorithm also obtained better results. Saini [16] proposed a multiobjective ant colony system algorithm for virtual machine placement. e algorithm obtained a set of Pareto sets to minimize the total waste of resources and energy consumption. Zhang et al. [17] proposed a virtual machine layout optimization model based on an optimized ant colony algorithm based on virtual machine utilization parameters, multiobjective optimization strategies, and feature metrics, which solved redundant power consumption due to waste of idle resources of the physical machine problem.
In the study of green computing and virtual machine placement, we discussed the above methods and achieved good results. In the heuristic algorithm part, virtual machine placement takes into account the degradation of system performance during the virtual machine activity, so the user experience is considered while reducing energy consumption. In the metaheuristic algorithm, most choose to maximize resource utilization and minimize energy consumption, so they ignore system performance and user experience. erefore, the virtual machine placement algorithm proposed in this paper combines the user experience as a constraint with the ant colony algorithm. Under the premise of ensuring the user experience, the swarm intelligence algorithm is used to solve the virtual machine placement problem, thereby reducing energy consumption.

System Model
e system consists of a host management module, a user experience module, and a virtual machine scheduling module.
e energy-saving virtual machine placement model is shown in Figure 1. e virtual machine demand flow enters the waiting queue. It is coordinated by the relevant module and is finally placed in the cloud computing data center. e host management module monitors the working status of each machine in real time, gives instructions for optimizing power consumption, and passes the load status of the machine and the virtual machine queue status to the user experience module. e user experience module receives the parameter values passed by the host management module and the waiting queue and calculates the user experience score. e virtual machine scheduling module accepts the information of the user experience module and waiting queue and allocates the virtual machine to a reasonably available host.

Host Management Module.
Host management module manages the hosts of the cloud data center in an energysaving way. e module monitors each machine for good operation to ensure the user experience and issues instructions for optimizing power consumption for machines with excessive CPU utilization. According to Pang et al. [18], the running state of each host is defined as follows: where RunVM(j) represents the number of virtual machines carried by the current host and MaxVM(j) represents the maximum number of virtual machines that the current host can host.

User Experience Module.
Cloud computing user experience is the overall effect of users using cloud computing services, which determines users' satisfaction with cloud computing services [19]. In this paper, a user experience model with feedback is proposed combining the users and cloud services. User experience is described in terms of user needs, user perception, cloud service provision, and cloud service implementation. ere are various evaluation methods of user experience. According to [20][21][22], guided by some references of the objective evaluation method, this paper analyses the parameters affecting user experience in cloud computing services and then defines the user experience model. ere are four parameters in the model (availability, SLA violation ratio, run time, and price). e user experience model and its parameters are defined as follows: Score Avail, OTF, T total , P price , (2) where T run represents the total time available for the service and T break (i) denotes the total time of service interruption.
where t 0 (u t ) represents the total time of the overload.
where T wait represents the waiting time of the virtual machine in the queue; P price represents the cost of this cloud service. e user experience score is defined as follows: where α 1 , α 2 , α 3 , α 4 are the regression coefficients. is paper obtains a large number of data such as task execution time, CPU utilization, task waiting time, host overload execution time, memory capacity, and network bandwidth by the statistical method and calculates the regression coefficient. Combining users, cloud services, and the perspectives of front and rear services, the relationship between the four perspectives of cloud computing user experience can be obtained, which is as shown in Figure 2.
e user requirements are the requirements before the user uses the cloud service, and the user perception is the perception after the user uses the cloud service. e cloud service provision is an ideal execution capability, and the cloud service implementation is the actual execution capability.

Virtual Machine Scheduling Module.
e virtual machine scheduling module accepts virtual machine queue information and places the virtual machine on an available host. is paper applies the improved ant colony algorithm to the module. e goal is to effectively reduce the energy consumption of the data center based on the user experience.
e specific method will be explained in Section 5.

Problem Formulation
where X ij is VM i running on the PM j .

Energy Model.
Relevant studies had shown that the power consumption of servers can be accurately described by the linear relationship between power consumption and CPU utilization. e analysis of this linear relationship on Dell servers confirmed this point. In order to save energy, the server was shut down when it was idle [23]. According to Malekloo et al. [24], the power consumption of the host is defined as a function of CPU utilization as follows: where P idle j and P busy j are the average power values when the host is idle and fully utilized and U p j represents the resource utilization of the host j at current power. In our simulation experiments, this value was fixed at 162 and 215 watts. e total power of the host is defined as follows: where R is a set of CPU resources required by each virtual machine. e variable Y i represents the on/off state of the host (1 means open; 0 means closed) and X ij is whether to assign a virtual machine to the host.

Resource Allocation.
e ant colony algorithm is a heuristic algorithm with distinct advantages and disadvantages.

e Positive Feedback Mechanism.
e search process will converge and eventually reach the optimal solution.

Distributed Computing.
e search process adopts the distributed computing mode, and many units carry out parallel computing at the same time, which greatly improves the computational ability and efficiency of the algorithm.

Easy to Combine.
It is easy to combine with other optimization algorithms.

Inherent Defect.
e disadvantage is that it is easy to fall into the local optimum, and it is difficult to jump from local optimum to global optimal. e ant colony algorithm does a good job of finding the right computing resources in an unknown network topology [25].

Initialization.
During the initialization phase, the ants are randomly placed on the host, and the pheromone strength is initialized: where Mips j represents the computing power of the current host PM j and N is a constant.

Probability Selection Mechanism.
Each ant selects the host based on the pheromone and heuristic factors. In the iterative process, P k j (probability selection mechanism) depends on host information (user experience score and energy consumption information), path pheromone concentration changing, and adjustment factor. Individual ants represent the allocation scheme of the virtual machine. At time t, the probability that the ant k selects the next host for the virtual machine is defined as follows: where α and β are the weighting factors; it represents the importance of pheromones and heuristic factors. τ j (t) is the pheromone concentration on the host PM j at time t. η j is a heuristic factor, η j � f(t); f(t) represents the profit function of the physical machine while it is running the virtual machine: where λ 1 and λ 2 are model-specific coefficients. e heuristic factor of the original ant colony reflects the relative importance of the amount of information accumulated by the ant during the movement process in guiding the ant colony search process. e larger the value, the greater the possibility that the ant chooses to walk through the path before, and the randomness of the search is reduced. erefore, it is easy to fall into local optimum. Based on the shortcomings of the original ant colony heuristic factor, setting the parameter RF can effectively solve the problem.
RF is an adjustment factor. It is related to the CPU utilization of the current host and the initial CPU utilization threshold. e value of RF directly affects the subsequent placement of the virtual machine. Set the CPU utilization threshold during the initialization phase (by data analysis, this article sets it to 75%).
If the CPU utilization of the current host PM j is higher than the set threshold, the state transition probability of the host PM j is reduced by adjusting the factor RF 1 , and the probability of the system placing the virtual machine on the host PM j is reduced. At the same time, if the current allocation scheme is not globally optimal, then the adjusting factor RF can also increase the probability of the ant jumping out of local optimal and increase the randomness of the search. To a certain extent, it alleviates the inherent problem of the original ant colony algorithm that is easy to fall into local optimum.
If the current host PM j 's CPU utilization is below the set threshold, the host can continue to place the virtual machine and update it by adjusting the factor RF 2 . e adjustment factor RF is defined as follows: where U j is the CPU utilization of the current host PM j and U 0 is the CPU utilization threshold preset by the user experience module.

Pheromone
Update. e pheromone update based on ants that propose executable virtual machine placement is where τ j (t + 1) represents the pheromone content of the host PM j at the next moment. ρ represents the pheromone volatilization coefficient: 0 < ρ < 1. Δτ j represents the increment of the pheromone: where max[f(t) k,r ] represents the maximum profit of the ant k in the iteration r. If ant k completes the search, indicating that the ant has found an executable allocation plan, then the pheromone concentration of the host in the allocation scheme is updated. If all ants have completed the search, find the best solution among all feasible allocations and update the pheromone concentration of the host in the best scenario.

Algorithm Flow
Step 1: the host management module gets the real-time running status of the machine in the cloud data center and then performs state control on each host.
Step 2: transfer the running status of the host and the virtual machine queue state to the user experience module, and get the available host resources according to the preset CPU utilization threshold.
Step 3: initialize pheromone for available host resources in the virtual machine scheduling module.
Step 4: place all the ants randomly on the available hosts.
Step 5: the ant k calculates the probability selection mechanism based on the pheromone concentration, the heuristic factor, and the adjustment factor and selects the next host.
Step 6: update local pheromone when ant k completes the search; if not, return to Step 5.

Mathematical Problems in Engineering
Step 7: update global pheromone when all ants complete the search; if not, return to Step 4.
Step 8: when the number of initialization iterations is reached, the system outputs the optimal allocation scheme; if not, it returns to Step 4.
Step 9: determine if there are still virtual machine requirements in the waiting queue that are not allocated. If yes, return to the first step; if not, end this virtual machine allocation.
e energy-saving ant colony algorithm is executed periodically, and Figure 3 depicts the main flow of the algorithm.

Experiment and Analysis
Due to the constraints, it is very difficult to perform iterative experiments on a real data center, so we use simulation methods to evaluate the user experience and energy consumption of the proposed strategy. erefore, we can carry out a large number of experiments with statistical significance. Specifically, by implementing the proposed algorithm on a PC with Core i7, 3.  Table 1 describes the host, virtual machine, and task information in the simulation environment. Table 2 sets the parameters of the UE-ACO algorithm in this paper. Figure 4 shows the difference in total execution time for the four algorithms, BACO, RR, Min-Min, and UE-ACO. Task completion time is the total completion time of a batch of submitted tasks, including task waiting time and task execution time. e RR algorithm takes the longest time to complete tasks, and the UE-ACO algorithm is the shortest. BACO algorithm is a basic traditional ant colony algorithm, the heuristic factors do not change with the dynamic allocation of virtual machines, ants will choose to move directly to resource-rich hosts, and its effect will deteriorate with the increase of the number of tasks. RR algorithm is a selfcontained polling algorithm in CloudSim. e RR algorithm involved in this paper uses the minimum virtual machine to run on the largest idle host. is algorithm takes into account the changes of resources, but it ignores the high increase of energy consumption. Figure 5 shows a comparison of the average waiting time using four algorithms. Task waiting time is an important indicator of user experience, which directly affects the score of user experience and then affects the execution process of the algorithm. e results show that the energy-saving virtual machine placement method oriented to user experience can better meet user needs. Figure 6 shows a comparison of energy consumption using four algorithms. e energy consumption of the cloud   computing data center increases with the number of tasks. Compared with RR, BACO, and Min-Min, the proposed UE-ACO algorithm can significantly reduce the energy consumption of the system. RR, BACO, and Min-Min algorithms only consider the completion time of tasks while ignoring energy consumption. UE-ACO algorithm guides pheromone and heuristic factor updates by the user experience score and system energy consumption, so it can effectively reduce energy consumption on the basis of meeting task completion time. Figure 7 shows the change of profit function of the proposed algorithm when setting different CPU utilization thresholds. With the increase of threshold, user experience scores are good, and energy consumption has a greater impact on the profit function. e profit function reaches its maximum when the threshold is set to 75%. When the threshold value exceeds 75%, it can continue to reduce energy consumption to a certain extent, but the execution state of the host PM j is significantly worse, and the user experience score has a greater impact on the profit function, so the value of the profit function decreases as a whole.

Conclusion
In order to solve the problems of user experience and energy consumption in the data center, the key indicators affecting user experience are analyzed, the user experience is modeled mathematically, the system model of virtual machine allocation in the cloud data center is described, and a comprehensive management strategy is formed. A user experience-oriented placement method of the energy-saving virtual machine is proposed. By modifying the pheromone updating method and heuristic factor in the ant colony algorithm and setting CPU utilization threshold, the energy consumption of the cloud computing data center is effectively reduced on the basis of guaranteeing user experience and improved the inherent defect that the traditional ant colony algorithm is easy to fall into local optimum. In the future work, we plan to establish a more perfect virtual machine placement system model. In addition, more details of user experience models can be described or a new model can be constructed. is kind of model is very necessary in the scheduling problem of virtual machines in cloud data centers. Finally, memory and network bandwidth are added to the energy model to calculate energy consumption more accurately.
Data Availability e cloud resource allocation data used to support the findings of this study have not been made available because of secrecy.

Conflicts of Interest
Regarding the publication of this article, the authors declare that they have no conflicts of interest.    Mathematical Problems in Engineering