From 3d7f6a35ad2ab1e335b3beeb52d278bfd355a791 Mon Sep 17 00:00:00 2001 From: Prasanna Santhanam Date: Fri, 13 Jul 2012 10:49:49 -0700 Subject: [PATCH] CS-15560 : Improve HVM logging of hosts When a host is not considered for deployment because it has disabled HVM, then call that out in the logs for debugging. Signed-off-by: Nitin Mehta --- .../agent/manager/allocator/impl/FirstFitAllocator.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java b/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java index 0f163cc6e7a..27892316469 100755 --- a/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java +++ b/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java @@ -285,6 +285,7 @@ public class FirstFitAllocator implements HostAllocator { String templateGuestOSCategory = getTemplateGuestOSCategory(template); List prioritizedHosts = new ArrayList(); + List noHvmHosts = new ArrayList(); // If a template requires HVM and a host doesn't support HVM, remove it from consideration List hostsToCheck = new ArrayList(); @@ -292,12 +293,19 @@ public class FirstFitAllocator implements HostAllocator { for (HostVO host : hosts) { if (hostSupportsHVM(host)) { hostsToCheck.add(host); + } else { + noHvmHosts.add(host); } } } else { hostsToCheck.addAll(hosts); } + if (s_logger.isDebugEnabled()) { + if (noHvmHosts.size() > 0) { + s_logger.debug("Not considering hosts: " + noHvmHosts + " to deploy template: " + template +" as they are not HVM enabled"); + } + } // If a host is tagged with the same guest OS category as the template, move it to a high priority list // If a host is tagged with a different guest OS category than the template, move it to a low priority list List highPriorityHosts = new ArrayList();