An Energy Efficient Particle Swarm Optimization based VM Allocation for Cloud Data Centre: EEVMPSO

Cloud computing has witnessed exponential growth in recent years, resulting in a significant surge in energy consumption and operational costs of cloud data centres. Efficiently allocating Virtual Machines (VMs) within these data centres is crucial to achieve energy efficiency and optimize resource utilization. System instability may result from repeated requests for computing resources. One of the most critical difficulties facing virtualization technology is finding the best way to stack virtual machines on top of physical devices in cloud data centers. The host must move virtual machines from overloaded to underloaded hosts as part of load balancing, which has an impact on energy consumption. We propose energy-efficient particle swarm optimization algorithm (EEVMPSO) for Virtual Machine allocation is designed to maximize the load balancing. System resources, including CPU, storage, and memory, are optimized using EEVMPSO. The energy-aware virtual machine migration using the Particle Swarm Optimization Algorithm for dynamic VMs placement and energy-efficient cloud data centers. We conducted extensive experiments and simulations to evaluate the performance of the proposed algorithm in comparison to existing VM allocation methods. The results demonstrate the superiority of our approach in achieving energy efficiency and resource optimization. The experimental result shown in the proposed method, consumption energy in comparison to the PAPSO, KHA, EALBPSO, and RACC-MDT algorithm by 10.86%, 18.22%, 25.8%, and 31.34%, respectively, demonstrated the improvements in the service level agreements violation 5.77%, 15.3%, 26.19%, and 30.4%, as well as the average CPU utilization 2.2%, 24%, 22.6%, and 14.6%.


Introduction
The increasing demand for cloud computing services has led to the rapid expansion of cloud data centres worldwide. While cloud computing offers unparalleled scalability and flexibility, it also presents significant challenges, particularly in terms of energy consumption and resource utilization. Cloud data centres are known for their substantial energy requirements, leading to rising operational costs and a significant environmental impact [1][2]. Cloud computing is more popular as its widespread acceptance has increased. The implications of cloud computing for everyday life are imminent (e.g., social networks, sensor networks, etc.). More and more people are turning to the cloud model due to the popularity of smart gadgets. Rapid expansion in the number and scale of cloud data centres is occurring [3][4][5]. Recently, high performance in cloud infrastructure has been a primary issue and accomplished without putting a primary emphasis on the amount of energy used in cloud environments [6][7][8].
On the other hand, the cloud environment requires the data center to host the cloud applications [9].
Optimizing the allocation of Virtual Machines (VMs) within cloud data centres is a critical aspect of achieving energy efficiency and enhancing overall resource utilization. Efficient VM allocation not only reduces energy consumption but also improves the overall performance and costeffectiveness of cloud services [10][11][12]. The best way to deploy virtual machines (VMs) on bare metal servers in a cloud data center is an important pressing concern in cloud computing. Minimizing power usage and resource wastage may be achieved by strategically deploying virtual machines on real devices [13][14]. Therefore, appropriate optimization techniques are used for virtual machine placement in a critical and pivotal step toward the so-called goal. Placement algorithms for virtual machines employ optimization techniques to partition actual hardware fairly. Resulted, fewer physical computers are required to do the same amount of work in the cloud data center, less waste is produced, and the use of computing resources is increased. Recently, many techniques for locating and deploying virtual machines have been suggested [15][16][17].
This article proposes a new algorithm for efficiently allocating computational resources by determining where to place virtual machines on physical machines. In the first step, the proposed algorithm seeks to lessen the load on cloud data centers' infrastructure by decreasing the number of online computers. The optimal placement of virtual machines on physical machines in cloud data centers is the second goal of the proposed scheme. The third goal is to reduce the service level agreements (SLAs) of cloud data centers' active physical machines. Also taken into account were reductions in the use of central processing units, memory, bandwidth, storage space, running computers, and migrations. The suggested solution made fewer changes in the cloud data center [18].
This proposed work presents a Particle Swarm Optimization-based approach for energy-efficient VM (EEVMPSO) to reduce data center energy usage, and it consolidates VMs onto as few servers as possible while still protecting QoS for newly added customers. The suggested method utilizes a metaheuristic algorithm, Particle Swarm Optimization (PSO). Combining local and global search may provide an almost ideal virtual machine placement solution.
To determine the ideal VM location, EEVMPSO uses a minimized fitness function. The suggested method is implemented in CloudSim and tested with random workloads on various-sized virtual machines and power management units (PMs) before being compared to the existing state-ofthe-art algorithms.
The main contribution of the proposed technique is: The rest of the paper is outlined as follows: the relevant literature is discussed in Section 2, the proposed method is described in Section 3, and the simulation results and a conclusion and suggestions for future study are presented in Sections 4 and 5, respectively.

Literature Review
This section includes previous research on the selected virtual machine (VM) consolidation techniques, as well as a description of the main properties of each. A method for consolidating virtual machines based on the PSO algorithm could optimally and rapidly converge on a mapping from virtual machine to power management unit [19][20]. The authors have been concentrating their efforts on finding a solution to the issue of VM consolidation, which has been recast as a problem of variable-sized bin packing. In addition, the author has been considering the frequency that is readily accessible. The collected data show that, compared to the other meta-heuristics techniques, the machine is suitable in terms of its capacity to reduce the number of PMs. However, a notable drawback is that it has prioritized bandwidth enhancement, neglecting other crucial resources such as memory and processing power.
Masoudi et al. [20] suggested a unique EALBPSO approach for objective functions-based performance evaluation. This strategy can maximize the best possible Standard Deviation load balancing of processors while reducing the system's total energy consumption. It provides a complete method for VM allocation based on an evolutionary algorithm. It can efficiently converge on a VM-to-PM mapping while maintaining the highest feasible level of energy efficiency. The initial allocation of virtual machines is suggested to employ a novel optimization technique called EALBPSO. Maximum efficiency is required in the data center's energy use and the load distribution among its CPUs.
Basu et al. [21] provided a strategy for improving Genetic Algorithm (GA) because the poor VM placement method wastes memory and energy. The study showcased a new and efficient evolutionary technique for VM allocation that can potentially minimize energy consumption while accommodating a larger number of reserved VMs. Alharbi et al. [22] suggested an Ant Colony Optimization (ACO) method for solving the optimization problem of arranging VMs on physical machines in a data center in an energyefficient manner. Consolidating the virtual machines (VMs) into fewer physical machines might improve energy efficiency, and this approach may make it easier to quickly find an appropriate allocation solution for reserved VMs [23]. The VM is constructed depending on the application's needed resources and system operations. The virtual machine (VM) is placed on one of the available servers per the placement strategy. It is a significant challenge to figure out how to allocate virtual machines (VMs) to appropriate servers to cut down on energy use. Ant colony optimization, genetic algorithms (GA), particle swarm optimization (PSO), and whale optimization algorithm (WOA) are the populationbased methods of VMP [24][25].
Tseng et al. [26] proposed the idea of using a multiobjective genetic algorithm (GA) for the aim of resource prediction and allocation. This GA forecasts the demand for resources before allocating VMs to maximize the utilization of resources and the consumption of energy. The GA predicts VM resource demand, followed by energy-efficient server allocation. Cloud computing uses virtual machines; whenever a user requests a cloud-based application, the VM is created to accomplish the request [27]. Sharma et al. [28] introduced an HGAPSO (hybrid method) for VM allocation in the cloud data center. The goal of this approach was to reduce resource waste and SLA violations. The virtual machine allocation is encoded using this method as a particle vector, where the value of a bit is set to 1 if the server is active and 0 otherwise. Since the bit value of the velocity vector is simply dependent on the presence or absence of VMs, this approach is suitable for application in situations with homogenous VMP. This approach is unsuitable for scenarios with heterogeneous VMP since it does not accurately encode the number and kind of VMs.
Shun Yao et al. [29] devised multi-objective multi-swarm optimization to optimize data center process scheduling. The data center's infrastructure is used as a basis for searching for non-dominated scheduling solutions. Particles in separate swarms can interact so that the shared information across the swarms. Multiple swarms were established to accomplish diverse goals. However, the Pareto-based multi-objective PSOCM method that the system proposes requires minimal parameters and has a naturally better means of communication amongst its constituent particles. Compared to other optimization methods like GA and ACO, this aids in delivering faster convergence.
Dahsti et al. [30] devised a solution to meet the technologies' and consumers' needs. A Platform-as-a-Service (PaaS) solution was implemented during the inquiry to facilitate the scheduling of client responsibilities. If the needs for the physical machines and the users' expectations are not compatible in the cloud, then excessive energy use and a trade-off between energy and performance may arise, which will restrict the provider's profitability [31]. PSO enhances energy efficiency without sacrificing service. These techniques reallocated migrating virtual machines to a full host. According to the findings of the simulations carried out in CloudSim, the conditions of the simulation were quite similar to those of the actual environment [32].
Ibrahim et al. [33] projected PAPSO to decrease energy consumption used in data centers by condensing virtual machines onto the fewest number of servers possible. Nevertheless, it considers client QoS as the service. The recommended strategy uses a technique known as Particle Swarm Optimization or PSO for short. It can offer the capability of both local and worldwide search, which is one of the contributing reasons that lead to the realization of the near-optimal VM placement solution. Another contributing aspect is that it can simultaneously deliver local and global searches. PAPSO employs a minimization fitness function to solve the placement of virtual machines that come with nearoptimal solutions. The proposed approach is implemented in CloudSim, where compared to the PABFD using randomized workloads executed on VMs and PMs of different sizes [34]. Table 1 represents the Metaheuristic optimization approaches and their constraints. We then discussed the method objective and research gap that use metaheuristics like WAO, PSO, ABC, GA, etc. Table 1 shows research on the different methods used for VM allocation in cloud data centers, whereas the PSO method has been used to improve the performance of cloud data centers. Wang et al. [43] introduced a novel approach known as local search-based genetic algorithm (LSGA), which incorporates a genetic algorithm (GA) along with a unique local search technique. Initially, the system employs a matrix coding scheme to represent individuals and subsequently formulates the appropriate crossover and mutation operations. The performance of LSGA was evaluated by comparing it with several state-of-the-art algorithms on Sudoku puzzles of varying difficulty levels. Yang et al. [44] introduced a framework called bi-directional feature fixation (BDFF) for particle swarm optimization (PSO). This framework presents a unique approach to mitigate the search space in the context

Study references
Optimization Technique There have been gaps in the evaluation of many significant metrics, including migration time and SLA violation. It utilizes a fixed strategy to place virtual machines and does not provide a useful method for striking a balance between energy efficiency and cost. of large-scale feature selection. The BDFF algorithm employs a dual search strategy, utilizing two opposing directions, in order to effectively guide particles in the exploration of feature subsets of varying sizes. By employing two distinct search directions, BDFF is able to address the selection states of certain features and subsequently prioritize others during the particle update process, thereby effectively reducing the overall search space.
Ge et al. [45] introduced a distributed segment-based genetic algorithm (DSGA) that effectively addresses the issues of data privacy, communication cost, and load balance. In order to safeguard privacy, this study proposes a digitbased anonymity strategy that leverages attribute characteristics. This approach aims to preserve information integrity while enabling fuzzy identification. Subsequently, a three-tier distributed framework is introduced for the purpose of enhancing search efficiency in multi-objective optimization and attaining a balance between communication cost and load distribution.
Li et al. [46] introduced a novel three-layer framework called DDE-ARA, which incorporates adaptive resource allocation. This framework consists of three layers: the algorithm layer, responsible for the evolution of diverse differential evolution (DE) populations; the dispatch layer, which allocates individuals from the DE populations to different distributed machines; and the machine layer, which facilitates the utilization of distributed computers. Within the DDE-ARA framework, three innovative approaches are additionally suggested. The ultimate objective is to enhance the search efficiency of the system. Ge et al. [47] proposed a multitasking distributed differential evolution method. The presented system facilitates communication across various database fragmentation issues by sharing general and efficient allocation data.
In conclusion, energy efficiency is a critical concern in cloud data centres, and VM allocation plays a vital role in optimizing resource usage. Particle Swarm Optimization (PSO) has shown promise in solving complex optimization problems and can be adapted to address the energy-efficient VM allocation problem in cloud data centres. Our proposed EEVMPSO approach aims to contribute to the growing body of research focused on achieving sustainable and energyefficient cloud infrastructures.

System Model: EEVMPSO
The EEVMPSO technique is selected for the data center with various processing metrics including the energy consumption, VM migration, CPU utilization, SLA violation, energy SLA violation, and host shutdown. Memory and processing power define a machine. Users request a VM with needed resources via the data center user interface. VMs are assigned to the first available physical machine based on resource needs. Datacentre managers need to reduce energy consumption by relocating VMs from idle physical equipment and shutting off passive machines.

