Commit 593b6158 authored by aninhacostaribeiro's avatar aninhacostaribeiro
Browse files

RAM and CPU were switched over in Host constructor

parent 52b6164c
......@@ -182,6 +182,10 @@ public class DefaultGreenStrategy implements GreenStrategy {
public void wakeUpSleepingHost(int minCPU, int minRAM) {
Host host = this.sleepingHosts.peek();
if (host == null) {
LOGGER.info("There is no host sleeping at the moment.");
return;
}
try {
if (host.getAvailableCPU() < minCPU) {
LOGGER.info("Tried to wake hosts but no hosts were found");
......
......@@ -141,8 +141,8 @@ public class OpenStackInfoPlugin implements CloudInfoPlugin {
int availableRamInTheHost = availableRam.get(hostName);
int availableCPUInTheHost = availableCPU.get(hostName);
Host host = new Host(name, runningVMInTheHost, novaEnable,
novaRunning, updateTime, availableRamInTheHost,
availableCPUInTheHost);
novaRunning, updateTime, availableCPUInTheHost,
availableRamInTheHost);
hosts.add(host);
} catch (Exception e) {
// Ignoring exceptions for hosts in unavailable zones
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment