## 5 Evaluated Algorithms
### Carbon- and Power-Efficient Optimal Frequency VM Placement (C-PEF)
The algorithm complexity with \(n\) VM requests, \(c\) clusters, and \(m\) nodes is derived as \(O(n(\textit{clog(c)}+c(m+\textit{mlog(m)}+\textit{m)}))\). The final complexity is expressed as \(O(n(\textit{clog(m)}))\). Figure 2: Host selection policy for carbon- and power-efficient optimal frequency(C-PEF). ### Carbon-Aware First-Fit Least-Empty VM Placement (C-FFLE)

This approach performs data center and cluster selections similarly to C-PEF, C-FFF, and C-PE, but differs in terms of its host selection policy. The C-FFLE algorithm considers the carbon footprint rate (CFR) and power usage effectiveness (PUE) for cluster selection and sorts the _Totclusterlist_ in ascending order based on PUE\(\times\)CFR. The host selection is based on the first-fit strategy, whereby the hosts are ordered based on the least available resources. This approach does not perform any greedy searching for minimum power heuristic methods; instead, it uses VM best-fit heuristic methods based on resource requirements for node selection. ```
Input: Clusterlist, Hostlist, ReqQ Output: TargetVMQ
1 whileVM in ReqQ do
2 Totclusterlist\(\leftarrow\)Get the clusters from the Clusterlist of all datacenters;
3 sort the clusters in Totclusterlist in ascending order of (PUE*CFR) using Equation (7);
4 For cluster in Totclusterlist do
5 Mhostlist\(\leftarrow\)Get the Hostlist from cluster;
6 For freq in freqstep do
7 For host in Mhostlist do
8 maxu\(\leftarrow\)Get utilization of freq using Equation 4 with freq as l;
9 cur-uti\(\leftarrow\)Get current utilization of the host using Equation (4);
10 rem-uti\(\leftarrow\)maxu - cur-uti;
11 if feasible host for VM then
12 TargetVMQ add(VM, host);
14 Break host, freq and cluster loop and go to 1 ;
16 Return TargetVMQ. ```

**Algorithm 3**C-FFF Carbon-Aware First-Fit Least-Empty VM Placement

### Carbon-Aware First-Fit VM Placement (C-FF)

The cluster selection by the C-FF algorithm is similar to C-PEF,C-FF,C-FFLE, and C-PE algorithms, but differs in terms of the host selection policy. The algorithm considers the carbon footprint rate (CFR) and power usage effectiveness (PUE) for data center selection and sorts the _Totclusterlist_ in ascending order based on PUE\(\times\)CFR. It uses first-fit heuristic methods for host selection. ## 6 Experimental Environment and Assumptions

Considering the expense and time incurred in the evaluation of large-scale experiments in real time, Matlab software is used to simulate the environment. Each reservation interval is assumed to have duration of 300 s. The input request is accepted at the beginning of each reservation cycle. A data center with heterogeneous systems with different power models capable of provisioning multiple VMs is considered. The virtual resource size is not known and the VM request has no limitations. The VM is assumed to be active throughout the execution time. All the tasks are considered to be CPU-intensive. The power consumption of a task is measured by its CPU utilization, as this is considered to consume a significant fraction of energy. All the machines are assumed to be in an off state when not in use. The VM's resource requirements are assumed to be constant throughout the reservation interval. The data center's safe operating temperature is considered to be 23 \({}^{\circ}\)C. The peak IT load (server only) power estimation for the data center is 52 kW for the physical machine specifications given in Table 1[53]. The data center is assumed to have a floor space of approximately 500 square feet. The total electricity power requirement is calculated as 124 kW (including cooling and lighting load). The CPU power consumption for all servers should not exceed 17.3 kW. The cooling load concerning CPU utilization is limited to 12.11 kW [54]. The data centers are assumed to be powered only by grid energy sources.