Return-Path: X-Original-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4418F9284 for ; Fri, 13 Jul 2012 23:52:24 +0000 (UTC) Received: (qmail 72467 invoked by uid 500); 13 Jul 2012 23:52:24 -0000 Delivered-To: apmail-incubator-cloudstack-commits-archive@incubator.apache.org Received: (qmail 72432 invoked by uid 500); 13 Jul 2012 23:52:24 -0000 Mailing-List: contact cloudstack-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-commits@incubator.apache.org Received: (qmail 72425 invoked by uid 99); 13 Jul 2012 23:52:24 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Jul 2012 23:52:24 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id DAE2213F4E; Fri, 13 Jul 2012 23:52:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: anthonyxu@apache.org To: cloudstack-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: git commit: CS-15551 : if 'xen.check.hvm' is false, don't check template hvm in allocator Message-Id: <20120713235223.DAE2213F4E@tyr.zones.apache.org> Date: Fri, 13 Jul 2012 23:52:23 +0000 (UTC) Updated Branches: refs/heads/master 7a5efcc2e -> 829acf6e2 CS-15551 : if 'xen.check.hvm' is false, don't check template hvm in allocator Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/829acf6e Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/829acf6e Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/829acf6e Branch: refs/heads/master Commit: 829acf6e27b6f000d72715fedd69e885a1537501 Parents: 7a5efcc Author: anthony Authored: Thu Jul 12 11:16:03 2012 -0700 Committer: anthony Committed: Fri Jul 13 16:45:57 2012 -0700 ---------------------------------------------------------------------- .../manager/allocator/impl/FirstFitAllocator.java | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/829acf6e/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java ---------------------------------------------------------------------- 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 2789231..ac2e92b 100755 --- a/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java +++ b/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java @@ -81,6 +81,7 @@ public class FirstFitAllocator implements HostAllocator { @Inject VMInstanceDao _vmInstanceDao = null; @Inject ResourceManager _resourceMgr; float _factor = 1; + boolean _checkHvm = true; protected String _allocationAlgorithm = "random"; @Inject CapacityManager _capacityMgr; @@ -343,6 +344,9 @@ public class FirstFitAllocator implements HostAllocator { } protected boolean hostSupportsHVM(HostVO host) { + if ( !_checkHvm ) { + return true; + } // Determine host capabilities String caps = host.getCapabilities(); @@ -411,6 +415,8 @@ public class FirstFitAllocator implements HostAllocator { if (allocationAlgorithm != null) { _allocationAlgorithm = allocationAlgorithm; } + String value = configs.get("xen.check.hvm"); + _checkHvm = value == null ? true : Boolean.parseBoolean(value); } return true; }