Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1EE1610634 for ; Thu, 19 Dec 2013 04:27:51 +0000 (UTC) Received: (qmail 34485 invoked by uid 500); 19 Dec 2013 04:27:49 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 34013 invoked by uid 500); 19 Dec 2013 04:27:44 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 34005 invoked by uid 99); 19 Dec 2013 04:27:43 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Dec 2013 04:27:43 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id BE814E368; Thu, 19 Dec 2013 04:27:42 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: nitin@apache.org To: commits@cloudstack.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/4.3 to d2f1940 Date: Thu, 19 Dec 2013 04:27:42 +0000 (UTC) Updated Branches: refs/heads/4.3 15403a1f2 -> d2f194064 CLOUDSTACK-4941: Adding the missing file During HA and maintenance call different planners (if the original planners are not able to find capacity) which skip some heurestics Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d2f19406 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d2f19406 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d2f19406 Branch: refs/heads/4.3 Commit: d2f194064d619dd59582d8e2461ff3f96322e539 Parents: 15403a1 Author: Nitin Mehta Authored: Wed Dec 18 20:26:51 2013 -0800 Committer: Nitin Mehta Committed: Wed Dec 18 20:26:51 2013 -0800 ---------------------------------------------------------------------- .../src/com/cloud/ha/HighAvailabilityManagerImpl.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d2f19406/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java index 54ca0aa..b2c1034 100755 --- a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java +++ b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java @@ -551,18 +551,15 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai params.put(VirtualMachineProfile.Param.HaTag, _haTag); } - // First try starting the vm with its original planner, if it doesn't succeed send HAPlanner as its an emergency. - _itMgr.advanceStart(vm.getUuid(), params, null); - VMInstanceVO started = _instanceDao.findById(vm.getId()); - if (started != null && started.getState() == VirtualMachine.State.Running) { - s_logger.info("VM is now restarted: " + vmId + " on " + started.getHostId()); - return null; - }else { + try{ + // First try starting the vm with its original planner, if it doesn't succeed send HAPlanner as its an emergency. + _itMgr.advanceStart(vm.getUuid(), params, null); + }catch (InsufficientCapacityException e){ s_logger.warn("Failed to deploy vm " + vmId + " with original planner, sending HAPlanner"); _itMgr.advanceStart(vm.getUuid(), params, _haPlanners.get(0)); } - started = _instanceDao.findById(vm.getId()); + VMInstanceVO started = _instanceDao.findById(vm.getId()); if (started != null && started.getState() == VirtualMachine.State.Running) { s_logger.info("VM is now restarted: " + vmId + " on " + started.getHostId()); return null;