VM Placement
Allocation in suitable destinations for migrated virtual machines is crucial to effective VM consolidation. In the circumstances involving VM consolidation, the server judged to be the most appropriate for accepting the migrated VM is selected. Despite this, the difficulty of VM placement is not restricted to just these kinds of circumstances. Another scenario for virtual machine deployment involves searching for a suitable host that will accept the virtual machine as an initial placement. We suggest a strategy for the placement of virtual machines from the perspective of virtual machine consolidation and attention to previous publications that have addressed VM consolidation. Numerous research with varying aims and approaches have been offered to develop efficient methods. Fig. 1 clearly shows a broad classification of VM placement strategies based on their underlying approaches, their goals, and the number of these goals. Some methods seek the optimal mapping that accomplishes a single aim, while others seek the best mapping that accomplishes several goals. These goals might include bettering the quality of service offered to customers or cutting expenses for service providers. The recognized method has been employed by various techniques, all of which use meta-heuristic algorithms to decide which PM will get the migrated VM. First Fit (FF) is one example of a greedy heuristic approach that may be used, in which each virtual machine is assigned to the first host that meets its requirements. The BF method uses a mapping between VMs and the best possible PMs to suit the data.

Energy Model
The duration for which a computer's processor and memory are utilized directly affects the level of energy the machine requires. The central processing unit is the primary consumer of power in modern gadgets. The degree to which the frequency of CPU usage employs a computer's resources. Applying Equation (1), we can calculate an energy consumption model for a virtual machine that accounts for the processor's usage in light of the machine's present workload.
Where is the power used at maximum capacity, f is defined as the energy used. At the same time, the device is unused, and is the CPU utilization rate ( [0, 1]) determined by the load placed on the as a result of running a cloud service by Equation (2).
( ) is the power consumed at time t, and E is defined as the total power used by the device for the period [ − 1, ] specified in Equation (3).
Where in the above Equation (4), is calculated for time per active host in SLA violation, represents the total time utilized for a server, represents the time for the active host, and is defined as the total number of servers.
In Equation (5), is defined as the metric to measure the degradation of migration performance.
represents the CPU utilization to calculate the VMs performance degradation, represents the total number of CPUs requested in the particular operation, and represents the total number of VMs.
In Equation (5), represents the SLA violation to estimate the multiplication value of and .

Proposed EEVMPSO
A virtual machine may migrate to any of several different host machines. Concurrently, power consumption may change as a result of VM movement. Consequently, optimizing performance and decreasing energy consumption is crucial to appropriately place and organize VM on host systems and powering down those not in use. In this case, n virtual machines (VMs) will share m physical hosts. The difficulty is in formulating a model for transferring the VMs across systems. Additionally, this design can reduce energy consumption and increase VM transfer capacity.
The relocation of virtual machines as part of an overall attempt to consolidate is an example of the second kind of virtual machine placement. Let the VMs = {VM1, VM1……. VMn} and List of Hosts = {PM1, PM2…… PMm} The goal is to assign each migrated virtual machine to its corresponding physical host using equations (7) to (9).
The determination of the crucial resources required for the migration of a virtual machine (VM) involves identifying the central processing unit (CPU), random access memory (RAM), and bandwidth as indispensable components. Furthermore, a PM cannot host the same VM simultaneously; hence each VMi can only be associated with a single physical host. The approach that has been proposed reflects the mapping of migrated VMs in the form of Equation (10).
Fitness Function: A fitness function is derived from the factors that affect the solution's quality to determine whether the solution can provide a desirable outcome. The value of each solution produced by the proposed algorithm is calculated using this function, and the most optimal solution is identified as having the highest or lowest value, respectively, based on the parameter placement approach. Therefore, the fitness function to measure the efficacy of the optimum result is given by equation (11).
Where is defined as the usage of processors in ith physical machines.
is defined as the usage of the average processor in active physical machines.
represents the usage of memory ith physical machines.
represents average memory usage in active physical machines, and is defined as the ith server is used (i=1 means one server is used or i=0 not used).
Illustration: Each particle in the initial mapping generated by EEVMPSO has a small number of dimensions. The number of virtual machines (VMs) to be migrated is the same as the number of dimensions. For each axis, there is a number that represents the virtual machine (VM) index. A PM can host several virtual machines, but the inverse is false. Each combination of the virtual machine to host has been tested until the optimal fitness function has been found. Below, we examine an illustrative instance of initial mapping generation. The initial phase arrangement of the particle placements in ascending order of VM index is shown in Table 3, and the particles represent 0 and 1 matrix in initial mapping.   Tables 4, 5, 6, 7, 8, 9, and 10 show, in order of scenario, the random sequences assigned to available hosts based on first fit.

