|
Algorithm 1: RUA placement. |
| 1: |
Input: candidate_hostList,vmList Output: migrationSched |
| 2: |
for each: vm in vmList do
|
| 3: |
allocatedHost ← NULL |
| 4: |
CPURequired ← vm.getCPUrequired() |
| 5: |
for each: host in hostList do
|
| 6: |
if host has enough resource for vm then
|
| 7: |
CPUratio ← CPURequired/host.getTotalCPU() |
| 8: |
if
then
|
| 9: |
if CPUratio <
then
|
| 10: |
allocatedHost ← host |
| 11: |
end if
|
| 12: |
else then
|
| 13: |
if CPUratio > =
then
|
| 14: |
allocatedHost ← host |
| 15: |
end if
|
| 16: |
end if
|
| 17: |
end for
|
| 18: |
if allocatedHost ≠ NULL then
|
| 19: |
migrationSched.add(vm,allocatedHost) |
| 20: |
else then
|
| 21: |
migrationSched.add(PABFD(vm,allocatedHost)) |
| 22: |
end if
|
| 23: |
end for
|
| 24: |
return migrationSched |