CS-15560 : Improve HVM logging of hosts

When a host is not considered for deployment because it is disabled HVM,
then call that out in the logs for debugging.
This commit is contained in:
Prasanna Santhanam 2012-07-13 11:25:43 +05:30
parent b90908be80
commit 135a999db8
1 changed files with 8 additions and 0 deletions

View File

@ -282,6 +282,7 @@ public class FirstFitAllocator implements HostAllocator {
String templateGuestOSCategory = getTemplateGuestOSCategory(template);
List<HostVO> prioritizedHosts = new ArrayList<HostVO>();
List<HostVO> noHvmHosts = new ArrayList<HostVO>();
// If a template requires HVM and a host doesn't support HVM, remove it from consideration
List<HostVO> hostsToCheck = new ArrayList<HostVO>();
@ -289,12 +290,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<HostVO> highPriorityHosts = new ArrayList<HostVO>();