Problem Formulation
The PSO algorithm is utilized to acquire a suitable system for distributing assets across physical hosts. Congestion of the system's load at any one time reduces energy usage in data centers, which helps to offset the algorithm's temporal complexity. An allocation of virtual machines to physical hosts is an NP-Hard issue. Therefore. The most effective approach is to use a metaheuristic algorithm. The present analysis employed the PSO method as its primary approach. The PSO algorithm, among other comparable algorithms, has been shown to have the highest performance and is thus employed in addressing these issues. For this reason, this method was designed to speed things up and to provide a more practical solution with a better function than existing methods.
EEVMPSO iterates numerous times to get to a nearly optimum VM location. In each cycle, the velocity of each particle is updated, allowing for the updating of its location. An individual particle's current position is compared to the best position for the particle and the swarm to establish the amount of velocity adjustment to be applied. New coordinates and speed are truncated to the nearest integer before being utilized to choose a suitable host from the available ones. Upon establishing the novel coordinates, it is possible to reevaluate the fitness function of every individual particle. The results of these calculations guide particles in their search for the best possible solutions.
Particle positions at time t are expressed as vectors using Equation (12) and Equation (13) in iteration t also shows that each particle has a velocity represented by a vector.
Vector derived from Equation (14) shows that each particle remembers its best-possible prior location at each repetition. In Equation (15), vector represents the best possible current location for every particle in a swarm.
Equations (16) and (17) are used to calculate the latest changes in position and velocity for each component.
The set of particles taken in the population to be P i = {P 1 , P 2 , . . ., P N }, where N is the total number of particles. A bit frame structure or vector is used to represent each individual particle. The number of virtual machines determines the size of the bit frame or vector. When examining the mapping of virtual machines, the virtual machine with ID 1 occupies the first available position. The appropriate position in the vector is updated with a '1' if the VM picked it as the global best; otherwise, it remains unchanged. The fitness function for each particle is calculated using Equation (11), and the CH selection algorithm utilized in the proposed EEVMPSO is described in algorithm 1 for every particle in P i , and calculates its fitness value. In the first time period, the Pbesti is the particle P i itself. The current iteration's best Pbesti is used to assign the output Gbest, which denotes the chosen optimum VM. After every iteration, the velocity and position of the particles are updated, which means that a new population of particles is created. Again their Pbest is calculated, and accordingly, the Gbest is updated. The process continues while stopping criteria meet, and the stopping criteria is the user sets the maximum number of iterations.

End
The paper proposes a plan to reduce the total energy consumption and the energy overhead associated with migration. A technique for approximating the memory and CPU utilization rates required by individual virtual machines is presented. A Particle Swarm Optimization (PSO) technique was employed to address the problem of consolidating energy-efficient virtual machines, yielding a solution. Fig. 2 depicts the overall flowchart of the operational procedure of EEVMPSO.

