From 49dc8c58f6431c9c69e6d63beb80c35cbafb34a4 Mon Sep 17 00:00:00 2001 From: Andreas Egger Date: Thu, 13 Jun 2013 20:58:59 +0200 Subject: [PATCH] Fixed bug in Migration --- .../ac/tuwien/lsdc/sched/AbstractSchedulerWithMigration.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/at/ac/tuwien/lsdc/sched/AbstractSchedulerWithMigration.java b/src/at/ac/tuwien/lsdc/sched/AbstractSchedulerWithMigration.java index 26d90ae..737ca32 100644 --- a/src/at/ac/tuwien/lsdc/sched/AbstractSchedulerWithMigration.java +++ b/src/at/ac/tuwien/lsdc/sched/AbstractSchedulerWithMigration.java @@ -34,7 +34,7 @@ public abstract class AbstractSchedulerWithMigration extends AbstractScheduler { // iterate through all the PMs (except the one with the highest utilization) for (int i = 0; i < (pms.size() - 1); i++) { PhysicalMachine currentPM = pms.get(i); - if (currentPM.isRunning() && (currentPM.getTotalVMs() > 0)) { + if (currentPM.isRunning() && (currentPM.countCurrentlyRunningVMs() > 0)) { VirtualMachine currentVM = currentPM.getVirtualMachines().values().iterator() .next(); for (Application app : currentVM.getApplications()) { @@ -42,7 +42,7 @@ public abstract class AbstractSchedulerWithMigration extends AbstractScheduler { // try to fit app on most utilized machine to get maximum utilization for (int j = pms.size()-1; j > i; j--) { PhysicalMachine nextPM = pms.get(j); - if (nextPM.isRunning() && (nextPM.getTotalVMs() > 0)) { + if (nextPM.isRunning() && (nextPM.countCurrentlyRunningVMs() > 0)) { VirtualMachine nextVM = nextPM.getVirtualMachines().values().iterator() .next(); if (deployApp(nextVM, app)) { -- 2.43.0