| Algorithm 2: Integrated VM consolidation. | |
| 1: | Input: hostList Output: scheduleMap |
| 2: | for each: host in hostList do |
| 3: | if LR(host) is overloaded then |
| 4: | while host is overloaded do |
| 5: | VM ← MMT(host) |
| 6: | migrationList.add(VM) |
| 7: | end while |
| 8: | end if |
| 9: | end for |
| 10: | scheduleMap.add(RUA(migrationList)) |
| 11: | Obtain candidateHostSet from hostList |
| 12: | for each: host selected from candidateHostSet do |
| 13: | if PA(host) is underloaded then |
| 14: | if RUA(host.getVmList()) succeeds then |
| 15: | scheduleMap.add(RUA(host.getVmList())) |
| 16: | Switch the host to sleep mode |
| 17: | end if |
| 18: | end if |
| 19: | end for |
| 20: | return scheduleMap |