Experimental Setup
This study presents the proposed methodology's results in a simulated setting. The simulation test bench utilized in the experimentation is described in detail. Table 12 shows experiments with varying VM and PM sizes and workloads; since each experiment was repeated 20 times, we may have confidence in the findings. A trustworthy result is achieved if this information is combined with that from the standard VM placement method EEVMPSO. Experiment-specific parameter values are provided in Table 13. Analyzing the proposed technique in a real-world environment would need a significant increase in the number of physical and virtual machines (PMs and VMs) employed in our testing, which would be a time-consuming and costly endeavor. The recommended VM placement method is tested in a simulated environment as an alternate option. To design this paper, we have settled on using a simulator platform called the CloudSim toolkit. During our investigation, we used anything from fifty to two hundred actual and simulated personal computers. The proposed method is evaluated using four distinct datasets, each of which contains a different number of provisioning managers and virtual machines: Workload1, which comprises 50 VMs and 50 PMs; Workload2, which shall consist of 100 VMs and 100 PMs; Workload3, which includes 150 VMs and 150 PMs; and Workload4, which contains 200 VMs and 200 PMs. The suggested method is tested to reduce virtual machine migrations, power management shutdowns, energy consumption, and service level agreement violations in data centers.   The Parameters used in this experiment are detailed in Table 13. It would be impossible and costly to duplicate our research in a real-world situation to assess the proposed strategy for many VMs and PMs utilized. The proposed method for VM placement is tested in a simulated environment. Information on the two types of servers and four types of virtual machines that the experiments simulate may be found in Tables 12 and 14, respectively. Using a mix of Local Regression can identify the underutilized hosts, and the VMs are relocated. Compared to PAPSO, KHA, EALBPSO, and RACC-MDT, EEVMPSO has been shown to perform better across various performance metrics.

Experimental Results Discussion
The performance of the proposed EEVMPSO for energy efficient VM allocation is evaluated using various performance metrics including the energy consumption, VM migration, CPU utilization, SLA violation, energy SLA violation, and host shutdown. EEVMPSO technique is associated with four state-of-the-art protocols, including PAPSO [17], KHA [12], EALBPSO [20], and RACC-MDT [2].

4.1.1Energy Consumption Analysis:
EEVMPSO aims to consolidate the migrated VMs onto as few hosts as is practically practicable. It increases CPU utilization on busy servers while putting idle hosts to rest. Fig.  3 displays the outcomes of this investigation, which demonstrate potential methods for cutting down on energy use in the home. Energy savings of 10.86%, 18.22%, 25.8%, and 31.34% are shown when the suggested technique is compared to PAPSO, KHA, EALBPSO, and RACC-MDT, respectively. As long as it is constrained by the requirement to prevent SLA violations, the EEVMPSO approach may adequately consume power usage. When VM migration, there is a chance that the system's performance will degrade, which would violate the SLA. Performance suffers as the number of virtual machines (VMs) transferred across hosts grows. EEVMPSO implements a strategy to lessen the share of overworked hosts and the prevalence of busy servers. Therefore, decreasing the number of servers in use may increase the CPU usage of hosts, allowing for an ideally saturated set of servers. It does, however, reduce the total number of overworked servers.

RACC-MDT
Taking these two factors into account has reduced VM migrations, as seen in Fig. 2. When compared to PAPSO, KHA, EALBPSO, and RACC-MDT, the EEVMPSO approach has the potential to minimize the VM migrations by 10.09%, 10.45%, 19.16%, and 28.82%, respectively. EEVMPSO achieved this goal with fewer VM migrations, unlike VM consolidation solutions, which depend on completing numerous VM migration operations among servers to minimize the total power consumption in data centers. The attainment of the objective of diminishing the overall power consumption necessitates this measure. As a direct and immediate result of this reduction in the total number of virtual machine (VM) migration processes being carried out, the newly delivered services will be of a much higher quality.

The Average Utilization of CPU
The average CPU use of the designated Server1 and Server2 classes of servers is shown in Fig. 5. The utilization rates of both individual FFD servers and the full pool of available servers are relatively low. Since there is a wide gap between the CPU utilization of Server1 and Server2, it is apparent that FFD cannot efficiently manage varied resources. It is important to note that EEVMPSO places the highest CPU demand on servers of type Server1, whereas PAPSO, KHA, EALBPSO, and RACC-MDT place lower orders on servers of type Server2.

Figure 5. Comparison analysis of average CPU Utilization
EEVMPSO prefers highly configured servers over DTH-lowprofile MF ones so that the VMs can communicate with one another more efficiently. Consolidation may go as deep as one's memory will allow. The fact that EEVMPSO's average memory use is thus close to 100% demonstrates how well it can consolidate high-demand virtual machines.

SLA Violation:
A new metric independent of processing loads must be introduced to measure the SLA provided to a virtual machine's end user. The proportion of time that servers are at 100% utilization that happens as a consequence of migrations is developed as two metrics for assessing the severity of SLA breaches. Another metric is the decline in performance that occurs during migrations. Because of this, we introduce a holistic metric called SLA Violation. Experiment results showed that the EEVMPSO does not violate SLA, unlike the PAPSO, KHA, EALBPSO, and RACC-MDT. EEVMPSO can reduce SLA violations even when the virtual machines and PMs increase. The primary objective of this research is to reduce the amount of energy used by moving as many virtual machines as possible onto as few hosts as is practically practicable. Nevertheless, by eliminating two of the most common causes of SLA violations, this endeavor may also reduce such infractions. SLA violations are reduced by 6.4%, 8.7%, 14.6%, and 20.5% on average with EEVMPSO compared to PAPSO, KHA, EALBPSO, and RACC-MDT, respectively. The average number of transitions across CPUs with different processing energy and memory is shown in Fig. 7. The proposed approach involved allocating a separate host computer to each virtual machine. The proposed solution outperformed alternatives when the actual devices were in varying states, as it took advantage of the status of physical machines in the reallocation of virtual machines and deactivated more of them. Virtual machines (VMs) were employed in all the other methods, even though they performed better when coupled with actual computers after they crossed a certain performance threshold. The experimental findings showed that the suggested approach might increase the number of migrated virtual machines by 11.19%, 19.25%, 32.86%, and 38.2% in different iterations compared to the PAPSO, KHA, EALBPSO, and RACC-MDT, respectively. The VM placement problem reveals that it is a crucial problem. Specifically, cloud service providers condense virtual machines (VMs) onto as few servers as possible to save operational. Conversely, consumer attention is directed toward service performance, which must remain unchanged throughout the consolidation. As a result, cloud providers are looking for ways to save costs by lowering energy use without affecting service level agreements. As a result, a new measure for judging VM location has been introduced: the trade-off, which considers both energy use and SLA breaches. Our suggested method for lowering energy usage using EEVMPSO does not infringe on any Service Level Agreements. In Fig. 8, EEVMPSO achieves better results than PAPSO, KHA, EALBPSO, and RACC-MDT when it comes to lowering energy SLA violation. When considering data center energy use and SLA breaches, an estimated 5.77%, 15.3%, 26.19%, and 30.4% of savings compared to PAPSO, KHA, EALBPSO, and RACC-MDT. Quality of service may also be significantly affected by the rate at which hosts are restarted. If the CPU utilization of a server falls below a predetermined threshold, the remaining virtual machines are removed. The server could host virtual machines (VMs) that have already been relocated, and if it is underutilized, it might migrate those VMs once again. As a direct result, the status could be reset to the low power mode to save energy. This circumstance harms the use of energy and user experience due to the frequent migrations of virtual machines (VMs). They are repetitively subjecting a host to a light workload and wasting resources. As seen in Fig. 9, EEVMPSO is set up to prevent overloaded and underloaded circumstances, leading to fewer host shutdowns. The proposed strategy decreases the average number of host shutdowns by 40.7%, 46.7%, 55.45%, and 6% compared to PAPSO, KHA, EALBPSO, and RACC-MDT, respectively.

Conclusion
In this research paper, we proposed an EEVMPSO method for dynamically assigning virtual machines to physical hosts, considering the actual consumption of cloud resources at any given time. Our research investigated the limitations of traditional VM allocation methods and demonstrated that Particle Swarm Optimization (PSO) is a promising approach for tackling the complex VM allocation problem in largescale cloud environments. A PSO-based VM allocation strategy decreases data center energy consumption and SLA violations. Avoiding service level agreement (SLA) violations is made more accessible by moving virtual machines off servers nearing capacity. It is essential to locate hosts before transferring virtual machines. EEVMPSO is a PSO-based VM placement approach that decreases energy consumption and 2.2% violating service level agreements (SLAs). Compared to PAPSO, KHA, EALBPSO, and RACC-MDT, studies have shown that using the suggested technique may reduce energy use by an average of 10.86%, 18.22%, 25.8%, and 31.34%. The proposed method is used in CloudSim, and simulation results confirmed its usefulness concerning CPU usage, energy consumption, VM migrations, host shutdowns, and energy SLA breaches. Real-world implementation of EEVMPSO may verify its efficacy. Additionally, we recognize the constant evolution of cloud technologies, and future research should explore the integration of dynamic workload scenarios and other optimization techniques to further improve energy efficiency.